> If I understand correctly, you have only one model of the cloud, which > has a bunch of sprites and a few tracer polygons. I don't know if this > is practical in the current system, but I'm saying that it would be > better to draw only the tracers in the tracer pass and the sprites in > the real pass as you do know which is which in advance. I do > appreciate the clipping trick in the vertex shader :)
I think it's two models - one containing the actual cloud sprites and one containing the tracer. Both run via both shaders, but the first pass only does real work for the tracers and discards real clouds, the second pass does work for real clouds but discards tracers. In principle it would be (marginally) better to do one pass for clouds and tracers each, since as you say we know up front which is which. In practice tracers need to inherit the movement of the clouds, so it doesn't do to just put models in, they need to inherit the visibility range, and I guess all this would require changes on the C++ level, duplicating or generalizing part of Stuart's cloud generating system. The expected performance gain is marginal - I can't even measure the difference between adding tracers without z-buffer write and not adding tracers. So I think for testing purposes it's okay to go with the scheme, it's not where the performance is burnt. > They don't write the Z buffer at all, do they? No, but what I mean is: I see that the first cloud pass for the tracers writes the z-buffer, because if I insert the tracers at the wrong altitude, they punch neat square holes into my real layer where the z-buffer says not to do the real cloud. This works in spite of the fact that the second pass uses alpha testing, as do all cloud effects currently declared. The tracers just don't do this for the terrain. But the second terrain pass as such is fine with the z-buffer. I have introduced a first pass for trees in render bin -1, and if I don't do the second tree pass I get neat tree-shaped holes punched into my terrain mesh and the expected performance bonus for not doing a lot of terrain pixels. So I know clouds write a z-buffer, and I know terrain reads a z-buffer - they just don't seem to use the same z-buffer. In which case the whole scheme doesn't work as advertized. Does that make any sense? Is there anything special about clouds? * Thorsten ------------------------------------------------------------------------------ Everyone hates slow websites. So do we. Make your web apps faster with AppDynamics Download AppDynamics Lite for free today: http://p.sf.net/sfu/appdyn_sfd2d_oct _______________________________________________ Flightgear-devel mailing list Flightgear-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/flightgear-devel