problem using particles

Started by
5 comments, last by _ralph 23 years, 9 months ago
hi I´ve tried to implement some particle effects in my OGL based landscape engine using additive blending. Therefore I have to disable GL_DEPTH_TEST but as a result of this the particles either appear in front of the scenery or totally behind depending on when they are drawn -> whether before the landscape or after. Does anyone know a sollution for that ? thanks in advance ralph
Advertisement
You shouldn''t disable GL_DEPTH_TEST. You should disable depth buffer writes. And then draw the particles after drawing the landscape.

- WitchLord

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game


hi

First of all thanks for your reply but I still can´t get it.
-In order to get additive blending working properly, I have to disable GL_DEPTH_TEST, haven´t I ?
-How can I disable depth buffer writes ?

ralph
I''m not sure what additive blending is... (GL_SOURCE_ALPHA and GL_ONE ??) but what I do is I just render the particles as a triangle strip for each one that is put together like a quad. And than I just make them in 3d... I think it would even be better if you make them in 3d.. yeah..
||--------------------------||Black Hole Productionshttp://bhp.nydus.netResident expert on stuffmax621@barrysworld.com||--------------------------||
glDepthMask(FALSE);
No, you don''t want to disable GL_DEPTH_TEST, because then your particles would be seen through solid polygons in your world, for example walls.

I believe I know why you think you need to disable the test, because otherwise the particles aren''t rendered correctly. Well, you will fix this by disabling Depth buffer writing instead. This way the particles wont be seen through solid polygons but will blend nicely with each other.

I don''t know how to disable the depth buffer writes though. Maybe zedzeek''s way will work. If it doesn''t I could probably find out for you.

- WitchLord

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game


hi

glDepthMask(FALSE) worked.
Thanks for you posts;
It looks pretty cool now

ralph

This topic is closed to new replies.

Advertisement