Advertisement

Particle troubles

Started by March 24, 2003 01:21 PM
14 comments, last by yodaman 21 years, 11 months ago
I was going to comment this in my first post, but just forgot Anyway, Im going nuts trying to get my particle engine to render right without disabling depth testing... When the depth testing is off, you can see the particles thru walls, and it looks just plain stupid! How do you do this? Thanx... ~yodaman
www.jinx.com www.thebroken.org www.suprnova.org www.mozilla.org
how does it look wiyh depth testing on
Advertisement
I had the same problem with my particles in my demo. I got around it by rendering all of my objects after the PS in order to obscure it except for one object which the OS was inside which i rendered after the PS. That worked but it is basically a cheap fix cause in a scene with lots of models and PS''s I know it would mess up again.

One thought i did have was to render a single quad over the entire area of the PS (with colour buffer writes off) after i render the PS in order to set the depth buffer up correctly. I haven''t got around to trying this yet though but it should work.
To answer the 1st post...
The particles dont blend right.
to further on the second...
Ok, if you render the particles before the rest of the world,
then it wont blend right. If you disable depth testing you can see it thru the whole world, if you enable it, the particles wont blend correctly. Hey, what about gl alhpa testing?

[edited by - yodaman on March 24, 2003 2:43:43 PM]

[edited by - yodaman on March 24, 2003 2:44:11 PM]
www.jinx.com www.thebroken.org www.suprnova.org www.mozilla.org
so by not blending properly do you mean there not transparent
Why not just use glDepthMask(), to disable WRITING to the depth buffer, but still have GL_DEPTH_TEST enabled... Does that work?
Advertisement
because most of the guys out there don t even know this function

damn read the red book
http://www.8ung.at/basiror/theironcross.html
//render world

glDepthMask(GL_FALSE);

//render particles

glDepthMask(GL_TRUE);

M

--------------------------------------------------"I have never let my schooling interfere with my education. " --- M.TwainMarcus Hayswww.phrenicgames.com
WOW!!! glDepthMask was Exactly what i needed!!! Guess i need to read the RedBook some more

thanx alot!
www.jinx.com www.thebroken.org www.suprnova.org www.mozilla.org
Comprehension from the Red Book after you''ve just read it is nearly impossible. It tells you every little detail and technicality you must know, but can''t simply remember automatically. This is why it''s a good reference book. So please don''t read it like a King novel, just refer to it before you come here to babble nonsensically about this CARP!!!
Keep coming back, because it's worth it, if you work it, so work it, you're worth it!

This topic is closed to new replies.

Advertisement