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 / Help with darkshader light arrays commands

Author
Message
the elder
16
Years of Service
User Offline
Joined: 4th May 2010
Location: earth
Posted: 4th May 2010 15:23 Edited at: 5th May 2010 09:41
Hi everybody
I 'm currently trying to use the "normal mapping" shader that comes along with darshader. in order to update light values, i do use "element=get object effect(obj,-1)"
"set effect constant vector element "lightpos",i,vector"
to pass the values to the shader.
THe code compiles and runs, but the object only takes the ambient light value... I have two questions then:
-Does anybody know how to use these commands successfully
-If we cycle through values 0 and 7 to access the shader's array, how can light(1) be the one in the statement "light position x(i), etc... where it goes from 0 to 7 and not 1 to 8?
please forgive my approximative english and my silly questions, and help me to get out of this maze...
Bonjour chez vous.

Xp,dbpro 7.4, dual core 3000+, nv gtx260.
Shader working fine in darshader, model correctly textured.
here is the code i use to test shaders:

Hic et nunc
the elder
16
Years of Service
User Offline
Joined: 4th May 2010
Location: earth
Posted: 1st Jun 2010 15:22
Ooops

Seems I must go back to school, or get glasses... The command is working fine, till you don't type "DBlight8" instead of "DBLight8".

But my question remains:
If we cycle through values 0 and 7 to access the shader's array, how can light(1) be the one in the statement "light position x(i), etc... where it goes from 0 to 7 and not 1 to 8?

Hic et nunc

Login to post a reply

Server time is: 2026-07-27 20:18:03
Your offset time is: 2026-07-27 20:18:03