Problem with shadows!

Hi guys!



Using shadow requires graphic card to process more performance. So, I want to make my shadow that almost not affect my game performance!



Anyone have any idea, just tell me!

I just know you can lock shadows for static models.

You can bake your shadows into lightmap textures.

renanse said:

You can bake your shadows into lightmap textures.


Give me some codes to learn clearly. Thanks!

This is not code, you do it in a program like Blender.  Basically, you setup the lighting in your modeling tool and it will bake the shadows into a texture that you can use on your model in your game and it will look like there are shadows.

In a certain limited number of cases you could use projected texture. I thinkg it would be cheaper than shadow render pass. If you have a car for example, you could use projected texture to model the shadow underneath it. Never done it, but I think it might work.

One problem with using projected textures for modelling shadows would be that the texture would be applied to the back faces of the obejcts or areas that are behind the object. Here’s what I mean, say if you have a flash light:







I don’t know if this can be avoided easily or not… for me it is absolutely impossible, but for someone who knows what he is doing might be simple…

renanse said:

This is not code, you do it in a program like Blender.  Basically, you setup the lighting in your modeling tool and it will bake the shadows into a texture that you can use on your model in your game and it will look like there are shadows.


You mean I use modeling tool like 3D Max to make shadows?

someone is working on a ShadowMap pass, maybe this is faster than the stencil shadow used in the jme ShadowPass.

http://www.jmonkeyengine.com/jmeforum/index.php?topic=7917.0