Cycles bump map is not super sampled but filtered #43495

Closed
opened 2015-01-31 03:26:58 +01:00 by Jason Ellis · 10 comments

System Information
OS X Yosemite

Blender Version
Latest

Short description of error

Exact steps for others to reproduce the error
Render high res bump tex close-up and then downsample.
Render high red bump from a distance.
Second result is blurry and misses features.

My guess is that it's per pixel pre-filtered, however, it would be better to sample the bump map at full res.

**System Information** OS X Yosemite **Blender Version** Latest **Short description of error** **Exact steps for others to reproduce the error** Render high res bump tex close-up and then downsample. Render high red bump from a distance. Second result is blurry and misses features. My guess is that it's per pixel pre-filtered, however, it would be better to sample the bump map at full res.
Author

Changed status to: 'Open'

Changed status to: 'Open'
Author

Added subscriber: @jasonellis

Added subscriber: @jasonellis
Member

Added subscriber: @Blendify

Added subscriber: @Blendify
Member

Please post a .blend and some pictures and a youtube video will help

Please post a .blend and some pictures and a youtube video will help
Author

Here is an example.

BumpSamplingBug.zip

Here is an example. [BumpSamplingBug.zip](https://archive.blender.org/developer/F140178/BumpSamplingBug.zip)
Author

A workaround is, of course, to render at, say, 10x the target size, reduce the sample count by 10x and then downsample the result by 10x. (This is also what I have done for comparison in the example I have provided.)

A workaround is, of course, to render at, say, 10x the target size, reduce the sample count by 10x and then downsample the result by 10x. (This is also what I have done for comparison in the example I have provided.)

Changed status from 'Open' to: 'Archived'

Changed status from 'Open' to: 'Archived'
Sergey Sharybin self-assigned this 2015-02-10 09:15:51 +01:00

This is because mipmaps are not implemented in Cycles. Well, they are implemented but only when using OpenShadingLanguage backend. For until mipmaps are implemented for SVM such cases would always be noisy and wrong.

Thanks for the report, but it is a known thing TODO.

This is because mipmaps are not implemented in Cycles. Well, they are implemented but only when using OpenShadingLanguage backend. For until mipmaps are implemented for SVM such cases would always be noisy and wrong. Thanks for the report, but it is a known thing TODO.
Author

Just out of curiosity, couldn't you continue to use the OSL backend but make mipmap texture lookups at level N-log_2(sample_count) instead of at N? That should work fine if I'm not mistaken. (Ideally, you should create mipmaps of bump and normal maps with a Gaussian lobe model since a simple average is not a good statistical model for directions - [x]. Otherwise, it might be worthwhile to add a (default?) option to completely deactivate mipmapping for bump and normal maps i.e. to take samples at the full resolution.).

By the way, this problem is not only restricted to bump maps since mipmapping with a sample sizes of the entire fragments (this is what I assume is happening here) generally has a lower image quality compared to supersampling with mipmapped subsamples.

Could you point me to the source code in which the texture lookup is done? Perhaps, I can provide a patch.

Just out of curiosity, couldn't you continue to use the OSL backend but make mipmap texture lookups at level N-log_2(sample_count) instead of at N? That should work fine if I'm not mistaken. (Ideally, you should create mipmaps of bump and normal maps with a Gaussian lobe model since a simple average is not a good statistical model for directions - [x]. Otherwise, it might be worthwhile to add a (default?) option to completely deactivate mipmapping for bump and normal maps i.e. to take samples at the full resolution.). By the way, this problem is not only restricted to bump maps since mipmapping with a sample sizes of the entire fragments (this is what I assume is happening here) generally has a lower image quality compared to supersampling with mipmapped subsamples. Could you point me to the source code in which the texture lookup is done? Perhaps, I can provide a patch. - [x] http://www.cs.columbia.edu/cg/normalmap/normalmap.pdf

If you want to look into sampling, then for OSL the closest entry point is https:*developer.blender.org/diffusion/B/browse/master/intern/cycles/kernel/osl/osl_services.cpp;298d8681a0ac28ccc96e593a02ad34a5cef624c6$842 and for SVM think this is a good start https:*developer.blender.org/diffusion/B/browse/master/intern/cycles/kernel/svm/svm_image.h;298d8681a0ac28ccc96e593a02ad34a5cef624c6$53

Looking into mipmaps support for SVM is also welcome, but that's kinda can of worms because of limited VRAM on GPUs.. But still be welcome to look into :)

If you want to look into sampling, then for OSL the closest entry point is https:*developer.blender.org/diffusion/B/browse/master/intern/cycles/kernel/osl/osl_services.cpp;298d8681a0ac28ccc96e593a02ad34a5cef624c6$842 and for SVM think this is a good start https:*developer.blender.org/diffusion/B/browse/master/intern/cycles/kernel/svm/svm_image.h;298d8681a0ac28ccc96e593a02ad34a5cef624c6$53 Looking into mipmaps support for SVM is also welcome, but that's kinda can of worms because of limited VRAM on GPUs.. But still be welcome to look into :)
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#43495
No description provided.