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 / Is there any solution for this (Z sorting problem)???

Author
Message
Hotline
17
Years of Service
User Offline
Joined: 22nd Aug 2008
Location:
Posted: 10th Nov 2011 19:32
Hi ! So my problem is : >>>Z SORTING<<< . As you know , i'm working on a free particle engine for dbpro called SPARK wrapper.


The new (1.2) version which isn't public yet has lots of improvements + addons + features and it could be a professional particle engine for dbpro !

The new .xml and .spk saver allows you to save particle systems easily and load them back in only one command and use them in you game , not to mention i already have more than 15 game ready systems saved and included in the new 1.2 version as a "gift" including rain , smokes , fire , explosions , magic spells , muzzle flashes , bullet hits

But i ran into a really really annoying problem that i just can't fix !!! Individually rendered DX9 elements (quads ,pointsprites , lines ,etc) ARE NOT VISIBLE BEHIND GHOSTED OBJECTS !.No matter how hard i tried to fix this i just can't find a solution for this , no matter how/which render state i set , the particles "does not exist" for dbpro.
Yeah i know i can disable object zwrite , but thats just not the right solution. Tried "set global object creation" not worked either.

So is there any hope that developers add some "help" for third party plugin developers to the next release ?! Any help or even a tutorial would be great on how to fix this issue

Or any other advice/help are appreciated !
Thanks !

IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 10th Nov 2011 22:04
I'm guessing that your SP UPDATE command carries out the rendering.

You say 'ARE NOT VISIBLE BEHIND GHOSTED OBJECTS' - does that mean that your particles draw over the ghosted objects despite being positioned behind them?

Hotline
17
Years of Service
User Offline
Joined: 22nd Aug 2008
Location:
Posted: 10th Nov 2011 23:04 Edited at: 10th Nov 2011 23:09
Not really , the particles are completely invisible behind ghosted objects.Lets say i have a wall object behind a fence object (ghosted) and a wall behind it.If i position the particles between them the particles are not visible , however , i can see trough the fence and i can see the wall behind it but not the particles... ok i can't explain it well , so i upload a simple example

move the camera behind the fence

EDIT : Just tested the d3dfunc.dll , tried drawing a dx line (D3D_LINE3D) behind the fence , and the line WASN'T visible either

Quel
17
Years of Service
User Offline
Joined: 13th Mar 2009
Location:
Posted: 11th Nov 2011 10:23
Do i remember wrong, or DBC with its earlier methods and DX7 never produced these annoying Z problems like DBPro?

Why can't the computer decide that an object behind an other object... well.. is behind an other object?

-In.Dev.X: A unique heavy story based shoot'em ~35%
-CoreFleet: An underground commander unit based RTS ~15%
-TailsVSEggman: An Sonic themed RTS under development for idea presentation to Sega ~15%
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 11th Nov 2011 14:32
There's nothing wrong with the rendering order that DBPro is carrying out here - it's all down to when the plug-in is rendering, which you can't blame on DBPro itself ... especially because there are solutions to this problem.

The problem is that the ghosted objects are updating the z-buffer, and the particles are using the z-buffer to determine when to be drawn.

This can be fixed in one of two ways:
1. Disable z-write for ghosted objects (as already noted).
2. Carry out rendering of the particles before ghosted objects are rendered.

Obviously, you can do option 1 yourself, but option 2 is the better fix.

I have some documentation on how to insert your own rendering into the render sequence, but it's not with me right now - I'll post it later today from home.

Hotline
17
Years of Service
User Offline
Joined: 22nd Aug 2008
Location:
Posted: 11th Nov 2011 15:31
Quote: "I have some documentation on how to insert your own rendering into the render sequence, but it's not with me right now - I'll post it later today from home."


Now thats exacly what i'm looking for !!!! Thank you very very much IanM !

IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 12th Nov 2011 00:41
I've started a document that I've put off writing for years (literally) - seeing as you needed info on the rendering callbacks, I've added all of the DBPro callbacks to what I had started typing up.

Take a look and see if you get the answer you need from it.

Hotline
17
Years of Service
User Offline
Joined: 22nd Aug 2008
Location:
Posted: 12th Nov 2011 14:00
THANKS !!!!!! In not more than 10 minutes i was able to implement my rendering to dbpro !! And finally the render order is corrected, now SPARK works with fullscreens shaders too !!!! You have no idea how much you just helped me with this document !
God bless you !

IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 12th Nov 2011 22:20

Login to post a reply

Server time is: 2026-07-10 01:59:04
Your offset time is: 2026-07-10 01:59:04