- Home /
Help to do translucency + subsurface scattering
Hi,
I need make a shader with this behaviour
no blocking
blocking with light color
blocking with darkcolor
In that images, the light source is behind the "wall" and have a torus between the wall and the light source
I know that shader in the images have subsurface scattering, and this isn't a problem for while. The main problem is, how I can do the real translucent effect ( the shadow effect when some object block the light) using Unity shaders? Its possible?
I'm trying do it using a custom shader with differents transparency type + subsurface scattering, but the final result is so bad. I also tried using this approach link text but the result had a strange behaviour.
Answer by ScroodgeM · Aug 06, 2012 at 10:03 PM
one of the possible way that can be realized in real-time:
render a depth-texture from point of light to draw all objects that hides wall from light. here we got a map of actual hard shadow on wall side turned front to light.
apply some blur effect on this texture
put this texture as self-illumination with color of material on the back side
not a cheap method, but should give you what you want...
thaks for this idea, but I never used depth-texture. Do you have some tips/tutorial to I learn how to use it?
you need just a simple camera (orthographical for direction light, perspective for spot/point), and render it's image not to screen but to render texture. this texture should be depth:
http://docs.unity3d.com/Documentation/ScriptReference/RenderTextureFormat.Depth.html
Your answer
![](https://koobas.hobune.stream/wayback/20220613075252im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Adding transparency to a 2 texture blending shader...noobie. 1 Answer
Translucent/transparencty shader 1 Answer
How to force the compilation of a shader in Unity? 5 Answers
Simple water looking terrain? 2 Answers
Character from transparent to opaque 2 Answers