• Which the release of FS2020 we see an explosition of activity on the forun and of course we are very happy to see this. But having all questions about FS2020 in one forum becomes a bit messy. So therefore we would like to ask you all to use the following guidelines when posting your questions:

    • Tag FS2020 specific questions with the MSFS2020 tag.
    • Questions about making 3D assets can be posted in the 3D asset design forum. Either post them in the subforum of the modelling tool you use or in the general forum if they are general.
    • Questions about aircraft design can be posted in the Aircraft design forum
    • Questions about airport design can be posted in the FS2020 airport design forum. Once airport development tools have been updated for FS2020 you can post tool speciifc questions in the subforums of those tools as well of course.
    • Questions about terrain design can be posted in the FS2020 terrain design forum.
    • Questions about SimConnect can be posted in the SimConnect forum.

    Any other question that is not specific to an aspect of development or tool can be posted in the General chat forum.

    By following these guidelines we make sure that the forums remain easy to read for everybody and also that the right people can find your post to answer it.

Trees as XML object

Messages
11
Back in action :stirthepo now :D
I'm putting some trees on my scenery now, but i've 2 question:
i made in gmax, and exported to librarycreatorXML with 2004gamepack. Exporting and placing went ok, but now i need some more tweak: shadow removing and seasonal texturing.
For shadow removing, i put 99 in opacity in material menu' in gmax, but now when i look my trees, i can see the clouds in the background!! ODD! :banghead:
For seasonal texturing, i've read some post here, but they're referring to 2002 gampack. If i modify the asm of my model, how can i get the mdl file from this? Is it something with makemdl?
thanks

alex
 
Hi Alex,

First you need to get the ASM code of your tree. Either use a cfg file or MDLCommander to get this.

Then you will need to download BGLC9 (see the sticky in this forum), this will allow you to compile it back to a MDL file later on.

Then you can start the actual code tweaks. For the seasonal textures the old trick still works, only the location of the pieces of code has shifted a bit in the source.

To remove the shadow please see the topic by Rhumbaflappy about this subject. He explains which code to add.
 
Thanks alot Arno, worked great!
My trees are coming up very well now, but i've just another request:
to put a visualization distance to them? E.g. 400mts, to save some frame rate?
I attach the two asm code if anyone needs it , it's a tree with no shadow and seasonal texturing

Code:
; ; compile with BGLC /MDL C:\ISD\LIRF\libreria\mdl\alb_1.asm
    db  'R','I','F','F'				; RIFF file identifier
    dd  bgl_data_end - $ - 4		    ; size of RIFF data
    db  'M','D','L','9'				; file identifire (FS9 model)

    db  'M','D','L','H'
    dd  visual_model_header_end - $ - 4
    dd  visual_model_header_end - $ - 4
    dd  0
    dd  0
    dd  22
    dd  0
    dd  0
    dd  152
    db  'F','S','8','0'
    dd  2304
visual_model_header_end  label dword

    db  'I','S','F','T'   
    dd  ver_end - $ - 4  
    db  "MakeMDL - FS90 (9.00.030612.02)",0
ver_end label word       

bounding_box_riff_start	label	word
    db  'B','B','O','X'   
    dd  bounding_box_riff_end - $ - 4
    real4  -9.525, 0.047, -9.525  
    real4  9.525, 19.097, 9.525  
bounding_box_riff_end label word       


model_outside    label    BGLCODE
model_shadow label BGLCODE
model_inside  label    BGLCODE
exterior_riff_start_0 label BGLCODE
    db  'E','X','T','E'   
    dd  exterior_riff_end_0 - $ - 4
LOD_0L    label    BGLCODE
    include    C:\ISD\LIRF\libreria\mdl\alb_1_0.asm
exterior_riff_end_0	label	BGLCODE

shadow_riff_start_0 label BGLCODE
db 'S','H','A','D' 
dd shadow_riff_end_0 - $ - 4
SHADOW_0L label BGLCODE

Kill_Shadow_top label BGLCODE
bgl_riff_start_Kill_Shadow label BGLCODE
db 'B','G','L',' '
dd bgl_riff_end_Kill_Shadow - $ - 4

LOD_0_Kill_Shadow label BGLCODE
BGL_END
BGL_RETURN

bgl_riff_end_Kill_Shadow label BGLCODE
shadow_riff_end_0 label BGLCODE



bgl_data_end label     BGLCODE

Code:
;--------- WARNING - WARNING - WARNING - WARNING - WARNING - WARNING ---------
;
; This file was automatically generated from C:\ISD\LIRF\libreria\mdl\alb_1
; using the MakeMDL tool.  Do not edit by hand, re-run the
; tool instead.
;
; generated on 10/27/04 15:07:45
;
;--------- WARNING - WARNING - WARNING - WARNING - WARNING - WARNING ---------
; BGL model for C:\ISD\LIRF\libreria\mdl\alb_1
;
; $Header:$
;
;----------------------------------------------------------------------------
;
; Final Status:   8 polys
; Alpha Status:   0 polys
; Light Status:   0 polys
; Library Status: 0 polys
;
; Start Time: 10/27/04 15:07:45
; Stop Time : 10/27/04 15:07:45
;
; Modeling units = 1.0000
; Radius = 21.3410
; Radius in meters = 21.3410
; Radius in modeling units = 22
;
alb_1_top label BGLCODE
texture_riff_start_alb_1	label	word
    db  'T','E','X','T'   
    dd  texture_riff_end_alb_1 - $ - 4  
    TEXTURE_LIST_BEGIN
    TEXTURE_DEF TEXTURE_BUILDING , <255,255,255,255>, 47.462108, "ALBERI.BMP"    ; 0
    TEXTURE_DEF TEXTURE_BUILDING , <255,255,255,255>, 47.462108, "ALBERI_WI.BMP" ; 1
    TEXTURE_DEF TEXTURE_BUILDING , <255,255,255,255>, 47.462108, "ALBERI_SP.BMP" ; 2
    TEXTURE_DEF TEXTURE_BUILDING , <255,255,255,255>, 47.462108, "ALBERI_FA.BMP" ; 3 
    TEXTURE_DEF TEXTURE2_NIGHT   , <255,255,255,255>, 47.462108, "ALBERI_LM.BMP" ; 4
    TEXTURE_LIST_END
    BGL_RETURN
texture_riff_end_alb_1 label word       


material_riff_start_alb_1	label	word
    db  'M','A','T','E'   
    dd  material_riff_end_alb_1 - $ - 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_alb_1 label word       


vertex_riff_start_alb_1	label	word
    db  'V','E','R','T'   
    dd  vertex_riff_end_alb_1 - $ - 4  
    VERTEX_LIST_BEGIN
    VERTEX_DEF    -9.524000,    0.048000,    0.000000,   0.000000, 0.000000, 1.000000,   0.297101,0.698068 ;   0 part=  1 prim=0
    VERTEX_DEF    -9.524000,    0.048000,    0.000000,   0.000000, 0.000000,-1.000000,   0.012077,0.698068 ;   1 part=  1 prim=0
    VERTEX_DEF    -9.524000,   19.096001,    0.000000,   0.000000, 0.000000, 1.000000,   0.297101,0.980676 ;   2 part=  1 prim=0
    VERTEX_DEF    -9.524000,   19.096001,    0.000000,   0.000000, 0.000000,-1.000000,   0.012077,0.980676 ;   3 part=  1 prim=0
    VERTEX_DEF     0.000000,    0.048000,    9.524000,  -1.000000, 0.000000, 0.000000,   0.012077,0.698068 ;   4 part=  1 prim=0
    VERTEX_DEF     0.000000,    0.048000,    9.524000,   1.000000, 0.000000, 0.000000,   0.297101,0.698068 ;   5 part=  1 prim=0
    VERTEX_DEF     0.000000,    0.048000,   -9.524000,  -1.000000, 0.000000, 0.000000,   0.297101,0.698068 ;   6 part=  1 prim=0
    VERTEX_DEF     0.000000,    0.048000,   -9.524000,   1.000000, 0.000000, 0.000000,   0.012077,0.698068 ;   7 part=  1 prim=0
    VERTEX_DEF     0.000000,   19.096001,    9.524000,  -1.000000, 0.000000, 0.000000,   0.012077,0.980676 ;   8 part=  1 prim=0
    VERTEX_DEF     0.000000,   19.096001,    9.524000,   1.000000, 0.000000, 0.000000,   0.297101,0.980676 ;   9 part=  1 prim=0
    VERTEX_DEF     0.000000,   19.096001,   -9.524000,  -1.000000, 0.000000, 0.000000,   0.297101,0.980676 ;  10 part=  1 prim=0
    VERTEX_DEF     0.000000,   19.096001,   -9.524000,   1.000000, 0.000000, 0.000000,   0.012077,0.980676 ;  11 part=  1 prim=0
    VERTEX_DEF     9.524000,    0.048000,    0.000000,   0.000000, 0.000000, 1.000000,   0.012077,0.698068 ;  12 part=  1 prim=0
    VERTEX_DEF     9.524000,    0.048000,    0.000000,   0.000000, 0.000000,-1.000000,   0.297101,0.698068 ;  13 part=  1 prim=0
    VERTEX_DEF     9.524000,   19.096001,    0.000000,   0.000000, 0.000000, 1.000000,   0.012077,0.980676 ;  14 part=  1 prim=0
    VERTEX_DEF     9.524000,   19.096001,    0.000000,   0.000000, 0.000000,-1.000000,   0.297101,0.980676 ;  15 part=  1 prim=0
    VERTEX_LIST_END
    BGL_RETURN
vertex_riff_end_alb_1 label word       


bgl_riff_start_alb_1	label	BGLCODE
    db	'B','G','L',' '
    dd	bgl_riff_end_alb_1 - $ - 4
LOD_0_alb_1	label	BGLCODE

; NonAlpha
alb_1_NonAlpha label BGLCODE

    BGL_CALL_32 alb_1_MasterScale_1        ; Node 1 - MasterScale
    BGL_END
    BGL_RETURN


alb_1_MasterScale_1 label BGLCODE
;MATERIAL 0,0 ; <255,255,255,255> ALBERI.BMP;ALBERI_LM.BMP;;
IFIN1 tex_01, 0000006f8h, 0, 0
MATERIAL 0,1 ; <255,255,255,255> ALBERI_WI.BMP;;;
JUMP tex_verder
tex_01 label word
IFIN1 tex_02, 0000006f8h, 1, 1
MATERIAL 0,2 ; <255,255,255,255> ALBERI_SP.BMP;;;
JUMP tex_verder
tex_02 label word
IFIN1 tex_03, 0000006f8h, 2, 2
MATERIAL 0,0 ; <255,255,255,255> ALBERI.BMP;;;
JUMP tex_verder
tex_03 label word
MATERIAL 0,3 ; <255,255,255,255> ALBERI_FA.BMP;;;
tex_verder label word
    DRAW_TRI_BEGIN 0, 16
    DRAW_TRI    9,  11,   7 ; poly=2 part=1
    DRAW_TRI    4,   6,  10 ; poly=3 part=1
    DRAW_TRI   10,   8,   4 ; poly=4 part=1
    DRAW_TRI    1,  13,  15 ; poly=5 part=1
    DRAW_TRI   15,   3,   1 ; poly=6 part=1
    DRAW_TRI   12,   0,   2 ; poly=7 part=1
    DRAW_TRI    2,  14,  12 ; poly=8 part=1
    DRAW_TRI    7,   5,   9 ; poly=1 part=1
    DRAW_TRI_END
    BGL_RETURN


bgl_riff_end_alb_1	label	BGLCODE

;--------- WARNING - WARNING - WARNING - WARNING - WARNING - WARNING ---------
;
; This file was automatically generated from C:\ISD\LIRF\libreria\mdl\alb_1
; using the MakeMDL tool.  Do not edit by hand, re-run the
; tool instead.
;
; generated on 10/27/04 15:07:45
;
;--------- WARNING - WARNING - WARNING - WARNING - WARNING - WARNING ---------

thanks
alex
 
Hi Alex,

to check the distance from the object's refpoint, use the variable 33bh.
I extended your code in the 'B','G','L' section with the 2 red lines, which will perform a distance check for 400m.

Jeff

Code:
bgl_riff_start_alb_1	label	BGLCODE
    db	'B','G','L',' '
    dd	bgl_riff_end_alb_1 - $ - 4
LOD_0_alb_1	label	BGLCODE

; NonAlpha
alb_1_NonAlpha label BGLCODE

[COLOR=Red]  IFIN doNothing, 33bh, 0, 400[/COLOR]
    BGL_CALL_32 alb_1_MasterScale_1        ; Node 1 - MasterScale
[COLOR=Red]  doNothing label BGLCODE[/COLOR]
    BGL_END
    BGL_RETURN


alb_1_MasterScale_1 label BGLCODE
;MATERIAL 0,0 ; <255,255,255,255> ALBERI.BMP;ALBERI_LM.BMP;;
IFIN1 tex_01, 0000006f8h, 0, 0
MATERIAL 0,1 ; <255,255,255,255> ALBERI_WI.BMP;;;
JUMP tex_verder
tex_01 label word
IFIN1 tex_02, 0000006f8h, 1, 1
MATERIAL 0,2 ; <255,255,255,255> ALBERI_SP.BMP;;;
JUMP tex_verder
tex_02 label word
IFIN1 tex_03, 0000006f8h, 2, 2
MATERIAL 0,0 ; <255,255,255,255> ALBERI.BMP;;;
JUMP tex_verder
tex_03 label word
MATERIAL 0,3 ; <255,255,255,255> ALBERI_FA.BMP;;;
tex_verder label word
    DRAW_TRI_BEGIN 0, 16
    DRAW_TRI    9,  11,   7 ; poly=2 part=1
    DRAW_TRI    4,   6,  10 ; poly=3 part=1
    DRAW_TRI   10,   8,   4 ; poly=4 part=1
    DRAW_TRI    1,  13,  15 ; poly=5 part=1
    DRAW_TRI   15,   3,   1 ; poly=6 part=1
    DRAW_TRI   12,   0,   2 ; poly=7 part=1
    DRAW_TRI    2,  14,  12 ; poly=8 part=1
    DRAW_TRI    7,   5,   9 ; poly=1 part=1
    DRAW_TRI_END
    BGL_RETURN


bgl_riff_end_alb_1	label	BGLCODE

;--------- WARNING - WARNING - WARNING - WARNING - WARNING - WARNING ---------
;
; This file was automatically generated from C:\ISD\LIRF\libreria\mdl\alb_1
; using the MakeMDL tool.  Do not edit by hand, re-run the
; tool instead.
;
; generated on 10/27/04 15:07:45
;
;--------- WARNING - WARNING - WARNING - WARNING - WARNING - WARNING ---------
 
Back
Top