WIP: Cycles: Only apply bake ray nudging on objects with smooth normals #120773
No reviewers
Labels
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset System
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Code Documentation
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
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
Viewport & EEVEE
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Asset Browser Project
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
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
Module
Viewport & EEVEE
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Severity
High
Severity
Low
Severity
Normal
Severity
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
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#120773
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "Alaska/blender:only-apply-to-smooth"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
When baking textures from the perspective of the camera, nudging is
applied to the ray direction to avoid discontinuities on triangles with
smooth shading viewed from grazing angles.
This commit disables this feature on triangles that use flat shading
as this feature does not help in the case of flat shading, and actually
causes distortions to surfaces viewed from grazing angles.
@blender-bot build
Cycles: Only apply bake normal nudging on objects with smooth normalsto Cycles: Only apply bake ray nudging on objects with smooth normalsI've just now realized that this causes some sort of discontinuity on triangles facing away from the camera. It's visible on the back side of a high poly UV sphere (256 segments, 128 rings).
So I'm just asking that you re-review this based on this information before committing. From what I can tell, the ray nudging was added to avoid discontinuities on triangles facing away from the camera, and so there is some level of importance here.
If this is trading one problem for another, I rather not change things here.
If there is a bug report, or example blend or images making the case for why the new behavior is better it can be considered. But otherwise I rather not spend time on this.
We're trading the problem that triangles facing the camera at grazing angles are distorted when baked using the "bake from active camera" option, for different types of distortions on the triangles facing away from the camera.
Here's some example images:
I created this pull request (and explored some other ideas) due to this report: #120729
Basically, the user is unable to bake reflections of the ocean at grazing angles due to the code:
Since the code mainly benefits objects with smooth normals, I thought it would be okay to turn it off for flat normals, but obviously it is changing the behavior here, and whether or not that's okay is review.
This still doesn't resolve the issue that objects with smooth shading have incorrect reflections at grazing angles. So I was investigating other ideas such as: make
surface_normal_offset
user adjustable, add the option to bypass that code, adjust the formula to reduce the distortion (I still haven't fully figured this one out). If you would prefer one of these other methods, I can create a pull request.Cycles: Only apply bake ray nudging on objects with smooth normalsto WIP: Cycles: Only apply bake ray nudging on objects with smooth normalsSet to WIP so it doesn't get commited by someone. Brecht didn't seem to like this change.
Checkout
From your project repository, check out a new branch and test the changes.