|
2 registered members (AndrewAMD, Lapsa),
1,268
guests, and 1
spider. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: Projective Texture Mapping - Spotlight Flashl
[Re: Scorpion]
#181163
02/20/08 04:00
02/20/08 04:00
|
Joined: Jun 2005
Posts: 656
Grafton
OP
User
|
OP
User
Joined: Jun 2005
Posts: 656
|
Quote:
what would be a good addition for realistic purpose:
get the dot product of the model normal and the normal from vertex to cam position and then use it with the "alpha" of the projection. So that only faces facing the light get lighted.
The shaders provided already do this. Only forward (light source) facing polygons are lit.
Adding more dynamic lights is simple, but many lights will require more than one pass which would slow the shaders down. Plus, if you wanted all lights to cast shadows, you will need a very high end graphics card. The game I created the flashlight shaders for features a shader that also supports a dynamic light that casts shadows (a "horror house" dynamic strobe light). I used light mapping for all else. You could create a shader which supports 2 projections without shadows and 3 lights with shadows or whatever you wish. There are numerous combinations you can create. Hopefully the examples should get you started.
|
|
|
|
|
|