Multiple projective textures with pixel lights?
Multiple projective textures with pixel lights?
How do they do it in, say, Source? I mean, would using projective textures and point lighting in one shader work?
How do I even do multiple projective textures for shadows? Like, do I render every object in one texture for every light? But then how do I combine them? Multi-pass?
How do I even do multiple projective textures for shadows? Like, do I render every object in one texture for every light? But then how do I combine them? Multi-pass?
Re: Multiple projective textures with pixel lights?
You have to evaluate the light direction (from the object) and sample the texture. No, you don't texture the object with that texture.
Probably an advanced technique. Have you tried Phong shading with a shader. It might help if you've used some lighting techniques.
Probably an advanced technique. Have you tried Phong shading with a shader. It might help if you've used some lighting techniques.
Re: Multiple projective textures with pixel lights?
I do use Phong shading. What I want to do is projected shadows like ones in Source Engine. I just wonder how they render shadows from multiple light sources.mongoose7 wrote:You have to evaluate the light direction (from the object) and sample the texture. No, you don't texture the object with that texture.
Probably an advanced technique. Have you tried Phong shading with a shader. It might help if you've used some lighting techniques.
Re: Multiple projective textures with pixel lights?
I know nothing about Source, but there are two ways to create shadows - stencil shadows and shadow maps. Irrlicht implements stencil shadows. Maybe give them a try and see if that is what you are looking for.
Re: Multiple projective textures with pixel lights?
Projective textureing is one of the part to make shadow mapping. The difference is we don't check for depth and just leave the shadow texture projected on geometry.mongoose7 wrote:I know nothing about Source, but there are two ways to create shadows - stencil shadows and shadow maps. Irrlicht implements stencil shadows. Maybe give them a try and see if that is what you are looking for.
As I said the problem is not implementing shadows themselves. It's combining multiple of them and render in one or few passes.
Re: Multiple projective textures with pixel lights?
Well you still need to do it in a shader. When you calculate the vector from the current pixel to the light source, you add the amount of light according to the projective texture. To do it for more than one light you need to enable blending and render the scene once for each light.
But no object will cast a shadow, so the effect will be similar to caustics. Everything will be dappled but nothing will have a shadow.
But no object will cast a shadow, so the effect will be similar to caustics. Everything will be dappled but nothing will have a shadow.
Re: Multiple projective textures with pixel lights?
I think you misunderstand me :V
I use projective textures not for lighting but for shadows: I use a render texture to render shadow textures.
If I render a scene multiple times with blending... wouldn't it really add color or would it redraw everything in the buffer?
I use projective textures not for lighting but for shadows: I use a render texture to render shadow textures.
If I render a scene multiple times with blending... wouldn't it really add color or would it redraw everything in the buffer?
-
christianclavet
- Posts: 1638
- Joined: Mon Apr 30, 2007 3:24 am
- Location: Montreal, CANADA
- Contact:
Re: Multiple projective textures with pixel lights?
This description remind me of the "blob" shadows that they use in Unity to project a circle texture on the ground at the feet of the characters. If the name is correct it's based on the projective texturing technique.
From your last post, you want to create a projective texture from a RTT (perhaps take a shot of the character from the top, and render it black for the RTT texture), then project it on the ground? It that it?
If your RTT is calculated one time the texture will be less realistic, but will gain a lot more speed than shadow maps, since your would only have to project this texture on the ground at each frame instead of rendering the geometry shadow.
I still think the projective texturing would need a shader to be applied to the ground material and a reference point for the projection for the shader (character position). Mongoose7 is right about the "light" aspect of this technique, it's like a projector.
From your last post, you want to create a projective texture from a RTT (perhaps take a shot of the character from the top, and render it black for the RTT texture), then project it on the ground? It that it?
If your RTT is calculated one time the texture will be less realistic, but will gain a lot more speed than shadow maps, since your would only have to project this texture on the ground at each frame instead of rendering the geometry shadow.
I still think the projective texturing would need a shader to be applied to the ground material and a reference point for the projection for the shader (character position). Mongoose7 is right about the "light" aspect of this technique, it's like a projector.
Re: Multiple projective textures with pixel lights?
I already implemented projective texturing. I just want to know how to draw more than one projecive texture :V
-
christianclavet
- Posts: 1638
- Joined: Mon Apr 30, 2007 3:24 am
- Location: Montreal, CANADA
- Contact:
Re: Multiple projective textures with pixel lights?
I think you would need more render passes. 1 pass for each projector (Unless you program your shader to draw more than 1 source).
If you need maximum performance and don't have much sources, you could use multiples shaders.
Shader 1 that handle one source.
Shader 2 that handle 2 sources
Shader 3... etc.
Then you would change the shader when you change the number of projectors on your scene. If you have tons of source, then this could still apply but you would be forced to use render passes. (Ex: 9 sources, would do 3 passes with the shader that handle 3 projectors). But at that point, should be simpler to use 1 projection per pass, I don't think you would gain that much.
If you need maximum performance and don't have much sources, you could use multiples shaders.
Shader 1 that handle one source.
Shader 2 that handle 2 sources
Shader 3... etc.
Then you would change the shader when you change the number of projectors on your scene. If you have tons of source, then this could still apply but you would be forced to use render passes. (Ex: 9 sources, would do 3 passes with the shader that handle 3 projectors). But at that point, should be simpler to use 1 projection per pass, I don't think you would gain that much.
Re: Multiple projective textures with pixel lights?
Okay, thanks.
