- Home /
How can I make a dark area/volume of fake shadow?
This is the kind of effect I'm going for. The above was created with a projector but unfortunately projectors cause too many draw calls so I'm trying to find a more optimized approach. I would like to create a controllable volume or area of darkness similar to what a projector does or what a negative/black light would do. I have been searching online and on the asset store but the only solutions I've found were decals or flat planes positioned under the player. These are no good because I need the player (the red ball) to be able to hide within these shadowy areas and so a decal or plane on the ground just doesn't cut it. These areas would not have to be affected by lights, they would be faked shadows which would give much more control than a shadow caster for example since it would not be effected by the light direction.
Any suggestions how could I do this in Unity Free?
Answer by Hoeloe · Feb 09, 2014 at 04:22 PM
In Unity Free, projectors are pretty much your only option. The way this is usually done is with volume rendering or real-time shadows. Since Unity Free does not have access to either of these, the best thing you can do is to use a projector.
If you don't mind restricting your project to DX11, though, you may be able to write your own projector code using Compute Shaders, which might speed up the drawing.
Yeah the problem is that I'm planning to use a few of these to simulate dark areas under individual lights (just light models not actual Unity lights) in a hallway when a specific light is destroyed. I was going to use spot lights and then turn each off but for performance reasons I decided against using so many lights. Now it seems I've got the same draw call issue with creating the shadows.
Would it be possible to do this with a surface or frag shader, by for example changing the albedo or emissivity so that it would reflect darkness ins$$anonymous$$d of light? Then one could apply the shader to a sphere or capsule to create the dark "volume" effect. I've tried playing around with shaders for this for a while, before trying the projector, but I couldn't get it to work that way either.
I'm sceptical of that. Volume rendering usually requires 3D textures, which aren't supported by Unity Free.
Your answer
Follow this Question
Related Questions
Blob shadow changes transparency 2 Answers
Do blob shadow projectors work on iPhone? 1 Answer
projector causing flicker 1 Answer