asm and Seasonal Textures

#1
I tried to put seasonal textures to my gmax-tree (gamepack2004) via asm and the way Arno discribed in his Seasonal Texture-Tutorial 2002. After decompiling with BGLC_9 I´ve got an error "can´t open *_0.asm, where I made the changes.

Apfel2_top label BGLCODE
texture_riff_start_Apfel2 label word
db 'T','E','X','T'
dd texture_riff_end_Apfel2 - $ - 4
TEXTURE_LIST_BEGIN
TEXTURE_DEF TEXTURE_BUILDING , <255,255,255,255>, 14.170703, "TREE_IRREG.BMP" ; 0
TEXTURE_DEF TEXTURE_BUILDING , <255,255,255,255>, 14.170703, "TREE_IRREG_WI.BMP" ; 1
TEXTURE_DEF TEXTURE_BUILDING , <255,255,255,255>, 14.170703, "TREE_IRREG_SP.BMP" ; 2
TEXTURE_DEF TEXTURE_BUILDING , <255,255,255,255>, 14.170703, "TREE_IRREG_FA.BMP" ; 3

TEXTURE_LIST_END
BGL_RETURN
texture_riff_end_Apfel2 label word


material_riff_start_Apfel2 label word
db 'M','A','T','E'
dd material_riff_end_Apfel2 - $ - 4
MATERIAL_LIST_BEGIN
MATERIAL_DEF 1.000000,1.000000,1.000000,1.000000, 0.392157,0.392157,0.392157, 0.000000,0.000000,0.000000, 0.000000,0.000000,0.000000, 0.000000 ; 0
MATERIAL_LIST_END
BGL_RETURN
material_riff_end_Apfel2 label word


vertex_riff_start_Apfel2 label word
db 'V','E','R','T'
dd vertex_riff_end_Apfel2 - $ - 4
VERTEX_LIST_BEGIN
VERTEX_DEF -10.000001, 0.000000, 0.004000, 0.000001,-0.000229, 1.000000, 1.000000,0.000000 ; 0 part= 1 prim=0
VERTEX_DEF -10.000001, 0.000000, 0.004000, -0.000001, 0.000229,-1.000000, 0.000000,0.000000 ; 1 part= 1 prim=0
VERTEX_DEF -10.000001, 20.040001, 0.008000, 0.000001,-0.000229, 1.000000, 1.000000,1.000000 ; 2 part= 1 prim=0
VERTEX_DEF -10.000001, 20.040001, 0.008000, -0.000001, 0.000229,-1.000000, 0.000000,1.000000 ; 3 part= 1 prim=0
VERTEX_DEF 10.040001, 0.000000, 0.004000, 0.000001,-0.000229, 1.000000, 0.000000,0.000000 ; 4 part= 1 prim=0
VERTEX_DEF 10.040001, 0.000000, 0.004000, -0.000001, 0.000229,-1.000000, 1.000000,0.000000 ; 5 part= 1 prim=0
VERTEX_DEF 10.040001, 20.040001, 0.008000, 0.000001,-0.000229, 1.000000, 0.000000,1.000000 ; 6 part= 1 prim=0
VERTEX_DEF 10.040001, 20.040001, 0.008000, -0.000001, 0.000229,-1.000000, 1.000000,1.000000 ; 7 part= 1 prim=0
VERTEX_LIST_END
BGL_RETURN
vertex_riff_end_Apfel2 label word


bgl_riff_start_Apfel2 label BGLCODE
db 'B','G','L',' '
dd bgl_riff_end_Apfel2 - $ - 4
LOD_0_Apfel2 label BGLCODE

; NonAlpha
Apfel2_NonAlpha label BGLCODE

IFIN1 tex_01, 0000006f8h, 0, 0
MATERIAL 0,1 ; <255,255,255,255> TREE_IRREG_WI.BMP;;;
JUMP tex_verder
tex_01 label word
IFIN1 tex_02, 0000006f8h, 1, 1
MATERIAL 0,2 ; <255,255,255,255> TREE_IRREG_SP.BMP;;;
JUMP tex_verder
tex_02 label word
IFIN1 tex_03, 0000006f8h, 2, 2
MATERIAL 0,0 ; <255,255,255,255> TREE_IRREG.BMP;;;
JUMP tex_verder
tex_03 label word
MATERIAL 0,3 ; <255,255,255,255> TREE_IRREG_FA.BMP;;;
tex_verder label word



BGL_CALL_32 Apfel2_MasterScale_1 ; Node 1 - MasterScale
BGL_END
BGL_RETURN


Apfel2_MasterScale_1 label BGLCODE
MATERIAL 0,0 ; <255,255,255,255> TREE_IRREG.BMP;;;
DRAW_TRI_BEGIN 0, 8
DRAW_TRI 1, 5, 7 ; poly=7 part=1
DRAW_TRI 7, 3, 1 ; poly=8 part=1
DRAW_TRI 4, 0, 2 ; poly=11 part=1
DRAW_TRI 2, 6, 4 ; poly=12 part=1
DRAW_TRI_END
BGL_RETURN


bgl_riff_end_Apfel2 label BGLCODE

Can somebody explain me, what is going wrong? Thanks in advance.

Thomas
www.flightport.de
 
Last edited:
#3
Code:
; NonAlpha
Apfel2_NonAlpha label BGLCODE

IFIN1 tex_01, 0000006f8h, 0, 0
MATERIAL 0,1 ; <255,255,255,255> TREE_IRREG_WI.BMP;;;
JUMP tex_verder
tex_01 label word
IFIN1 tex_02, 0000006f8h, 1, 1
MATERIAL 0,2 ; <255,255,255,255> TREE_IRREG_SP.BMP;;;
JUMP tex_verder
tex_02 label word
IFIN1 tex_03, 0000006f8h, 2, 2
MATERIAL 0,0 ; <255,255,255,255> TREE_IRREG.BMP;;;
JUMP tex_verder
tex_03 label word
MATERIAL 0,3 ; <255,255,255,255> TREE_IRREG_FA.BMP;;;
tex_verder label word


BGL_CALL_32 Apfel2_MasterScale_1 ; Node 1 - MasterScale
BGL_END
BGL_RETURN


Apfel2_MasterScale_1 label BGLCODE
[COLOR=DarkOrange]MATERIAL 0,0 ; <255,255,255,255> TREE_IRREG.BMP;;;[/COLOR]
DRAW_TRI_BEGIN 0, 8
DRAW_TRI 1, 5, 7 ; poly=7 part=1
DRAW_TRI 7, 3, 1 ; poly=8 part=1
DRAW_TRI 4, 0, 2 ; poly=11 part=1
DRAW_TRI 2, 6, 4 ; poly=12 part=1
DRAW_TRI_END
BGL_RETURN


bgl_riff_end_Apfel2 label BGLCODE
Hi,

The line high-lighted in orange might be the problem...It sets the material always to 0,0, your regular tree texture..it overrides all the previous material definitions. Just comment it out with a semicolon or erase the line.

Hope that helped,
Jeff
 
Last edited:
#4
Hi Jeff,

only one semicolon can rules the world. Fantastic, here is the complete code for my little gmax-tree (for the beginners in BGLC-coding like me). It works fine!!!

Apfel2_top label BGLCODE
texture_riff_start_Apfel2 label word
db 'T','E','X','T'
dd texture_riff_end_Apfel2 - $ - 4
TEXTURE_LIST_BEGIN
TEXTURE_DEF TEXTURE_BUILDING , <255,255,255,255>, 14.170703, "TREE_IRREG.BMP" ; 0
TEXTURE_DEF TEXTURE_BUILDING , <255,255,255,255>, 14.170703, "TREE_IRREG_WI.BMP" ; 1
TEXTURE_DEF TEXTURE_BUILDING , <255,255,255,255>, 14.170703, "TREE_IRREG_SP.BMP" ; 2
TEXTURE_DEF TEXTURE_BUILDING , <255,255,255,255>, 14.170703, "TREE_IRREG_FA.BMP" ; 3
TEXTURE_LIST_END
BGL_RETURN
texture_riff_end_Apfel2 label word


material_riff_start_Apfel2 label word
db 'M','A','T','E'
dd material_riff_end_Apfel2 - $ - 4
MATERIAL_LIST_BEGIN
MATERIAL_DEF 1.000000,1.000000,1.000000,1.000000, 0.392157,0.392157,0.392157, 0.000000,0.000000,0.000000, 0.000000,0.000000,0.000000, 0.000000 ; 0
MATERIAL_LIST_END
BGL_RETURN
material_riff_end_Apfel2 label word


vertex_riff_start_Apfel2 label word
db 'V','E','R','T'
dd vertex_riff_end_Apfel2 - $ - 4
VERTEX_LIST_BEGIN
VERTEX_DEF -10.000001, 0.000000, 0.004000, 0.000001,-0.000229, 1.000000, 1.000000,0.000000 ; 0 part= 1 prim=0
VERTEX_DEF -10.000001, 0.000000, 0.004000, -0.000001, 0.000229,-1.000000, 0.000000,0.000000 ; 1 part= 1 prim=0
VERTEX_DEF -10.000001, 20.040001, 0.008000, 0.000001,-0.000229, 1.000000, 1.000000,1.000000 ; 2 part= 1 prim=0
VERTEX_DEF -10.000001, 20.040001, 0.008000, -0.000001, 0.000229,-1.000000, 0.000000,1.000000 ; 3 part= 1 prim=0
VERTEX_DEF 10.040001, 0.000000, 0.004000, 0.000001,-0.000229, 1.000000, 0.000000,0.000000 ; 4 part= 1 prim=0
VERTEX_DEF 10.040001, 0.000000, 0.004000, -0.000001, 0.000229,-1.000000, 1.000000,0.000000 ; 5 part= 1 prim=0
VERTEX_DEF 10.040001, 20.040001, 0.008000, 0.000001,-0.000229, 1.000000, 0.000000,1.000000 ; 6 part= 1 prim=0
VERTEX_DEF 10.040001, 20.040001, 0.008000, -0.000001, 0.000229,-1.000000, 1.000000,1.000000 ; 7 part= 1 prim=0
VERTEX_LIST_END
BGL_RETURN
vertex_riff_end_Apfel2 label word


bgl_riff_start_Apfel2 label BGLCODE
db 'B','G','L',' '
dd bgl_riff_end_Apfel2 - $ - 4
LOD_0_Apfel2 label BGLCODE

; NonAlpha
Apfel2_NonAlpha label BGLCODE


IFIN1 tex_01, 0000006f8h, 0, 0
MATERIAL 0,1 ; <255,255,255,255> TREE_IRREG_WI.BMP;;;
JUMP tex_verder
tex_01 label word
IFIN1 tex_02, 0000006f8h, 1, 1
MATERIAL 0,2 ; <255,255,255,255> TREE_IRREG_SP.BMP;;;
JUMP tex_verder
tex_02 label word
IFIN1 tex_03, 0000006f8h, 2, 2
MATERIAL 0,0 ; <255,255,255,255> TREE_IRREG.BMP;;;
JUMP tex_verder
tex_03 label word
MATERIAL 0,3 ; <255,255,255,255> TREE_IRREG_FA.BMP;;;
tex_verder label word


; BGL_CALL_32 Apfel2_MasterScale_1 ; Node 1 - MasterScale
SPRITE_VICALL Apfel2_MasterScale_1, 0, 0, 0, 0, 0, 0, 0, 1, 0 ; rotation
BGL_END
BGL_RETURN


Apfel2_MasterScale_1 label BGLCODE
; MATERIAL 0,0 ; <255,255,255,255> TREE_IRREG.BMP;;;
DRAW_TRI_BEGIN 0, 8
DRAW_TRI 1, 5, 7 ; poly=7 part=1
DRAW_TRI 7, 3, 1 ; poly=8 part=1
DRAW_TRI 4, 0, 2 ; poly=11 part=1
DRAW_TRI 2, 6, 4 ; poly=12 part=1
DRAW_TRI_END
BGL_RETURN

bgl_riff_end_Apfel2 label BGLCODE


Thanks a lot. Now can I sleep this night... Only one beginners semicolon - isn´t it hard?

Thomas
 
Last edited:

arno

Administrator
Staff member
FSDevConf team
Resource contributor
#5
Actually it is better to place the IFIN1 texture checks like this, that should also solves the extra line problem:

Code:
bgl_riff_start_Apfel2 label BGLCODE
db 'B','G','L',' '
dd bgl_riff_end_Apfel2 - $ - 4
LOD_0_Apfel2 label BGLCODE

; NonAlpha
Apfel2_NonAlpha label BGLCODE

SPRITE_VICALL Apfel2_MasterScale_1, 0, 0, 0, 0, 0, 0, 0, 1, 0 ; rotation
BGL_END
BGL_RETURN

Apfel2_MasterScale_1 label BGLCODE

IFIN1 tex_01, 0000006f8h, 0, 0
MATERIAL 0,1 ; <255,255,255,255> TREE_IRREG_WI.BMP;;;
JUMP tex_verder
tex_01 label word
IFIN1 tex_02, 0000006f8h, 1, 1
MATERIAL 0,2 ; <255,255,255,255> TREE_IRREG_SP.BMP;;;
JUMP tex_verder
tex_02 label word
IFIN1 tex_03, 0000006f8h, 2, 2
MATERIAL 0,0 ; <255,255,255,255> TREE_IRREG.BMP;;;
JUMP tex_verder
tex_03 label word
MATERIAL 0,3 ; <255,255,255,255> TREE_IRREG_FA.BMP;;;
tex_verder label word

DRAW_TRI_BEGIN 0, 8
DRAW_TRI 1, 5, 7 ; poly=7 part=1
DRAW_TRI 7, 3, 1 ; poly=8 part=1
DRAW_TRI 4, 0, 2 ; poly=11 part=1
DRAW_TRI 2, 6, 4 ; poly=12 part=1
DRAW_TRI_END
BGL_RETURN

bgl_riff_end_Apfel2 label BGLCODE
 
#6
Great,

I finished my "little" scenery - I think next weekend I can put some pics in the showroom. Its Koblenz EDRK - a local airfield between Cologne and Frankfurt in the middle of Germany. It will be very detailled.

It´s my first scenery following the new techniques. It was a long way for me to understand only some basics. But reading here and posting for help was the best way to elemate frustration. Thank you all here for helping me.

Thomas
 
Top