Vector displacement on top of adaptive subdivision breaks normal #111588
Labels
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
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#111588
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
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?
System Information
Operating system: Windows 10 / Ubuntu 22.04
Graphics card: NVidia A6000 / K5100M
Blender Version
Broken: 4.0
Worked: never
Short description of error
Vector displacement on top of adaptive subdivision breaks normal.
Exact steps for others to reproduce the error
I can confirm the issue and quickly looked into investigating it but couldn't figure out exactly what's causing it. But just for reference, here are a few things I found:
Another update. The black faces issues is caused by the normals of select faces pointing in directions that result in the face rendering incorrectly (as would be expected). I just wanted to explicitly point this out since similar reports to this had NaN faces due to divide by 0. This is not the case here.
Now about the differences with OSL vs SVM.
It seems OSL and SVM are doing basically the same math, but they're working with different values.
Specifically
dP.dx
anddP.dy
insvm_node_set_bump()
from/intern/cycles/kernel/svm/displace.h
are different fromdPdx
anddPdy
fromnode_bump()
in/intern/cycles/kernel/osl/shaders/node_bump.osl
The difference in these values tells us why OSL and SVM behave differently. But I'm not knowledgeable enough in this area to know which one is correct. Someone else will have to look into this issue. But I hope this helps as a starting point. Just to recap:
@LukasStockner I noticed you've been doing a bit of work related to normals and OSL recently. Maybe you could take a look at this issue if you have the time and knowledge?
This is caused by the compact differential representation that was added a while ago to help with GPU memory usage.
With OSL, the full dPdx/dPdy differentials are tracked in
ShaderGlobals
, sonode_bump
gets the correct ones.With SVM,
svm_node_enter_bump_eval
gets the full differentials from attributes, but then only stores a compact form. Whensvm_node_set_bump
expands the compact form again, it ends up with the wrong value.Two possible solutions: Either pack the full differentials into the bump state and pass its offset into
svm_node_set_bump
through the SVM compiler, or re-fetch the undisplaced position attribute insvm_node_set_bump
.