- Home /
use lower-res meshes for shadows?
Is there any way to have Unity use lower-res meshes for shadowing? We have a lot of objects and terrain in our game, and even just a single shadowing directional light causes a lot of slow down. I figured, reducing the number triangles the shadow pass needs to draw may help. Is this possible, or is it not really gonna help that much? Would we be better off just trying to reduce shadow-draw calls instead (ie. limit how many objects have castShadow on)?
That is a very interesting idea! Essentially what you want is to have a custom shader that is opaque to the light source but transparent to the user, it sounds like. It would be extra awesome if you could use a computationally simpler shader for the shadow pass - e.g. a vertex-lit shader w/ no texture.
I poked around the docs for a bit and there isn't a straightforward answer. There's a post on the forums that discusses adding a shadow pass to shaders that's worth reading: http://forum.unity3d.com/threads/108612-Adding-shadows-to-custom-shader-%28vert-frag%29
The question is how to treat the shader as opaque for shadow calculation and invisible to the user.
On a side note, there is a WikiBooks tutorial on physically creating a shadow on a plane through matrix manipulation. $$anonymous$$ay be helpful, but probably not.
Your answer
Follow this Question
Related Questions
Lightmap + Directional Light = Draw call problem 0 Answers
Reduce Draw call for Multiple GUI Textures with same Texture 1 Answer
Batching projector shadows 2 Answers
Mass object instantiation issue. 2 Answers
Dynamic Batching, Combine Meshes? 1 Answer