- Home /
The question is answered, right answer was accepted
Alpha Blending for projectors on transparent/cutout materials
Hello,
I am currently attempting to implement a projector used to project Fog of War onto the environment. After doing some custom shaderwork I Have a fully functioning version of the shader for the projector. Except for one visual issue. In the parts of the fog that are explored but not visible aka "grayed out" all models using transparent materials are colored entirely without taking any underlying alpha into account. This causes any of our leafy vegetation to look absolutely terrible with grey polygons showing the actual model instead of a neat cutout.
So my question would be: How can I blend the Alpha seperately to only allow my projector to affect the parts of the underlying material that are opaque. It seems that "Blend SrcFactor DstFactor, SrcFactorA DstFactorA" doesn't actually do anything even though it would be the solution to my problem.
thanks for reading
Update:
I Fixed it by using ZTest Equal to discard any situations where the vegetation hasn't written to the depth buffer.