minimizing blended billboard popping

to correctly display blended polygons u need to sort them from furtherest to closest (with most blending modes)
the problem i have with this is with the ugly popping that occurs eg
take a particle system consists of 100 polygons clustered in a sphere
now rotate the camera around this particle system
the order the polygons are drawn in is constanly changing, resulting in ugly popping
HOW TO MINIMIZE IT!
A/ more polygons (but smaller), kills fillrate
B/ a better blending method than src_alpha, 1-src_alpha, any ideas?
C/ something else?

ta zed

B/ if can use additive blending, just disable depth test and sorting, and it will be ok. GL_ONE GL_ONE

motion blur just on the particles.

And what about that depth sprite thing ?

  • true with (one one) blending theres no popping + also u dont need to sort in the first place. but it has to be a blending method close to src_alpha 1-src_alpha

  • yeah thatll help, unfortunatly most of the effects which use this material dont want motion blur (smoke/steam). i already motion blur most of the additive blended stuff (fire etc), also enabling motion blur takes about a 25% performance hit (should improve with FBO though), ill give it a try though with minimal motionblur

SeskaPeel - what depth sprite thing?

i tried #A last night it helps (and also looks better, more polygons generally == better 3d realism) unfortunatly it tends to kill framerate when the camera is close to the effect. ill look into better polygon distribution methods, instead of the quasirandom placements/velocities that i use at present (hmmm perhaps i can add a repel force (from its neighbours) to the particles)

on the subject of smoke, has anyone implemented some excellant looking smoke.
mine whilst it looks pretty good, appears more like steam than smoke, ive been playing around with textures/colors/blending methods but cant get a nice looking effect

Originally posted by zed:
* true with (one one) blending theres no popping + also u dont need to sort in the first place. but it has to be a blending method close to src_alpha 1-src_alpha
Maybe try this:

  1. Render color of all billboards to additional render target A with blending set to one-one.

  2. Render depth of all billboards to additional render target B.

  3. Scale color of your render target A by 1/x, where x corresponds with maximal number of billboards one on another. Actually you should test it yourself, x might depend on specific kind of particles.

  4. Blend content of render target A (using depth from render target B to depth-test with main frame’s depth buffer) with your scene. Now blend using src_alpha 1-src_alpha.

It won’t help popping against other scene’s elements, but it helps popping between billboards. The disadvantage is the cost of using additional render targets.

Btw. you might like JavaCoolDude’s fire demos being both currently displayed on main opengl web-page.

[Edit: no need for sorting polys in 1st step]

Originally posted by zed:
ill look into better polygon distribution methods, instead of the quasirandom placements/velocities that i use at present (hmmm perhaps i can add a repel force (from its neighbours) to the particles)
That would be the problem. The billboards must be penetrating each other. Try dividing a volume into small cubes or spheres and non of them penetrate each other, and at the center you put a billboard.
The cubes or spheres should be positioned randomly.

Anybody tried smoke effect using 1 pixel GL_POINTS? It would be possible to apply some physics on the GL_POINTS.

It won’t help popping against other scene’s elements, but it helps popping between billboards. The disadvantage is the cost of using additional render targets.
it sounds quite expensive, ill keep it in mind if my new idea doesnt pan out

Btw. you might like JavaCoolDude’s fire demos being both currently displayed on main opengl web-page
none of the 3/4 apps of his that ive tried have worked, so im a bit wary of downloading it (bandwidth nazi)

Anybody tried smoke effect using 1 pixel GL_POINTS? It would be possible to apply some physics on the GL_POINTS
see the 2d fluid simulations, expand that to and extra dimenion :slight_smile:

i had another idea (dont know why i didnt think of it before) just draw the smoke particles as normal, but use a 3d or 4d noise shader, from a cursory think through i think itll solve all the issues and look better to boot (esp 4d noise)
ta zed

:stuck_out_tongue:

Originally posted by Java Cool Dude:
:confused:
i see your :stuck_out_tongue: and raise u a :
i meant cause of my conection i cant download so much (though i did download this demo(not so large)+ it worked hurrah!)
though btw mickeymouse u cant compare fire+smoke eg fire u dont need to sort (then again additative blending personally aint the best, eg in javacooldudes’s demo check out how when the fire is over the skull it tends to go white)

this is the smoke i had first
http://uk.geocities.com/sloppyturds/nelson/2005_05_11A.jpg
http://uk.geocities.com/sloppyturds/nelson/2005_05_11B.jpg
http://uk.geocities.com/sloppyturds/nelson/2005_05_11C.jpg
http://uk.geocities.com/sloppyturds/nelson/2005_05_11D.jpg
http://uk.geocities.com/sloppyturds/nelson/2005_05_11E.jpg

heres a screenshot of the smoke i want (though i cant see how u can do it without popping)
http://images.ea.com/eagames/official/cc_generals_redesign/screenshots/pc/set2/scrn_3.jpg

btw this is what i have now a bit better but still not as good as that CC screenshot (then again that might look crap in the flesh)
http://uk.geocities.com/sloppyturds/nelson/2005_05_12A.jpg
http://uk.geocities.com/sloppyturds/nelson/2005_05_12B.jpg
http://uk.geocities.com/sloppyturds/nelson/2005_05_12C.jpg

btw tried the noise as well, no go, u need to combine it eg with the above + it absolutly killed the framerate ~1fps

I’m sorry but HOLLY GOD those screens look awesome :eek:
Pardon if I ask this offtopic question but where’d you get the models/textures from?

thanks (its due mainly to the unified lighting, theres no ambient)
i made the models myself and most of the textures from photo (some textures i got from the internet though) but ill replace those after i find some industrial area of which i can take a few photos

just did a test, and rendering all my textured particles with a very low alpha and (srcalpha,one) blending, into a texture, then compositing the texture onto the scene using alpha blending looks pretty good…there’s some banding but it looks very volumetric.

Depth sprites:
“A depth sprite can be defined as a 2D image where each pixel has an associated depth value. A depth sprite can be rendered on the screen like a planar textured polygon, but instead of filling the depth buffer with the z-values from the polygon, it is filled with the corresponding values from the depth sprite.”
http://www.ati.com/developer/samples/DepthExplosion.html
http://developer.nvidia.com/object/cg_effects_explained.html#Depth Sprites (can’t find back the real link on the non Cg demo, but this was the one I thought of first)
http://www.justadventure.com/articles/3D/3DGraphicsTrens.shtm
http://www9.informatik.uni-erlangen.de/Projects/lgf3/Devel/online/annotated.html (look for DepthSprites3D classes)

Better smoke rendering:
http://www.opengl.org/discussion_boards/cgi_directory/ultimatebb.cgi?ubb=get_topic;f=3;t=013067

You could have a look at Mark Harris cloud algorithm, that gives very good looking results, and somehow avoids a bit of the popping problem
http://www.markmark.net/clouds/

Let me know how it ends up performance wise, I haven’t tested depth sprites yet.

SeskaPeel.

Just wanted to pitch in a little something, since one of the screenshots were from C&C Generals.

Have you played through the game, you would have seen one particular intro scene to a mission rendered with the engine displaying their smoke is only “smoke and mirrors”. :slight_smile:

They simply use a bunch of pre-rendered textures (very likely hand-made, or at least hand-tweaked) with different smoke “puff”/cloud effects, and impostors (I think that’s the name for it). It was very visible in the scene I’m thinking of, where the “camera” was rotating around basically the smoke center in what I believe in the movie industry is now called “bullet time”.

I’d suspect they still use the very same technique since it works so well with almost no extra GPU budget wasted, and just a little server memory used.

Are you saying it is:
1/ pre-rendered from many fixed viewing angles at startup time?
or
2/ using the ‘imposter’ technique of re-rendering the billboard when the actual viewing angle differs dramatically from its value when the imposter was last rendered?

If you’re saying it uses method 2 then I still don’t see how the popping zed describes could be eliminated because they still have to be alpha blended so the same sort has to happen even if its going to be rendered into a texture…

thanks for the info guys thats definitly helpful, i should be able to come up with something sweet looking now
but first im gonna haveta first dig out my old particle system tester program + update it(add shader support etc), allowing me to tweak the parameters ‘inprogram’, testing the particle system ingame is a hassle

edit - now i think about it, i have also the added issue of shadowmapping, ie composing a single 2d texture and drawing that in the scene (with depth info) wont work well
actually, or will it? it might even be better, the only way i suppose is do a test

knackered,

The smoke I saw was just head-on rendered impostors with a bunch of them put in partially overlapping quads (all the time facing the viewer) blended. I’d think those textures and the animations for them were all or mostly manually rendered.

While the smoke was animating in the number of quads, the implementation was non-obvious. Once time was “frozen” and texture animation stopped, but scene rotation kept going, it was obvious. They might as well have outlined the quads. :slight_smile:

Having the smoke animated (fast enough?) I suspect that motion might fool the viewer enough to make even rotating e.g. a column of smoke plausible.

I see no reason a particle system couldn’t be used to render such textures at application startup, but not without some tweaking. If you look at the EA screenshot, the outer parts of the textures look somewhat cartoonish in their “puffyness”. Almost like superheated ash from a volcano erupting (the non lava kind).

I just wanted to point out I used “impostor” to describe the wrong “fake”.

What I referred to was likely nothing more than a number of hand-drawn smoke 2D sprites, animated, and rendered as a cluster of blended billboards.

While the same effect obviously can be accomplished using impostors, I’m almost certain that’s not what C&C Generals uses why my previous attempt at explaining the effect was at best misleading.

Sorry about the confusion.