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 / flickering shaders - beginners Q (code included)

Author
Message
fallingb
17
Years of Service
User Offline
Joined: 10th Sep 2007
Location: UK
Posted: 11th May 2008 16:55
Hi all,

I am trying to turn on/turn off a shader when the mouse rolls over an object... I've got it running fine, but the shader is FLICKERING when turned on. I'm guessing this is due to the screen updating as the program is checking the mouse cursor state. This is probably a basic programming type question and not actually shader specific, but I just can't see the answer. I've tried setting an on/off flag instead but keep getting the same result...hmmm..

here's what I have so far (you'll see the 'picking' routine near the end of the code but included everything incase you want to run it)....

jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 11th May 2008 18:30
Try dbSetExcludeObjectOn(ObjID) and dbSetExcludeObjectOff(ObjID) instead of simply "Hide Object and Show Object. It completely removes the object from the rendering pipeline. Even if it doesn't help your problem.. its a good practice to keep FPS up!

fallingb
17
Years of Service
User Offline
Joined: 10th Sep 2007
Location: UK
Posted: 11th May 2008 19:41
Jason,

That makes for a nice effect, the whole screen fades up to white! Give it a try.

I still have the flickering problem with my old version. I think I need to check what the last frames pick object state was and if the same then don't do anything (i'm just thinking out loud and that probably doesn't make any sense). At present, the code is adding the bloom every frame (hence the flicker at refresh rate), what I actually want is for the bloom to stay on if the same object has been picked. I thought setting a flag would do this but that flickers the same.
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 11th May 2008 20:06
I haven't toyed with this much myself... but there is a command like FastSync or something... it doesn't render the "frame" but I think it does something to/for the camera. I wonder if that would help you? Like Fast Sync after turning shader on, then normal sync just happens. Dunno. Just an idea to explore...


My thinking is fast sync does something lowlevel.. shaders are lowlevel... Could be a match

Login to post a reply

Server time is: 2024-11-17 13:02:07
Your offset time is: 2024-11-17 13:02:07