Tuesday, August 05, 2008

3-d Cockpit Features (Someday)

I'm back from vacation and trying to catch up on email and close out 920.  I've received a number of emails regarding the 3-d cockpit, the big questions being:
  1. What can I do about the lousy lighting for 3-d object textures and 3-d panel textures via ATTR_cockpit_region?
  2. Can I use the new 2-d panel spot lights in the 3-d cockpit?
The answer is unfortunately "not much for now" and "no".  Let me explain what's going on with the 3-d cockpit and what we're thinking for a long term strategy.

First, I try to organize my feature work around one part of the sim for each patch.  920 is a bit too big of a patch for us (featuring both a lot of cockpit/instrument work and some big rendering engine changes).  Austin has been on the road a lot this year, and in his absence I went a little nutty.  I wanted to do some work on the 3-d cockpit, but it's different code, and with 920 in beta so long, this work will have to wait.

3-d Lighting

Our long term approach to the 3-d cockpit is "real 3-d lighting".  By that I mean: multiple light sources, acting on all of the cockpit geometry based on 3-d positioning.  This means a few things:
  • Providing some way to specify multiple light sources inside the cockpit, as well as how they are controlled (e.g. how do you dim the flood light)?
  • Specifying which attached objects are considered part of the interior of the plane vs. the exterior.
  • Providing a way to provide emissive lighting vs. elements that must be lit by light sources.
The 3-d cockpit lighting environment must work the same for the panel texture and object textures.  This is necessary to keep the brightness of the finished cockpit consistent between the two textures sources.  With the current 3-d system (e.g. what you can do in 864) often the brightness of the panel texture and the rest of the object don't match.

To this end, ATTR_cockpit_region, which is targeted at the new system, gives you the same lighting model for the object texture and panel texture.  Now that model isn't very useful right now, but it will get better with future patches, and it will always be consistent.

Why Not 2-D Panel Lighting

We can't use the new 2-d panel lighting features (spot lights), etc. because they are not scalable. Most of the advanced 3-d cockpits I have looked at use a lot of textures, quite possibly several 1024x1024 object textures, as well as a panel texture.

Now the panel texture is very expensive, so there is a penalty for letting it be any bigger than necessary.  Given this, we'd only have two options:
  • Provide the 2-d spot light features on the OBJ textures, effectively making them dynamic. This would be very expensive, performance-wise.
  • Have authors only use one huge panel texture.  This would limit them to 2048x2048 and be really slow.
If we don't provide the spot lighting features for all panel textures then we have the problem of inconsistent lighting, which makes the feature fairly useless.

So instead I have withheld spot lighting (and _LIT replacement textures) from the 3-d panel; the cockpit object will instead end up featuring real 3-d light sources to create these kinds of effects in a 3-d correct manner.

The idea here is to avoid providing features that will be unnecessary, inferior, slow, or unsupportable in the future.  Otherwise such a "stop-gap" measure would just end up breaking existing airplanes.

So for now, the 864 system for 3-d cockpits still works as it always did.  It will be at least one more patch before 3-d cockpits get a serious upgrade.

4 comments:

Anonymous said...

hi ben you talked about the lousy lighting for 3-d object textures and 3-d panel textures via ATTR_cockpit_regions. is this what I find now in jason chandlers 3D panels of his nice planes like cirrus jet or cirrus SR22. will this be solved soon?! me for myself do not want to buy any planes with this artefacts. thnx and cheers TOM

Benjamin Supnik said...

Hi Tom,

The short answer is: I don't know, but probably not. My post refers to limitations in the way the authoring environment is set up for airplanes. I am _NOT_ talking about rendering artifacts or any particular problem with any plane.

I don't have Jason's planes and have not examined them; you'll have to take that up directly with him.

I don't think you would be able to tell from this blog post that a particular piece of third party content has a particular artifact. You need to look at the plane itself and understand how it is made.

Anonymous said...

hi ben, tnx for your answer - jasons thinks I should contact aou - you think I should contact jason - and me as a not programming customer I am lost :-(
cheers TOM

Benjamin Supnik said...

Tom,

You (or Jason) need to email me. No more blog comments. The point of blog comments is to comment on the blog posting. This is not an appropriate forum to work this out.

/Ben