Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / GG shader problem, please help!

Author
Message
Broken_Code
15
Years of Service
User Offline
Joined: 20th Aug 2010
Location: Bremen, Germany
Posted: 30th Jan 2013 15:56
I've been working on putting GG's shadow mapping and Evo's normal mapping shaders together (based mainly on GG's with evo's normal mapping bit) and I've got it working! Well, almost. I'm trying to add a third light to the shader:



DBP:


This shader fails, but if you remove or comment out the line:
light += lightColour3 * diffuse3 * shadow3;
from the shader file then it works fine with two lights. This is very confusing, no matter what I do I can't get it to output anything when the third light is included!

Can anyone help?

Thanks,
Broken_Code
15
Years of Service
User Offline
Joined: 20th Aug 2010
Location: Bremen, Germany
Posted: 30th Jan 2013 17:18
I've narrowed it down to the 'In.lightView3' variable in PSScene1 but I have no idea what the problem with this var could be?
Broken_Code
15
Years of Service
User Offline
Joined: 20th Aug 2010
Location: Bremen, Germany
Posted: 30th Jan 2013 17:53
The problem only occurs in these lines:

float attenuation3 = saturate(1.0 - length(In.lightView3) * lightPosition3.w);

float diffuse3 = saturate(dot(normalize(-In.lightView3), normalize(In.normal))) * attenuation3;

but not in the one above:
float shadow3 = texCUBE(cubeSample3, In.lightView3).r < length(In.depth3) - defeatZFighting ? 0.0 : 1.0;

What's going on?!!

Login to post a reply

Server time is: 2026-07-07 00:32:30
Your offset time is: 2026-07-07 00:32:30