Using Night Textures alongside Seasonal Textures

I have been able to sucessfully add night textures for objects in GMAX thanks to the code postings on this forum. However, I also wish for these objects to maintain their night textures. I have tried not changing the night textures and just adjusting the seasons as below:

Code:
IFIN1 tex_02, 038Ah, 325, 355
MATERIAL 0,0 ;  winter
JUMP tex_continue1
tex_02 label word
IFIN1 tex_03, 038Ah, 356, 366
MATERIAL 0,1 ;  hard winter
JUMP tex_continue1
tex_03 label word
IFIN1 tex_04, 038Ah, 0, 76
MATERIAL 0,1 ;  hard winter
JUMP tex_continue1
tex_04 label word
IFIN1 tex_05, 038Ah, 77, 171
MATERIAL 0,2 ; spring
JUMP tex_continue1
tex_05 label word
IFIN1 tex_06, 038Ah, 172, 262
MATERIAL 0,3 ; summer
JUMP tex_continue1
tex_06 label word
MATERIAL 0,4 ; fall
tex_continue1 label word
    BGL_ZBIAS 4
    DRAW_TRI_BEGIN 0, 4
    DRAW_TRI    3,   2,   1 ; poly=14 part=1
    DRAW_TRI    0,   1,   2 ; poly=13 part=1
    DRAW_TRI_END
    BGL_ZBIAS 0
Or adding in a line to test for the night condition as below...
Code:
IFIN1 tex_01, 028Ch, 2, 4
MATERIAL 0,5 ;  night
JUMP tex_continue1
tex_01 label word
IFIN1 tex_02, 038Ah, 325, 355
MATERIAL 0,0 ;  winter
JUMP tex_continue1
tex_02 label word
IFIN1 tex_03, 038Ah, 356, 366
MATERIAL 0,1 ;  hard winter
JUMP tex_continue1
tex_03 label word
IFIN1 tex_04, 038Ah, 0, 76
MATERIAL 0,1 ;  hard winter
JUMP tex_continue1
tex_04 label word
IFIN1 tex_05, 038Ah, 77, 171
MATERIAL 0,2 ; spring
JUMP tex_continue1
tex_05 label word
IFIN1 tex_06, 038Ah, 172, 262
MATERIAL 0,3 ; summer
JUMP tex_continue1
tex_06 label word
MATERIAL 0,4 ; fall
tex_continue1 label word
    BGL_ZBIAS 4
    DRAW_TRI_BEGIN 0, 4
    DRAW_TRI    3,   2,   1 ; poly=14 part=1
    DRAW_TRI    0,   1,   2 ; poly=13 part=1
    DRAW_TRI_END
    BGL_ZBIAS 0


The second one shows the night texture, but the texture appears like a "day" texture at night (dull). I haven't changed the type of texture earlier in the file. It still appears as such...

Code:
TEXTURE_DEF TEXTURE_BUILDING    , <255,255,255,255>, 540.750213, "KBWIO11_wi.BMP" 	 ;0
    TEXTURE_DEF TEXTURE_BUILDING    , <255,255,255,255>, 540.750213, "KBWIO11_hw.BMP" 	 ;1
    TEXTURE_DEF TEXTURE_BUILDING    , <255,255,255,255>, 540.750213, "KBWIO11_sp.BMP" 	 ;2
    TEXTURE_DEF TEXTURE_BUILDING    , <255,255,255,255>, 540.750213, "KBWIO11_su.BMP" 	 ;3
    TEXTURE_DEF TEXTURE_BUILDING    , <255,255,255,255>, 540.750213, "KBWIO11_fa.BMP" 	 ;4
    TEXTURE_DEF TEXTURE2_NIGHT      , <255,255,255,255>, 540.750213, "KBWIO11_LM.BMP"	;5

Any suggestions??

Thanks for everything!
 

arno

Administrator
Staff member
FSDevConf team
Resource contributor
Hi Matt,

This approach will not work, as your night texture will be displayed like a normal texture if you switch it like this.

The best approach is to assign a night texture to each day texture (the night texture is a subtexture type anyway).

Code:
TEXTURE_DEF TEXTURE_BUILDING    , <255,255,255,255>, 540.750213, "KBWIO11_wi.BMP" 	 ;0
TEXTURE_DEF TEXTURE2_NIGHT      , <255,255,255,255>, 540.750213, "KBWIO11_LM.BMP"	;1
TEXTURE_DEF TEXTURE_BUILDING    , <255,255,255,255>, 540.750213, "KBWIO11_hw.BMP" 	 ;2
TEXTURE_DEF TEXTURE2_NIGHT      , <255,255,255,255>, 540.750213, "KBWIO11_LM.BMP"	;3
TEXTURE_DEF TEXTURE_BUILDING    , <255,255,255,255>, 540.750213, "KBWIO11_sp.BMP" 	 ;4
TEXTURE_DEF TEXTURE2_NIGHT      , <255,255,255,255>, 540.750213, "KBWIO11_LM.BMP"	;5
TEXTURE_DEF TEXTURE_BUILDING    , <255,255,255,255>, 540.750213, "KBWIO11_su.BMP" 	 ;6
TEXTURE_DEF TEXTURE2_NIGHT      , <255,255,255,255>, 540.750213, "KBWIO11_LM.BMP"	;7
TEXTURE_DEF TEXTURE_BUILDING    , <255,255,255,255>, 540.750213, "KBWIO11_fa.BMP" 	 ;8
TEXTURE_DEF TEXTURE2_NIGHT      , <255,255,255,255>, 540.750213, "KBWIO11_LM.BMP"	;9
Of course you need to change your MATERIAL numbers after that as well, to match the inserted textures.
 
Top