- Home /
Can you get how much light is on the surface in a shader?
I want to make transparent the parts of the texture that doesn't have any light. I figure if I can get the lights intensity (or presence) I can just multiply that by the alpha.
I've been looking for hours on the internet but I can't find anything.
Take a look at this post, I have also seen another similar post that also ended in a solution which worked but at a speed that was not viable for use in a game(it was a scientific simulation for heat due to sunlight on a comets surface), he moved a camera to look at each face of the mesh and get the current pixel color on that face(one at a time), then used the pixel color to deter$$anonymous$$e the light intensity on each face.
http://answers.unity3d.com/questions/24662/detect-lightshadow-falling-on-object.html
Thanks for the info. I didn't seem to find anything on that post that was exactly what I wanted. I need to detect it in the shader because there's not a way, well an easy way, to hide pixels of a texture from C# script, that I know of at least.