Tuesday, September 15, 2009

Pie in the Sky: Future Rendering Tricks

I've had a few inquiries about environment maps, normal/specular maps in more places than just OBJs, etc. The short answer is: a lot of these future rendering engine enhancements are good ideas that we like, but we have other features that are already partially implemented that we need to productize first.

In particular, one of those half-finished features not only could use to be shipped, but also affects the way just about every other rendering effect works. So better to get these features finished first, and build new effects within the context of these "new rules".

Here are some of the ideas that I've heard kicked around:
  • Environment maps on the plane - I like it, it's not that hard to do, and the framerate hit could be ramped up and down with detail. See above about finishing other features first.
  • Next-gen texturing on runways (wet runways, environment maps, bump mapping) - I like all of it. The runways really need to be addressed comprehensively, not piece-wise, in order to find a rendering configuration that meets our scalability and efficiency needs. (In other words, we can't just burn tons of VRAM on the runways, and we need a way to render them that works on low and high end computers with one set of art assets.)
  • Normal mapping on the ground. I like it, but I wonder if this isn't part of a bigger idea: procedural texturing on the ground. E.g. if we want to add detail on the ground, can we add it with multiple layers at different resolutions with a shader adding yet more detail.
Generally speaking, it's not that hard to push a feature out from one part of the rendering engine to the other. For example, normal maps on facades (if anyone cares :-) would make sense and be a fairly trivial change. I hesitate on polygons only because the ground might require something a little bit more sophisticated.

Going Crazy With Choices

Here's a straw man of why polygons might be different: draped polygons can't have specular shininess right now, and I don't think anyone is complaining. So it's a bit of a waste to use the alpha channel of a normal map for shininess. Perhaps it could be used for something else like an environment mapping parameter.

Hrm...but we would like to have environment mapping on airplane objects too someday. Well, we could go two ways with that. We could just use the alpha channel for shininess and environment mapping...not totally unreasonable but it wouldn't let us have a glossy non-reflective material, e.g. aluminum vs. shiny white paint.

Math nerds will realize that the blue channel in normal maps can be "reconstituted" from the red and green channels by the GPU (at the cost of a tiny bit of GPU power). That would give us two channels to have fun with - blue and alpha. Perhaps one could be shininess and one could be an environment mapping material.

Well, shininess is still no good on the ground. But...perhaps that would be a good place to store dynamic snow accumulation? Hrm...

My point of this stream-of-consciousness rant is that the design of any one rendering engine feature is heavily influenced by its neighbors. We'll get all of these effects someday. If there are features that are really easy, we can get them into the sim quickly, but the only obvious one I see now is using bump maps on other OBJ-like entities (which at this point would mean facades).

3 comments:

Nils said...

To me it seems that the normal maps primarily affect specular highlight. They therefor work great on shiny polished fuselages, but I wonder if they can be used on ground or facades without making the whole x-plane world look totally plastic. The exception might be water and waves - it'd be interesting to see what it would look like with normal map distorted specular highlights on some rough sea.

Another use of PPL that I'd like to see you explore further is the volumous fog. Today, fog will fade any background towards the horizon colour, while in real life, bright objects like clouds will take on a copper tone while dark ones will fade to blue.

Dan said...

What about "real" dynamic shadows that actually cast shadows onto itself, like a fuse casting its shadow onto a wing, engine etc. (or any other scenery element for that matter, like buildings)?

Regarding the next-gen texturing on runways you mention, I will re-voice my plea for yellow runway markings (as seen in Norway and possibly elsewhere) to finally be made available to authors in an extension to the apt dat spec...

Normal maps for polygon and line artwork would definitely be a welcomed feature!

Hotdog said...

It is great to hear that we will get all the candy some day - and understandably there is a tradeoff and balance to be achieved on immediate possibilities.

Dan's comment on dynamic shadows is a very good one, and may add loads of detail without (hopefully) too much developer inputs, especially in the 3d cockpits.

I had a look again last night at some screenshots of mine from v5.40, and many moons and changes have come since then!