Gamestudio Links
Zorro Links
Newest Posts
Blobsculptor tools and objects download here
by NeoDumont. 03/28/24 03:01
Issue with Multi-Core WFO Training
by aliswee. 03/24/24 20:20
Why Zorro supports up to 72 cores?
by Edgar_Herrera. 03/23/24 21:41
Zorro Trader GPT
by TipmyPip. 03/06/24 09:27
VSCode instead of SED
by 3run. 03/01/24 19:06
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
5 registered members (AndrewAMD, monk12, TipmyPip, Quad, aliswee), 1,029 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
sakolin, rajesh7827, juergen_wue, NITRO_FOREVER, jack0roses
19043 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Problem with the diffuse lighting shader #145324
08/02/07 19:10
08/02/07 19:10
Joined: Mar 2006
Posts: 24
A
Atsu Offline OP
Newbie
Atsu  Offline OP
Newbie
A

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.jpg

Does 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: Atsu] #145325
08/02/07 22:11
08/02/07 22:11
Joined: Jan 2007
Posts: 1,619
Germany
Scorpion Offline
Serious User
Scorpion  Offline
Serious User

Joined: Jan 2007
Posts: 1,619
Germany
the lighting don'T have to do anything with real shadows

in the shader the darkness is just calculated by 2 angles, the one from the sun and the one from the normals, so bigger the diffrence so darker is the pixel that is drawn

the entities don'T affect each other, for such a effect u have to use shadowmapping, but this in in gs only possible with plugins as example sphere

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 Offline
Expert
frazzle  Offline
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
A
Atsu Offline OP
Newbie
Atsu  Offline OP
Newbie
A

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 Offline
Expert
frazzle  Offline
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 Offline
Expert
xXxGuitar511  Offline
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
A
Atsu Offline OP
Newbie
Atsu  Offline OP
Newbie
A

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 Offline
Expert
xXxGuitar511  Offline
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

Moderated by  Blink, Hummel, Superku 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1