Shadows and Culling masks!!!

Hello people, today i started to question myself in how some 3dshooters use character dynamic shadows on the environment.

My current project is a multiplayer 3dshooter.
This is how it works, my character instance checks with networkView.isMine if the new instance is ours or from another dude, then it assigns different layers to weapons, character mesh, so i cant see my own player’s mesh and be able to see my weapon in a high definition model… and on the other side, we CAN see the other players models and CANT see their high dif weapon. So far i though it was all good.

Well, today it popped to my head “How are you gonna display shadows of your character if you ARENT rendering it with your camera??!!” u___u

Advice, hugs, other ways of attacking to problem, anything will help. Thanks in advance guys!!

Well you can put the player character’s model on a separate layer and then use a Camera / projector type shadow on it.

Have you tried experimenting with what the builtin shadows do with objects that aren’t rendered due to culling masks?

forestjohnson, thanks for your advice.

I was aiming for dynamic shadows (it gives a really good sense of how your character is), but the camera/projector shadow can do the job, and it doesnt use as much resources as rendering the whole mesh, and rerenders caused by the lights, and of course the shadow itself. Ill stick to a circular gradient as my own shadow. the rest of the players will get their dynamic shadows.

Thanks again.

If you have different layers:

  1. all the other players (which are rendered by the camera, and cast shadows)
  2. the main player (which is not rendered by the camera, but casts shadows)

That would accomplish what you want I think. The main light’s culling mask can make different objects cast or not cast shadows, I believe.