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 / Help with correctly displaying transparent objects

Author
Message
ThatOther Person
15
Years of Service
User Offline
Joined: 7th Apr 2009
Location:
Posted: 26th Jun 2009 21:17
Messing around with you enter as the transparency flag if/when when you declare dbSetObjectTransparency can potentially help but it seems to be impossible to consistently get objects with transparent textures to render correctly especially when there are multiple layers of transparent objects overlapping each other on screen. Does anyone have any advise? If it helps I know the exact order in which all of the objects should overlap and it isn't necessary to calculate it and alter it based on the cameras perspective or the shape/position of the object's individual polygons.



IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 27th Jun 2009 00:48
Transparent and ghosted objects are rendered together in reverse distance order, and where distances match, they are rendered in a random order (in 7.3 and prior). That means that sometimes your object can be above other objects, and sometime below them.

You need to make sure that the objects you want rendered on top of everything else are either nearer the camera, or you have disabled the z depth on them (dbDisableObjectZDepth) as the no-z-depth & locked objects are rendered last and will appear over the top of everything.

ThatOther Person
15
Years of Service
User Offline
Joined: 7th Apr 2009
Location:
Posted: 28th Jun 2009 17:23
Is there any way to force it to render objects in a predetermined order rather then calculating the correct order based on distance? I don't want to raise the object enough in comparison to each other for it to be visually noticeable and because of the number of objects the small amount of difference needed between them to insure that they don't end up getting rendered incorrectly adds up to a noticeably distance. Disabling object z-depth works great but their z-depth is still significant when compared to any other objects that have also had it disabled and so if its used for multiple near by objects then there is still the same graphical glitches.

To an extent I don't even really care what order they are rendered in (with a few exceptions it doesn't matter too greatly which objects overlap which ones) my primary concern is just getting it to stop making it occasionally turning segments of objects invisible because that area is partially transparent for the object on top of it.
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 28th Jun 2009 22:43 Edited at: 28th Jun 2009 22:45
Ok, we'll try using a slightly different method.

First, use the dbSetGlobalObjectCreationMode function with a value of 4 - this instructs the GDK to sort by object id internally when it can (ie, lower numbers are rendered first) - at this point, you'll see no difference. Don't bother trying to look this function up in the help file - it's not there

Second, we'll get the objects to render during yet a different phase of the rendering process. You can get the objects to render BEFORE every other phase of rendering by using a transparency mode of 7.

The only thing I'm not totally sure about is that I don't know exactly which type of transparency it uses.

Give it a go and let us know how it turns out.

ThatOther Person
15
Years of Service
User Offline
Joined: 7th Apr 2009
Location:
Posted: 28th Jun 2009 23:38 Edited at: 28th Jun 2009 23:42
using dbSetGlobalObjectCreationMode(4) and changing transparency mode made the semi-transparent segments of the objects turn solid black but using that in combination with deactivating there z-depth (I'm not sure if its relevant but aside from the green objects that I'm talking about the only other object with its z-depth deactivated is the red circle) restored there transparency though they still had the same occasional problems.




Thanks for the suggestion/attempt though. Its a bit more restrictive and things don't look as good rotated and zoomed but I think I'm going to consider just doing the game actually in 2D rather then faking it with flat planes. I'll probable get a bit better performance out of it that way anyways.

Login to post a reply

Server time is: 2024-10-01 05:57:23
Your offset time is: 2024-10-01 05:57:23