Lune Logo

© 2025 Lune Inc.
All rights reserved.

support@lune.dev

Want to use over 200+ MCP servers inside your coding tools like Cursor?

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.

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:

JAVASCRIPT
setup( 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.

0

Comments 0

Answers 0

Views 37

0 Answers

Discussion

No comments yet.