Jump to content
Sign in to follow this  
Guest

Fixing the problems with textures on gMax buildings

Recommended Posts

Guest GerrishGray

To all those who haven't followed the recent reports buried in two or three threads on this forum and 'General Discussions' :-There appears to be a fault in the gMax~makemdl.exe~FS2002 interface that can cause incorrect handling of textures applied to 3D objects in BGLs. The fault does not affect aircraft MDLs.The symptoms of this fault observed so far are:[ol][li]loss of texturing of objects at an unexpectedly near range, so that they are displayed in middle distance with the underlying fallback colour in place of the applied texture[/li][li]incorrect handling of the alpha transparency channel from DXT3 bitmaps, resulting in a 'hazed' background in some circumstances of parts that are supposed to be 100% transparent.[/li][/ol]The problems seem to arise because gMax flags textures as being of 'Aircraft' type even when they are being applied to 'Building' objects. Thanks to our friend Arno for discovering this!At the present time, I believe that the fixes are[ol][li](As reported by Arno) intercept the BGLC assembler code available from makemdl.exe, look for lines in the texture definition list defining textures as

TEXTURE_DEF [b]TEXTURE_AIRCRAFT[/b] ... "[i]texturename[/i]"

and change them to read

TEXTURE_DEF [b]TEXTURE_BUILDING[/b] ... "[i]texturename[/i]"

[/li][li]In the past it has been a fairly widespread practice to use various colours in the 'main' image for the transparent parts of textures, relying on solid black in the alpha channel to produce 100% transparency. Although I have not fully explored this, it seems that it may be advisable to always make the transparent parts of the 'main' image black (0,0,0) as well. This only affects textures in the DXT3 format. Christian might want to investigate this further in his exploration of transparency and reflectivity effects on buildings ...[/li][/ol]RegardsGerrish

Share this post


Link to post
Share on other sites
Guest christian

(2) Not a bad idea. If I get you right you want to use 2 textures with the second being rgb = black and alpha = reflectivity.This won't work though. The texture name has to be the same for reflectivity :( So I can only use one texture for use as the main texture and reflective effects.So far, my conclusion is that there are 2 different effects:(1) If you set the specular colour and power, the main texture blends the specular colour, which is quite useful, but there is no mask, so the whole texture is effected. Also, the glossiness setting isn't exported into BGLC, so we can't make the texture glossy...This effect uses the sun light and makes objects appear as they do in reality...(2) Using a reflecive texture with alpha channel uses it's own specular colour (only white), specular power, and glossiness setting. All 3 parameters are controlled by the alpha channel. However, this effect mainly uses ambient light mixed with a little bit of sunlight. This makes buildings look unreal, since the sunlight has a much stronger effect on reflectivity in reality...Cheers, Christian

Share this post


Link to post
Share on other sites
Guest

Well that's to bad I guess we will have to just have to hope Microsoft givs us the ability to add gloss effects by enableing the above when exporting to a BGL maybe for FS2004? Thanks for saving us the time by looking into this. Dan

Share this post


Link to post
Share on other sites
Guest GerrishGray

You misunderstood me Christian. The main point of my post is the error in gMax/makemdl that results in building textures incorrectly being treated as aircraft textures.In part 2 of the fix, I was not suggesting the use of two textures. A problem has been reported with a DXT3 texture applied to a 3D object, where the texture (a tree) relied on a transparent background. In the main channels of the DXT3 the background was painted dark green, in the alpha channel it was painted black (0,0,0). This should have resulted in the display of a 100% transparent background around the tree in the normal way, but the background was instead displayed as a dark green haze.This may well have been caused by the texture type flag, but part 2 of the fix was to suggest that the hazing problem would hopefully not arise anyway if the transparent parts of the texture were painted black on the main image as well as in the alpha channel, although I haven't yet tested this. Only one texture is involved, not two.Does that clarify?-----------------------------------To develop this point further, I know that you are doing extensive work on establishing the effects of the different parts of the material and texture definitions. What I hope we can end up with is a clear definition/manual/tutorial of exactly how to use the new BGLC macros and their associated arguments, to expand on the information in the new BGLFP SDK. It seems dangerous to rely purely on experimentation via gMax because, as reported above, gMax doesn't necessarily generate the correct/expected code, so the results of such experimentation may be confusing ... I think we need to work directly via BGLC to be sure.Kind RegardsGerrish

Share this post


Link to post
Share on other sites
Guest christian

ok, got you, just got confused because you wrote it may help my reflectivity problem. It still won't help me with the reflectivity, since 2 textures are need for that. Good point though, I didn't know about that problem, since I haven't worked with transparency yet. I agree on the gmax / BGLC point. I do my experiments with BGLC. With the glossiness settings I tried gmax to see what it actually produces. Once we figure bglc out, we should see if we can do the same just with gmax. In fact, you can set specular colours and power in gmax and it does get exported to bglc!Cheers, Christian

Share this post


Link to post
Share on other sites
Guest GerrishGray

Yup, gMax doesn't get it ALL wrong :-hah With luck, the aircraft/building texture-type glitch is the only worm in the can, but then again worms in cans have this way of breeding ...Gerrish

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...