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.

Dark GDK / How to turn off an object effect?

Author
Message
Fallout
22
Years of Service
User Offline
Joined: 1st Sep 2002
Location: Basingstoke, England
Posted: 18th Apr 2012 13:18 Edited at: 18th Apr 2012 13:18
I'm using a simple shader to colour an object when it's selected (green for selected, red for invalid). When the object is deselected, I want to turn the shading off. However, there doesn't seem to be a command that actually does this.

dbSetShadingOff() doesn't exist in GDK
dbSetPixelShaderOff() etc. don't work with effect commands.

One solution that works is to simply dbSetObjectEffect() to effect 0. Since that effect doesn't exist, the object returns to normal. The problem this causes is, when I save the object and reload it, it is invisible and can't be brought back to life. So I need a way of clearing the shading data from the object, so it's normal once more.

I've been using dbGetObject() to browse object properties, and there is some access to meshes and effect names. Perhaps this is a solution? Anyone know?

Brendy boy
19
Years of Service
User Offline
Joined: 17th Jul 2005
Location: Croatia
Posted: 18th Apr 2012 23:33
Quote: "Anyone know?"

just retexture the object, i think that texturing resets shaders

WickedX
15
Years of Service
User Offline
Joined: 8th Feb 2009
Location: A Mile High
Posted: 19th Apr 2012 00:49 Edited at: 19th Apr 2012 00:54
The SetShadingOff() function is in the GDK libraries source code. Try using a forward declaration.

Login to post a reply

Server time is: 2024-11-19 02:33:41
Your offset time is: 2024-11-19 02:33:41