- Home /
Question by
DenizCetinalp · Mar 03, 2016 at 06:49 PM ·
shadercgsurface shaderfragmentztest
Shader that renders fragment behind
How can I create a shader that renders the fragment behind the current fragment being rendered? It also needs to support lighting and shadows.
For example, for the plane I overlayed, I want its texture to be the texture of the sphere behind it but I still need the plane to receive shadows and light.
I cant figure it out. Im guessing I need two passes, the first one to render the object behind by setting the ZTest to Greater, and the second one to render the shadows and lighting.
Any ideas?
untitled-1.png
(513.2 kB)
Comment