Setting a colorContribution attribute to a light, to select a only shadow render

Hello community,

On the past weeks I’ve spend some time to port a legacy architecture to a TSL architecture,
I wish I could help more by sending PR’s to the WebGPU renderer / TSL but I’m having hard time to understand how this machinery works

I’ve tried to implement a colorContribution property on lighting it in the current system to setup a light that only produces shadow ( for real time shadow purpose ), but a few things are a mistery to me

https://github.com/mrdoob/three.js/blob/78edc1c96fc22698c7e0a2a36adb1eaa10792770/src/nodes/lighting/DirectionalLightNode.js#L38

In this function here, on the setup of the directionallightnode for example, bypassing the lightingModel.direct function should logically be the way to not render any color contribution from the lighting like :

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 );
		}
	}

But for some reasons by-passing this block prevent the push of the shadowNode into the updateBeforeNodes map that update the shadow

I’ve been trying to debug the stack longly, but cannot find any clue on how to proceed here, seems like there are some internal systems I’m not aware of

Any help ? @sunag