Problem with the diffuse lighting shader

Posted By: Atsu

Problem with the diffuse lighting shader - 08/02/07 19:10

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?
Posted By: Scorpion

Re: Problem with the diffuse lighting shader - 08/02/07 22:11

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
Posted By: frazzle

Re: Problem with the diffuse lighting shader - 08/03/07 10:54

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
Posted By: Atsu

Re: Problem with the diffuse lighting shader - 08/03/07 11:11

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.
Posted By: frazzle

Re: Problem with the diffuse lighting shader - 08/03/07 11:42

Oke, but remember that when baking shadows you can expect a lower quality and pixelized/blurred edges

Cheers

Frazzle
Posted By: xXxGuitar511

Re: Problem with the diffuse lighting shader - 08/03/07 17:33

well, if your into shaders, I can give you a little example on how to add simple lighting...
Posted By: Atsu

Re: Problem with the diffuse lighting shader - 08/06/07 23:19

Quote:

well, if your into shaders, I can give you a little example on how to add simple lighting...




Yeah, that would be great.
Posted By: xXxGuitar511

Re: Problem with the diffuse lighting shader - 08/07/07 05:55

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...
© 2024 lite-C Forums