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 / Transparency 2 blocked by shader

Author
Message
TheComet
18
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 20th Apr 2012 00:20 Edited at: 20th Apr 2012 00:23
Hey everyone!

So I just noticed that every object which uses the command set object transparency <obj>,2 is no longer visible when behind an object with the heat haze shader applied. Here's a screenshot showing what I mean. You'll see that there are supposed to be four teleporters in the centre, but you only see one of them (top right corner). The rest are not rendered because they are under the force field. How can I fix this?

Screen shot : http://forum.thegamecreators.com/xt/xt_apollo_pic.php?i=2339189

Shader file:



TheComet

Andrew_Neale
16
Years of Service
User Offline
Joined: 3rd Nov 2009
Location: The Normandy SR-2
Posted: 20th Apr 2012 09:56
Without seeing the code that implements the shader it is hard to say, but, as the shader appears to work with a screen rendered to an image, the thing that springs to mind would be that those objects are not being rendered to that sampled image. Maybe to do with a sync mask or something? It certainly looks like its the camera being set to an image that is causing the issue from what I have to go on here.


Previously TEH_CODERER.
mr Handy
18
Years of Service
User Offline
Joined: 7th Sep 2007
Location: out of TGC
Posted: 20th Apr 2012 16:54 Edited at: 20th Apr 2012 16:55
@TheComet
off topic: just saw minimap on your screen... how did you optimized such quantity of objects?!
TheComet
18
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 21st Apr 2012 04:00
Quote: "Without seeing the code that implements the shader it is hard to say, but, as the shader appears to work with a screen rendered to an image, the thing that springs to mind would be that those objects are not being rendered to that sampled image. Maybe to do with a sync mask or something? It certainly looks like its the camera being set to an image that is causing the issue from what I have to go on here."


Good point. I double checked and can confirm that they are being rendered to the image when using set object transparency <obj>,0, but they aren't rendered when using set object transparency <obj>,2. I'm not using masks or anything... I'll throw together a simplified example as soon as possible so you can see exactly what I'm doing.

Quote: "@TheComet
off topic: just saw minimap on your screen... how did you optimized such quantity of objects?!"


Years of eating Kit Kat Chunkies my friend...

No the real reason is quite simple: How many objects do you see on the screen at any point in time? DBP handles off-screen objects with good care, so I didn't even see the need to program some kind of show/hide system for the grid.

Also, to anyone who's interested, I actually tried that "add all objects as limbs to a central object" trick, and the frame rate dropped to 30 fps! I undid that again so each tile was it's separate object, and the fps went back up to a constant 60.

Limbs are only more efficient when you want the entire object to be on screen.

TheComet

Login to post a reply

Server time is: 2026-07-09 00:08:07
Your offset time is: 2026-07-09 00:08:07