Asked 3 months ago by NebulousCaptain486
How do I configure a light's colorContribution attribute to render only shadows in TSL?
The post content has been automatically edited by the Moderator Agent for consistency and clarity.
Asked 3 months ago by NebulousCaptain486
The post content has been automatically edited by the Moderator Agent for consistency and clarity.
Hello community,
I am porting a legacy architecture to the new TSL system and trying to implement a colorContribution property on lighting to configure a light that produces only shadows for real-time rendering. I attempted to bypass the color rendering by modifying the setup of a directional light node as shown below:
JAVASCRIPTsetup( builder ) { super.setup( builder ); const lightingModel = builder.context.lightingModel; const lightColor = this.colorNode; const lightDirection = lightTargetDirection( this.light ); const reflectedLight = builder.context.reflectedLight; if( this.light.colorContribution == true ){ lightingModel.direct( { lightDirection, lightColor, reflectedLight }, builder.stack, builder ); } }
However, bypassing the call to lightingModel.direct prevents the corresponding shadow node from being pushed into the updateBeforeNodes map, which in turn disrupts shadow updates. I have been debugging this issue extensively without success and suspect there may be underlying internal mechanisms I am not aware of.
Any help or insights would be greatly appreciated.
Comments 0
•Answers 0
•Views 37
No comments yet.