Cycles Refactor: Replace fixed Tangent input with custom input #119042
No reviewers
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
4 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#119042
Loading…
Reference in New Issue
No description provided.
Delete Branch "Alaska/blender:tangent-to-param5"
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?
This replaces the fixed Tangent input in
BsdfNode::compile
with a custom input.
This is done because very few nodes actually use the tangent input
and it would be better to have this slot avaliable for other inputs
on different nodes in the future.
There should be no user facing changes.
Cycles: Replace the fixed Tangent input with custom inputto WIP: Cycles: Replace the fixed Tangent input with custom input@LukasStockner suggested this might be desirable during the review of #114499, but I noted I'd prefer this as a seperate pull request.
2a7939ddbd
to2d715d0a0a
WIP: Cycles: Replace the fixed Tangent input with custom inputto Cycles: Replace the fixed Tangent input with custom input2d715d0a0a
to7f215a0323
@blender-bot build
@blender-bot build
Is there some actual practical example of nodes which plan to use the this slot?
I can't say undocumented and hard-to-see re-shuffling of numbered generic parameters like
param5_offset, param3_offset, param4_offset
is straightforward to follow and understand. There're plenty of cryptic aspects of Cycles already, to me it feels we should not make it even more cryptic. If there are plans to actually utilize the freed slot, maybe we can schedule a bit of time to work on a cleaner solution?I think this change is small enough to go through for now, but in general I agree with @Sergey that the parameter handling in its current form is a mess:
int
, some asuchar
.I don't think we can make this super-fancy because of the inherent limitations of the host-kernel interface, but it has to be possible to do it better than the current state. Even something small like a table of all SVM opcodes and their arguments might help.
@ -2393,2 +2392,4 @@
closure = distribution;
ShaderInput *tangent = input("Tangent");
tangent = tangent->link || tangent->constant_folded_in ? tangent : NULL;
I'd prefer to add a
SVMCompiler::is_linked
to check these conditions, seems a bit cleaner than repeating them here.If not, I'd suggest at least wrapping the condition in parentheses.
Also, nitpick, but I think this should be
nullptr
in new code.Wrong button, sorry.
Lukas said we may want to make this change to make the addition of roughness to the Subsurface scattering node simpler: #114499
What did you have in mind for a cleaner solution? Just making sure it's in numerical order (param3, param4, param5) and make all the fixes related to changing the order (Like this:
48ade96387
)? Or something more complex?Definitely nothing more complex, not for this step anyway. Something more complex would be better to be be handled separately.
Maybe for now it could be something simple as renaming
param{1,2,3,4,5}
tobsdf_{y,z}
/data_{y,z,w}
. Then it becomes more clear where things will be stored, even if they are currently expected to be provided out-of-canonical-order. Thoughts?Cycles: Replace the fixed Tangent input with custom inputto Cycles Refactor: Replace fixed Tangent input with custom input@blender-bot build
I like the code changes, but some tests appear to be failing.
I can not reproduce the test failures locally. So I've merged with main and pushed the changes to my branch in hope that fixes it.
@blender-bot build
You're probably using a build without asserts? Either a debug build, or enabling
WITH_ASSERT_RELEASE
should work.@blender-bot build