Java-Gaming.org Java4K winners: [ by our judges | by the community ]         
Featured games (67)
games approved by the League of Dukes
Games in Showcase (∞)
games submitted by our members



News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  Print  
  3D smoke artifacts (fixed)  (Read 1054 times)
0 Members and 2 Guests are viewing this topic.
Offline Skippy

Full Member
**

Posts: 119


Java games rock!


« on: 2004-02-29 07:09:41 »

Hey OpenGL gurus!

I'm a OpenGL-n00b and have a little problem with 3D-smoke. I have billboards with 32bit textures, all z-sorted ofcourse. Now the problem seems to be that when the billboards are very near to each-other, the blending gets messed up.

The following screenshot illustrates the problem:



I've done some drawing on it so explain what's happening.

I've played a lot of FPS-games, that use 3D-smoke where these artifacts are not occuring, so it is probably my fault Smiley
Offline elias

JGO Ninja
***

Posts: 638



« Reply #1 on: 2004-02-29 08:42:39 »

If you have enabled the z buffer (seems like you have, since you sort the smoke plates), the problem is probably a classical z-fighting issue. Try moving the near clipping plane away from the camera or the far plane closer, and see if it helps. What are they at now?

- elias

Offline Skippy

Full Member
**

Posts: 119


Java games rock!


« Reply #2 on: 2004-02-29 14:29:46 »

Ah, that makes me think about the z-buffer... (doh) it has a presicion of only 24 bits... (ATi-card)

Settings were: near 0.001F / far 8192.0F

Narrowing them solved it! Thx!
Games published by our own members! Go get 'em!
Offline Orangy Tang

JGO Kernel
*****

Posts: 2959
Medals: 37


Monkey for a head


« Reply #3 on: 2004-02-29 16:43:05 »

1. If you've already z-sorted your particles, then a z-buffer is unnessisary. Turn it off to avoid z-fighting.

2. 24-bit z-buffer is more than enough for most apps. Remember that a z-buffer is non-linear and that most acuracy is near the camera, therefore increasing the near plane has a dramatic effect (likewise, the far plane distance has a minimal distance). A near of 0.001f is overkill for practically every game. Push it as far out as possible.

[ TriangularPixels.com - Play Growth Spurt, Rescue Squad and Snowman Village ] [ Rebirth - game resource library ]
Offline Skippy

Full Member
**

Posts: 119


Java games rock!


« Reply #4 on: 2004-03-01 00:38:01 »

Quote
1. If you've already z-sorted your particles, then a z-buffer is unnessisary. Turn it off to avoid z-fighting.


Hm, interesting. You see I'm a n00b here. Now I enable it for the terrain and disable it for the smoke. For this kind of smoke it turns out it doesn't matter at all whether I z-sort them or not (who cares which grey cloud is rendered first if they are all the same color and blended). For other kinds of particle-engines or 3d-blended objects the z-sorting is important so I guess I'll keep it anyway. The z-sorting isn't a real performance hit, but disabling the depth-buffer increased performance by 33% when the smoke fills the whole screen. (150fps -> 200fps)

Thanks again for all help. I guess I have to read that Redbook someday before doing anything serious in OpenGL.
Pages: [1]
  Print  
 
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!
Page created in 0.095 seconds with 20 queries.