t00fri wrote:Incidentally, I did some benchmarks with your patch/VESTA shaders and found that with my older graphics cards at least (GeForce 7950 GT, ..., shader model 3.0), it slows down the fps quite dramatically compared e.g. to the "scaled disk" star style. Did you also notice this?
I haven't benchmarked the star shaders since I generated the results earlier in this thread. Some slowdown is to be expected based on increased pixel shader load. This will be most evident when:
- The limiting magnitude is set very high, resulting in stars with large glare haloes
- Running on older graphics cards, which were released at a time when there were few complex pixel shaders, and thus are less balanced for shader computation power
(I created an OpenGL ES version of the star shader for iOS, and it performs very well on my iPhone 4.)
t00fri wrote:I wonder why you used a vertex array scenario instead of VBO based rendering? Also VESTA uses vertex arrays for star rendering only if VBOs are unavailable.
For anyone reading that's unfamiliar with the terminology:
- A vertex array is an area of CPU-accesible memory filled with vertexes
- A VBO (vertex buffer object) is a block of memory filled with vertices that may be placed in either CPU or GPU memory, depending on the usage performance. For optimal performance, you want your vertex data to stay in GPU memory.
I never got around to changing Celestia to use VBOs for star rendering. VESTA renders stars in a very straightforward way: the entire catalog is stored in a single static VBO and dumped to the hardware with a single draw call. There's no attempt to cull stars that aren't visible because they're either outside the view frustum or too faint. This approach actually works very well for few tens of thousands of stars, but it obviously doesn't scale well. By contrast, Celestia uses an octree culling scheme and does a significant amount of processing work for each star while filling a vertex array in system (i.e. not video) memory. It's thus slightly more complicated to get a performance boost from VBOs in Celestia.
The star rendering code in Celestia hasn't fundamentally changed in probably eight years. There are big opportunities to optimize it to take care of the programmable graphics pipeline that is ubiquitous on today's GPUs. However, I'm not sure that it's worth the effort until much larger star catalogs are available. With the standard ~100K catalog, even Celestia's current, relatively inefficient star rendering code gets stars onto the screen very quickly. There are more serious performance problems elsewhere.
t00fri wrote:With the same graphics cards of mine, your Cosmographia rendering is extremely smooth! Probably related to VBO technology? Is there a (hidden) fps display key in CG??
I suspect that Celestia is actually faster. Part of the apparent smoothness of Cosmographia is due to the inertia used when rotating the view with the mouse--something that we really should add to Celestia. (There's some profiling code in UniverseView.cpp that's currently #ifdef'd out; I'll add a keyboard toggle soon.)
--Chris