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 / Trouble with shaders

Author
Message
Ron Erickson
Moderator
23
Years of Service
User Offline
Joined: 6th Dec 2002
Location: Pittsburgh, PA, USA
Posted: 24th May 2010 22:44 Edited at: 24th May 2010 22:45
Is anyone else successfully using the commands:
set effect constant vector element and get object effect?

I am trying to use the normalmap.fx shader that comes with DarkShader. It has the light information in an array. It has taken me forever to find the above commands (that were added with DarkShader). Now, I am pretty sure I understand how they are supposed to work but can't get them to do anything. It has NO effect on my model when I change the values.

Here is my DBpro code:


Here is the shader:


The ambient light works. I just can't modify any of the 8 lights that are in the array. The frustrating part is that it works nicely in DarkShader. I wish it exported the light settings in the example code.
Any help is appreciated!

Thanks!
Ron


a.k.a WOLF!
Math89
22
Years of Service
User Offline
Joined: 23rd Jan 2004
Location: UK
Posted: 25th May 2010 00:51
Have you tried changing the technique for using the DBLight# ones?
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 25th May 2010 00:58
Yes, that snippet just uses the first valid technique, i.e. it uses only ambient light since the for loop is not executed.

Well spotted Math89. I should have seen that.
Ron Erickson
Moderator
23
Years of Service
User Offline
Joined: 6th Dec 2002
Location: Pittsburgh, PA, USA
Posted: 25th May 2010 01:27
Haha! Well, that is probably what the problem is. Now, how do you change the technique? Sorry, I'm new to the realm of shaders.


a.k.a WOLF!
Math89
22
Years of Service
User Offline
Joined: 23rd Jan 2004
Location: UK
Posted: 25th May 2010 01:34
For this shader, if you want 6 lights, put: Set Effect Technique 1,"DBLight6"
Ron Erickson
Moderator
23
Years of Service
User Offline
Joined: 6th Dec 2002
Location: Pittsburgh, PA, USA
Posted: 25th May 2010 04:20
Awesome! It's working now. That was driving me crazy!

Thanks guys


a.k.a WOLF!
lehua768
16
Years of Service
User Offline
Joined: 24th May 2010
Location:
Posted: 25th May 2010 05:42
Well, that is probably what the problem is. Now, how do you change the technique? Sorry, I'm new to the realm of shaders.

Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 25th May 2010 17:13 Edited at: 25th May 2010 17:14
lehua768

Did you forget (a) to use the quote tags and (b) your message?

Or are you some kind of spam?
KISTech
18
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 25th May 2010 18:41
Not very polite to call someone processed meat.

Though I had a girlfriend once that treated me that way.

Ron Erickson
Moderator
23
Years of Service
User Offline
Joined: 6th Dec 2002
Location: Pittsburgh, PA, USA
Posted: 25th May 2010 19:01
Spam.
Banned.



a.k.a WOLF!

Login to post a reply

Server time is: 2026-07-25 08:28:49
Your offset time is: 2026-07-25 08:28:49