- Home /
Question by
NecrosDk · Mar 07, 2017 at 11:27 PM ·
shadercgdepth-bufferfragment
Find out if an object is in front of a target in fragment shader?
So Basically I have this screen spotlight fragment shader that basically just sets a center, and draws a falloff spotlight on the screen, based on pixel distance to the given center. The effect is supposed to look like the light is coming from a character (cheaper point light). Of course this makes it so that objects in front of my character are still "illuminated".
How would I go about detecting if my target object is being covered by another in shader language? Is this even possible with the shader placed on the camera, and being a fragment shader?
Comment