Jump to content
Sign in to follow this  
n4gix

FSDS3 and _L

Recommended Posts

Guest pecrowther

I have previously used _lm files to provide night-lighting. These were simple bmp files with no alpha.However FSDS3 appeared to assume that if one bmp texture file had night lighting, they all did. So, it would refuse to texture any bmp file that did not have a corresponding _lm texture file. Also, my dxt1 transparent files became reflect files.So, I decided to switch to using _L files for night lighting. I have changed the regular files to DXT3 files with a black alpha. For light files, I have used my old _lm files and added a black alpha channel.In FSDS texture properties, I have checked the box for "Light Map" only, not Light Map with Alpha. (Although it doesn't seem to have an effect.) I have set Alpha channel = 255 (not "0") although that doesn't seem to have an effect either.What I now have is textures that look fine during the day, but show no lights at night. When I push the "L" key, the textures turn on and off with the lights.I figured that with several hours of trial and error, I would eventually hit the right combination - after all, even a monkey can play Mozart. But, I am beginning to think that the monkey will succeed before I do.Help?Thanks,Phil

Share this post


Link to post
Share on other sites

Hi MateDont use _LM makemdl no like unless its used for scenery :)As you have found all textures go a missing if only 1 texture has an _lm modifier.Now the _l modifier works,but you will find any texture that has reflective alpha will now turn transperent(once again a makemdl problem not FSDS) the G-maxers make a number of small black texture and give it the name of the reflective texure but with a _l modifer,So basically any texture you have a _t needs a coresponding texture with a _l use the small textures for any texture you dont need the lighting this will stop the transperent problemAn alpha channel of pure black switch the _l texture on with nav lights,pure white switch the _l texture on with landing lights.As these textures overlay the main textures they only need the light beam/splashs painted these areas will highlite the main textures.See easy :)......NOT!!! Wozza

Share this post


Link to post
Share on other sites

From the FS2002 SDK "Using Materials in GMax" (note: nothing changed from this to FS2004):NightMapThe NightMap texture is used for an object at night. For dawn or dusk, Flight Simulator blends* the NightMap and Base Texture. NightMap textures are used for scenery objects, not for aircraft objects.*NOTE: this was in fact a typographical error, it should have read "Flight Simulator replaces the Base Texture with the NightMap."LightMapThe LightMap texture is used at night to light the Base Texture. Unlike the NightMap texture, the LightMap texture does not replace the Base Texture at night. Instead, it is always combined with the Base Texture. The LightMap textures for aircraft are special because the alpha channel contains a mask that allows you to select running lights or landing lights. (use A=0 for running lights; use A=255 for landing lights.)I suppose what has confused more people on this is that one might logically conclude that _lm would be used for LightMap... Sadly, this is not the case however, since MS in their infinite capacity for confusion assigned _lm to NightMap, and reserved the ambiguious _l suffix for LightMap! *:-* So, long story short, Louis mistakenly used the _lm suffix for years thinking that it was "SDK compliant," when in fact is was not then, nor is it now... ;) That it "sort of worked" is self-evident, but from the way that FS handles the texture replacement (with _lm suffix) versus texture blending (with the _l suffix) optimum results would be difficult to achieve.


Fr. Bill    

AOPA Member: 07141481 AARP Member: 3209010556


     Avsim Board of Directors | Avsim Forums Moderator

Share this post


Link to post
Share on other sites
Guest pecrowther

Wozza and Bill,This may actually make life easier. I had been using bmps and, for transparent parts, bmp with colorkey alpha (so I see them with my bmp reader).I have read elsewhere that graphics cards process dxt files faster, so I am willing to give up the ability to see them with a bmp reader. The FSDS3 changes seem to be pushing my in the direction of using DXT3 for all of my textures. (Just to make sure, DXT3 uses 16 bits for color and 16 bits for alpha?)As for using _l instead of _lm, I like the idea of FS2004 determining the darkness of the texture. So the idea of overlaying a light source makes sense.As I now understand the process:On _l.bmps, for each pixel, the program will first read the alpha channel and if the alpha is white, will check the corresponding portion of the image to see if anything is there. If the image value is black, nothing happens. Otherwise the program overlays the image value onto the main image.Is that correct?It apparently does it not matter that the _l.bmp is the same dimension as the main bmp? Does the program just loop back to the beginning when it reaches the last pixel in the _l.bmp?Thanks,Phil

Share this post


Link to post
Share on other sites

>I have read elsewhere that graphics cards process dxt files>faster, so I am willing to give up the ability to see them>with a bmp reader. The FSDS3 changes seem to be pushing my in>the direction of using DXT3 for all of my textures. (Just to>make sure, DXT3 uses 16 bits for color and 16 bits for>alpha?)First, you can use whatever format you like in FSDS3 or GMax, you only need to convert the textures for FS9 to use.DTX3 is 24 bit RGB with an 8 bit alpha:"RGB image with full 8 bit Alpha channelSaved by combining the current RGB image with the current Alpha channel reduced to a 4 bit (16 level) Alpha" (DXTBMP Help File)>On _l.bmps, for each pixel, the program will first read the>alpha channel and if the alpha is white, will check the>corresponding portion of the image to see if anything is>there. If the image value is black, nothing happens. >Otherwise the program overlays the image value onto the main>image.>Is that correct?Close enough. The process is "additive." Each pixel has an ARGB value (Alpha, Red, Green, Blue). The value of the Alpha determines the relative brightness of the pixel. The bitmap's Alpha value is added to the Alpha value from the _L.bmp, and applied to the pixel. The maximum value for Alpha is 255. The entry in the panel.cfg for night color determines the base Alpha for the texture bitmap.If the Alpha for a particular pixel is 60, and the Alpha from the LightMap texture is 100, then the applied Alpha on the panel will be 160.Keep in mind that all of the ARGB values from the _L.bmp are used! If you paint a green color on the _L.bmp, it will add the A,R,G & B values to the base texture... ;) If you're not careful, the results can be some pretty strange colors!>It apparently does it not matter that the _l.bmp is the same>dimension as the main bmp? Does the program just loop back to>the beginning when it reaches the last pixel in the _l.bmp?Close enough... FS9 is good about scaling bitmaps as long as they remain powers of 2. For simply masking a texture to prevent nighttime "transparency," a tiny _L.bmp of only 8x8 pixels is all that is required! ;)


Fr. Bill    

AOPA Member: 07141481 AARP Member: 3209010556


     Avsim Board of Directors | Avsim Forums Moderator

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Tom Allensworth,
    Founder of AVSIM Online


  • Flight Simulation's Premier Resource!

    AVSIM is a free service to the flight simulation community. AVSIM is staffed completely by volunteers and all funds donated to AVSIM go directly back to supporting the community. Your donation here helps to pay our bandwidth costs, emergency funding, and other general costs that crop up from time to time. Thank you for your support!

    Click here for more information and to see all donations year to date.
×
×
  • Create New...