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 / How can i draw transparent objects behind particles?

Author
Message
Adrian
22
Years of Service
User Offline
Joined: 11th Nov 2003
Location: My Living Room
Posted: 31st Mar 2013 17:28
Hi all.
In the game I'm currently writing, I have flying craft that explode in a shower of particles. My problem is that all the background trees (objects which have transparency) are drawn in front of the particles no matter where they're placed.

http://www.youtube.com/watch?v=qWRXkYaaAN0
In this video, the explosion at 0:16 shows the problem well. No matter what I do, I can't seem to get the trees to be behind the particles.

Other objects (ones without transparency) are drawn correctly. Is there an easy way to sort this out? I want objects with transparent areas to be drawn behind the particles.

Is it a render-order problem? or an object problem? (the trees are cloned to allow transparency)

Any thoughts?
Ortu
DBPro Master
18
Years of Service
User Offline
Joined: 21st Nov 2007
Location: Austin, TX
Posted: 31st Mar 2013 17:42
you might try playing around with the transparency mode when setting an object to transpant. there are at least half a dozen modes or so which affect how the transparency is handled

TheComet
18
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 31st Mar 2013 19:08
The problem is the "transparent" parts of the trees are drawn to the backbuffer before you draw the particles. When DBP draws the particles, a depth test takes place on every pixel, hindering the drawing of your particles.

What you can try is to disable your trees writing to the depth buffer with the command disable object zwrite <obj>.

TheComet


Level 91 Forumer - 9600 health, 666'666 keystroke power (*2 coffee)
Abilities: sophisticated troll, rage
Adrian
22
Years of Service
User Offline
Joined: 11th Nov 2003
Location: My Living Room
Posted: 1st Apr 2013 01:01
I'm using modes 2 and 4 at the moment as they look the best. Changing modes didn't help unfortunately.

Disabling zwrite for the trees didn't work either. The particles are still in front of the trees :-(

I've been struggling a bit with particles. I've not used them before and am finding them tricky.

Is there a way to control the order that the object, terrain (BT) and particles are written to the screen?

Thanks for your help so far
TheComet
18
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 1st Apr 2013 04:57
Hmm, it might actually be the other way around. Can you disable zwrite for the particles?

TheComet


Level 91 Forumer - 9600 health, 666'666 keystroke power (*2 coffee)
Abilities: sophisticated troll, rage
Adrian
22
Years of Service
User Offline
Joined: 11th Nov 2003
Location: My Living Room
Posted: 1st Apr 2013 22:34
That sounds exactly what is needed but I can't find a way to do that.
Chris Tate
DBPro Master
17
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 1st Apr 2013 23:40
What particle system are you using? Sparks?

If you stuggle with the particles it might be worth trying Sparks or Dark Dynamix.

TheComet
18
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 1st Apr 2013 23:50
Is there any guarantee that they will render correctly as opposed to the built in particles?

TheComet


Level 91 Forumer - 9600 health, 666'666 keystroke power (*2 coffee)
Abilities: sophisticated troll, rage
Chris Tate
DBPro Master
17
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 2nd Apr 2013 00:27
I have my particles in front of my transparent objects using Sparks; I stopped using the usual particle system in 2009 when they were causing strange crashes so I am not familiar with the in built particles in the latest update.

Adrian
22
Years of Service
User Offline
Joined: 11th Nov 2003
Location: My Living Room
Posted: 3rd Apr 2013 15:14
I have used Sparks in projects before but have been unable to get them working with Blitzwerks Terrain plugin.

The Spark Wrapper is very good, much better than the normal particles, but something in either that plug-in, or BT doesn't get on.

My program immediately crashes with no error message or anything.
That is why I was forced to use the build-in particle system. It's not very good but it does sort of work.

I did manage to get Spark working with matrix landscapes http://www.youtube.com/watch?v=wU9uF3NuOb0
but needed to take the next step.

I started my current game using AT and evolved's water shader, then changed to Blitzwerks half way through and had to re-code because the water wasn't working. I don't really want to start again because I can't get the particles working. I AM getting a bit fed up with DBPro. Nothing seems to work as I imagine it should.
Chris Tate
DBPro Master
17
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 3rd Apr 2013 18:22
Blitz Terrain and Sparks use DBP cameras for rendering on a custom basis; you can change their camera assignments but I have not researched this procedure fully. I will be investigating this in a few weeks time to see if I can get them to run together for my own purposes.

Login to post a reply

Server time is: 2026-07-06 20:52:04
Your offset time is: 2026-07-06 20:52:04