|
Problem with the diffuse lighting shader
#145324
08/02/07 19:10
08/02/07 19:10
|
Joined: Mar 2006
Posts: 24
Atsu
OP
Newbie
|
OP
Newbie
Joined: Mar 2006
Posts: 24
|
I'm trying to get the diffuse lighting shader from the introduction to shader programming by Taco Cohen to work as I want, but can't quite seem to get it. Problem is that the dynamic light seems to light the whole scene, but I would like it to be blocked by the models. In the demo level provided it seems to work fine with the sun, but I would like to use lights for this. How is this done? This is what I mean (ball acts as a dynamic light, but the whole box is lighted. I'd like the back to be shadowed as the real shadows fall): http://koti.mbnet.fi/ttb/gamestu.jpgDoes the light act as a sun and light still come from above, even if the light object is placed on to the ground level in WED? Or what's going on?
|
|
|
Re: Problem with the diffuse lighting shader
[Re: Scorpion]
#145326
08/03/07 10:54
08/03/07 10:54
|
Joined: Mar 2006
Posts: 2,758 Antwerp,Belgium
frazzle
Expert
|
Expert
Joined: Mar 2006
Posts: 2,758
Antwerp,Belgium
|
You can use dynamic lights together with a diffuse shader since the normal map shader from Guitar and co. did it so maybe try to infer it from their code Cheers Frazzle
Antec® Case Intel® X58 Chipset Intel® i7 975 Quad Core 8 GB RAM DDR3 SSD OCZ®-VERTEX2 3.5 x4 ; HD 600 GB NVIDIA® GeForce GTX 295 Memory 1795GB
|
|
|
Re: Problem with the diffuse lighting shader
[Re: frazzle]
#145327
08/03/07 11:11
08/03/07 11:11
|
Joined: Mar 2006
Posts: 24
Atsu
OP
Newbie
|
OP
Newbie
Joined: Mar 2006
Posts: 24
|
Quote:
You can use dynamic lights together with a diffuse shader since the normal map shader from Guitar and co. did it so maybe try to infer it from their code
Yeah, already tried that but don't actually know where to start. Maybe I should just try to learn this stuff rather than experimenting till I go crazy
Still, I won't probably need this anyway, as I'll most likely bake the shadows and it's gonna have to do.
|
|
|
Re: Problem with the diffuse lighting shader
[Re: Atsu]
#145328
08/03/07 11:42
08/03/07 11:42
|
Joined: Mar 2006
Posts: 2,758 Antwerp,Belgium
frazzle
Expert
|
Expert
Joined: Mar 2006
Posts: 2,758
Antwerp,Belgium
|
Oke, but remember that when baking shadows you can expect a lower quality and pixelized/blurred edges Cheers Frazzle
Antec® Case Intel® X58 Chipset Intel® i7 975 Quad Core 8 GB RAM DDR3 SSD OCZ®-VERTEX2 3.5 x4 ; HD 600 GB NVIDIA® GeForce GTX 295 Memory 1795GB
|
|
|
Re: Problem with the diffuse lighting shader
[Re: frazzle]
#145329
08/03/07 17:33
08/03/07 17:33
|
Joined: Mar 2006
Posts: 2,503 SC, United States
xXxGuitar511
Expert
|
Expert
Joined: Mar 2006
Posts: 2,503
SC, United States
|
well, if your into shaders, I can give you a little example on how to add simple lighting...
xXxGuitar511 - Programmer
|
|
|
Re: Problem with the diffuse lighting shader
[Re: xXxGuitar511]
#145330
08/06/07 23:19
08/06/07 23:19
|
Joined: Mar 2006
Posts: 24
Atsu
OP
Newbie
|
OP
Newbie
Joined: Mar 2006
Posts: 24
|
Quote:
well, if your into shaders, I can give you a little example on how to add simple lighting...
Yeah, that would be great.
|
|
|
Re: Problem with the diffuse lighting shader
[Re: Atsu]
#145331
08/07/07 05:55
08/07/07 05:55
|
Joined: Mar 2006
Posts: 2,503 SC, United States
xXxGuitar511
Expert
|
Expert
Joined: Mar 2006
Posts: 2,503
SC, United States
|
I've been very busy lately, if I find time, I'll drop a short example...
In the mean time, try to get a basic understanding of shader structure...
xXxGuitar511 - Programmer
|
|
|
|