FS2004 FS9 Reflection and Night Textures

#1
I am using some "relfective" textures for a handful of buildings in my current project. I am using the Texture_Aircraft and Texture2_Reflect trick, but I now have another issue.

For some reason, at night, the object behaves as if there is no night texture (the day texture is there, but darkened like it is shaded by the sim)...everything seems right in the texture definition section of the ASM:

texture_riff_start_firenew label word
db 'T','E','X','T'
dd texture_riff_end_firenew - $ - 4
TEXTURE_LIST_BEGIN
TEXTURE_DEF TEXTURE_AIRCRAFT , <255,255,255,255>, 73.604378, "KL_FIRE.BMP" ; 0
TEXTURE_DEF TEXTURE2_REFLECT , <255,255,255,255>, 73.604378, "KL_FIRE.BMP" ; 0
TEXTURE_DEF TEXTURE2_NIGHT , <255,255,255,255>, 73.604378, "KL_FIRE_LM.BMP" ; 1
TEXTURE_LIST_END
BGL_RETURN
texture_riff_end_firenew label word
Am I missing something here? Thanks for your help!
 
Last edited:

arno

Administrator
Staff member
FSDevConf team
Resource contributor
#2
Hi,

Did you try to swap the night texture and the reflection in the definition? Not sure if that it is, but might be worth a try.
 
#5
Do I understand right, it is possible to add reflection map for FS9 scenery? That would be awesome!
Sort of...it uses the FS default environment map, so the reflections are the same as if you increased the alpha on an aircraft paint.

Here's the rough 5 second description of what to do, feel free to PM me if you need help:
-Save the ASM files from when you compile the model.
-Inside the _0.asm, you will find a listing of textures:
texture_riff_start_firenew label word
db 'T','E','X','T'
dd texture_riff_end_firenew - $ - 4
TEXTURE_LIST_BEGIN
TEXTURE_DEF TEXTURE_BUILDING , <255,255,255,255>, 73.604378, "KL_FIRE.BMP" ; 0
TEXTURE_DEF TEXTURE2_NIGHT , <255,255,255,255>, 73.604378, "KL_FIRE_LM.BMP" ; 1
TEXTURE_LIST_END
BGL_RETURN
texture_riff_end_firenew label word
-Change TEXTURE_BUILDING to TEXTURE_AIRCRAFT (tricks FS into making the alpha a shine rather than transparency.
-Add a TEXTURE2_REFLECT line after the TEXTURE2_NIGHT. The reflect line should be nearly identical to the _AIRCRAFT line:
texture_riff_start_firenew label word
db 'T','E','X','T'
dd texture_riff_end_firenew - $ - 4
TEXTURE_LIST_BEGIN
TEXTURE_DEF TEXTURE_AIRCRAFT , <255,255,255,255>, 73.604378, "KL_FIRE.BMP" ; 0
TEXTURE_DEF TEXTURE2_NIGHT , <255,255,255,255>, 73.604378, "KL_FIRE_LM.BMP" ; 1
TEXTURE_DEF TEXTURE2_REFLECT , <255,255,255,255>, 73.604378, "KL_FIRE.BMP" ; 2
TEXTURE_LIST_END
BGL_RETURN
texture_riff_end_firenew label word
-Use BGLC9 to compile the asm back into a mdl (well bgl first then rename to mdl).

It gets a bit more tricky when you have multiple textures. You will have to change several reference numbers through the entire _0.asm. (Notepad's replace feature does the trick). PM me if you need help on that. :D

Then all you have to do is add an alpha to a texture as if you were painting an aircraft, and you will see some "reflection" in the building...remember, not an actual reflection, just the FS9 env map. At night, there is no shine, and the alpha goes back to behaving like a transparency (so all white or no alpha _lm.bmp's).

Hope that helps.
 
#6
Thanks David!

Fortunately or unfortunately (depends on situation) I have experience in asm coding :)

If the alpha channel behaves as aircraft reflection it means you can not have transparency and reflection at the same time? Correct?
 
#7
Thanks David!

Fortunately or unfortunately (depends on situation) I have experience in asm coding :)

If the alpha channel behaves as aircraft reflection it means you can not have transparency and reflection at the same time? Correct?
Yes and no again :D...you cannot do alpha transparency but I think you might be able to change the material transparency within gmax/3DS. I haven't tried it, but I imagine that would get you a transparent, and "reflective" material. If I recall, this might be how FlightZone did the PDX terminal windows.

Hope that helps!
 

arno

Administrator
Staff member
FSDevConf team
Resource contributor
#8
Hi,

I think using a different texture as specular map could also allow having both.

The main limitation is that you need to use texture type aircraft instead of building. Else the reflection does not work. And using texture type aircraft can result in untextured objects from a distance.
 
Top