Wednesday, August 5, 2009

Progress

2D rendering has been completed, and the world render is coming close to completion. One thing I've had to wave goodbye to is my ability to set an arbitrary lightmap scale, as Direct3D modulate scales are restricted to values of 1, 2 or 4 (the same is true of OpenGL's GL_RGB_SCALE with combines; at least D3D is honest about the limitation). The gl_modulate and intensity cvars from Quake II are playing a visit however, by way of compensation.

An alternative way I might tackle this is to set a base diffuse colour of 0.5 and modulate the lightmap with that; D3D's default texturing behaviour is a modulation with 1, so there's no perf loss here, and it will open up greater flexibility (as well as giving better lightmap texture granularity). The base diffuse could then be cvar-ized in order to give back some flexibility.

I'm not certain where 64 bit lightmaps are going to fit into this setup. I did them in QII, but I'm looking for more flexibility with DirectQ so if they become an issue I'll just drop them. They're more of a luxury feature than anything else anyway, and are an addition to the required functionality rather than something the engine must have. However, I will be making every reasonable effort to be able to keep them in.

I'm quite surprised by how clean the 2D render in particular has turned out to be; definitely an indication that I'm on the right track with this. With hindsight, HLSL was an interesting experiment but not really long-term viable. I'm certain that there is a clean way of implementing it; just that I haven't discovered it.

I think I'm going to do alias models next; that should be good fun as I'll need to do them in multiple passes - normal/fullbright/alpha/alpha+fullbright.

0 comments: