I'm currently about half way through porting Q3A's sky clouds to DirectQ. This will be as an option rather than replacing the classic sky clouds, and can be useful for certain maps as it distorts at the bottom rather than at the sides (especially if no skybox is provided, or if you don't want to use one).
I've said before how similar DirectQ's renderer is to Q3A, but this has been quite a revelation - the code was almost a straight copy and paste, with perhaps the biggest difference being that Q3A uses tess.xyz[tess.numVertexes] whereas I use verts[numverts].xyz (which works better with D3D Vertex Buffers).
No screenshots yet because it's still unfinished, but as soon as I have something I'll post it. I'll also update with details of how to select it as an option, but it's pretty much a foregone conclusion that it will be r_skywarp 2.
Update.
OK, here it is.
Now for the bad news. There are still ripples. Nowhere near as bad a GLQuake thankfully, but there nonetheless. These most likely come from a number of operations in the texcoord generation function that produce a curve, and therefore are not amenable to linear interpolation during rendering (the exact same problem as the classic sky and water, in other words). I've solved this for classic sky and water by moving these operations to a pixel shader, and could likely do the same with this at some stage.
These ripples are also present in Q3A by the way, if you go looking for them (it just hides them better by using alpha layers).
It's slow. Not as slow as it could be, but a whole lot slower than the HLSL classic sky warp. Increasing the detail level (another option to solve the ripples) could only make it slower, and turns out to be total geometry overkill. Q3A uses 8 subdivisions which is reasonable enough; increasing this to 32 almost eliminates ripples but brings the vertex count to over 5000 and the index count to over 30,000. That's 10,000 triangles just to render the sky - nope, not gonna happen.
The texture scale is poor; textures render too large towards the top and too small towards the bottom edges. In fairness you rarely ever see the bottoms, but it could still be a problem in some scenes.
All the same it's a nice option to have, it could help improve certain scenes, and if you set r_skyalpha less than 1 you can almost suspend your disbelief so far as the ripples are concerned.
Not something to be promoted to menu option status in other words, but good enough to leave as a cvar (and yes, it's r_skywarp 2).
Some time I might come back to it and explore the pixel shader option, but for now I've satisfied my own curiosity regarding use of Q3A sky as a viable alternative, so it's a good enough result.
Tuesday, May 4, 2010
Q3A Sky
Posted by
mhquake
at
8:18 PM
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment