Get world position in gsplatPS shader chunk

I’m trying to create a custom shader effect by overriding the gsplatPS shader chunk.
Is it possible to get the world position of the currently rendered pixel?

I’ve tried setting the shader define VARYING_VPOSITIONW but that doesnt seem to add it.
material.setDefine('VARYING_VPOSITIONW', true);

these defines are only used internally by StandardMaterial, but not ShaderMaterials - here the user owns the generation really.

If you have data you need in vertex shader, you create varying yourself, to output data from vertex shader, and to input to fragment shader.

1 Like