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 / Shaders Not "Moving"

Author
Message
GreshKaal
15
Years of Service
User Offline
Joined: 26th Oct 2010
Location:
Posted: 9th Nov 2010 03:18
Hey there. I've been working on setting up shaders in Dark Basic Pro for a couple days now, and so far, I only have managed to get my shaders to appear, but not change to moving light.

I set up a light and a cartoon shader on a sphere, then had the sphere rotate and the light move. Without the shader, it works normally and the light change on the sphere is noticeable. However, when I used the shader, the sphere's shading stuck at the initial position. It rotates and the light moves, but the shading doesn't change. Any advice?

Here's the code.


Thanks for your time, all.
Van B
Moderator
23
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 9th Nov 2010 12:39
Perhaps the shader has it's own lighting, like in the actual shader code there will be a light, stored as a vector, and you would have to adjust this vector in the shader to update the light.

Best to look at some other shader examples to figure it out, lots of shaders have this problem, especially things like bump mapping - some shaders can handle several lights.

Health, Ammo, and bacon and eggs!
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 9th Nov 2010 13:09
I guess the images specified in the cartoon shading command are intended to replace the lighting.
GreshKaal
15
Years of Service
User Offline
Joined: 26th Oct 2010
Location:
Posted: 10th Nov 2010 01:36
Alright. I'll look around at some shader examples and see if I can't find anything out. What's strange to me, though, is that I tried to use the same code from the Basic3D showcase, and it had lights that moved via mouse movement. Anyways, thanks for the help. I appreciate it a lot.

Login to post a reply

Server time is: 2026-07-26 05:03:42
Your offset time is: 2026-07-26 05:03:42