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

gmax ground polys: how to...

Messages
68
Country
unitedstates
Hi everyone. I am kind of messing with the gmax ground polys and tweaking them to be 3-dimensional. The Wiki tutorial on this article did not help me because a lot of lines on my ASM file is missing like:
PHP:
OBJECT_0_START label word
 IFIN1 OBJECT_0_FAIL, image_complex, 2, 32767
 ADDOBJ OBJECT_0_SCALE
 SHADOW_CALL OBJECT_0_SCALE
 OBJECT_0_FAIL label BGLCODE
My ASM shows this, the first one is the original, the second one has the _0 in it.

PHP:
; compile with BGLC /MDL C:\Program Files\gmax\gamepacks\fs2004\meshes\polygon_sample.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  1018
    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  -899.650, 0.000, 383.647  
    real4  -817.382, 0.000, 475.887  
bounding_box_riff_end label word       


model_outside    label    BGLCODE
model_shadow label BGLCODE
model_inside  label    BGLCODE
crash_riff_start label BGLCODE
    db  'C','R','A','S'   
    dd  crash_riff_end - $ - 4
    BGL_CRASH_START   model_crash_end, 1018
    BGL_CRASH_OCTTREE  crash_end_1
    dw     CRASH_FLAG_BUILDING_PLANE            ; crash type
    dw     1            ; nodes used
    real4  -899.649658,0.000000,383.647400      ; Box x,y,z 
    real4  82.267433,30.746412,92.239235      ; Box w,h,d 
    dw   1,   1,   1,   1,   1,   1,   1,   1    ; base offset into node table, one for each top-level branch
    ; So if you take branch 2 (count from 0), you add 1 to indices you encounter on that branch
    ; Nodes (254=empty 255=full, else an index into branch)
    OCTTREE_NODE   254, 254, 254, 254, 254, 254, 254, 254           ; node   0
crash_end_1 label word
model_crash_end label word
    BGL_RETURN
crash_riff_end	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:\Program Files\gmax\gamepacks\fs2004\meshes\polygon_sample_0.asm
exterior_riff_end_0	label	BGLCODE



bgl_data_end label     BGLCODE

PHP:
;--------- WARNING - WARNING - WARNING - WARNING - WARNING - WARNING ---------
;
; This file was automatically generated from C:\Program Files\gmax\gamepacks\fs2004\meshes\polygon_sample
; using the MakeMDL tool.  Do not edit by hand, re-run the
; tool instead.
;
; generated on 12/28/07 20:04:58
;
;--------- WARNING - WARNING - WARNING - WARNING - WARNING - WARNING ---------
; BGL model for C:\Program Files\gmax\gamepacks\fs2004\meshes\polygon_sample
;
; $Header:$
;
;----------------------------------------------------------------------------
;
; Final Status:   2 polys
; Alpha Status:   0 polys
; Light Status:   0 polys
; Library Status: 0 polys
;
; Start Time: 12/28/07 20:04:58
; Stop Time : 12/28/07 20:04:58
;
; Modeling units = 1.0000
; Radius = 1017.7610
; Radius in meters = 1017.7610
; Radius in modeling units = 1018
;
polygon_sample_top label BGLCODE
texture_riff_start_polygon_sample	label	word
    db  'T','E','X','T'   
    dd  texture_riff_end_polygon_sample - $ - 4  
    TEXTURE_LIST_BEGIN
    TEXTURE_DEF TEXTURE_BUILDING    , <255,255,255,255>, 61.596540, "APRON_TEXTURE_CONCRETE.BMP"	; 0
    TEXTURE_LIST_END
    BGL_RETURN
texture_riff_end_polygon_sample label word       


material_riff_start_polygon_sample	label	word
    db  'M','A','T','E'   
    dd  material_riff_end_polygon_sample - $ - 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_polygon_sample label word       


vertex_riff_start_polygon_sample	label	word
    db  'V','E','R','T'   
    dd  vertex_riff_end_polygon_sample - $ - 4  
    VERTEX_LIST_BEGIN
    VERTEX_DEF  -899.648071,    0.000000,  475.888031,   0.000000, 1.000000, 0.000000,   0.000000,1.000000 ;   0 part=  0 prim=0
    VERTEX_DEF  -899.648071,    0.000000,  383.648010,   0.000000, 1.000000, 0.000000,   0.000000,0.000000 ;   1 part=  0 prim=0
    VERTEX_DEF  -817.384033,    0.000000,  475.888031,   0.000000, 1.000000, 0.000000,   1.000000,1.000000 ;   2 part=  0 prim=0
    VERTEX_DEF  -817.384033,    0.000000,  383.648010,   0.000000, 1.000000, 0.000000,   1.000000,0.000000 ;   3 part=  0 prim=0
    VERTEX_LIST_END
    BGL_RETURN
vertex_riff_end_polygon_sample label word       


bgl_riff_start_polygon_sample	label	BGLCODE
    db	'B','G','L',' '
    dd	bgl_riff_end_polygon_sample - $ - 4
LOD_0_polygon_sample	label	BGLCODE

; NonAlpha
polygon_sample_NonAlpha label BGLCODE
    MATERIAL 0,0 ; <255,255,255,255> APRON_TEXTURE_CONCRETE.BMP;;;
    DRAW_TRI_BEGIN 0, 4
    DRAW_TRI    0,   1,   2 ; poly=2 part=0
    DRAW_TRI    1,   3,   2 ; poly=1 part=0
    DRAW_TRI_END
    BGL_END
    BGL_RETURN


bgl_riff_end_polygon_sample	label	BGLCODE

;--------- WARNING - WARNING - WARNING - WARNING - WARNING - WARNING ---------
;
; This file was automatically generated from C:\Program Files\gmax\gamepacks\fs2004\meshes\polygon_sample
; using the MakeMDL tool.  Do not edit by hand, re-run the
; tool instead.
;
; generated on 12/28/07 20:04:58
;
;--------- WARNING - WARNING - WARNING - WARNING - WARNING - WARNING ---------

Please help me on this. I don't know where to find the line to activate the object to be 3d. Oh and last thing, I used MDLCommander in this.

Thanks a lot for the help

Justin
 
Hi Justin,

The ASM file you show comes from the FS2004 gamepack, ground polygons can only be made when you export your scenery with the FS2002 gamepack. The ASM code from these two is completely different.
 
So, how do I do it in FS2004 gamepack? I mean making ground polys 3d to avoid the flicker thing.
 
You can't do it in the FS2004 gamepack, that is why everybody is still using the FS2002 gamepack for their ground polygons.
 
Hi,

No, you can not download all parts of the FS2002 GMax SDK on the web. But there is a work around, see this Wiki article. Especially see the links in the FS2002 gamepack section about using MDLCommander to save your X files.
 
Concerning the FS2004-gamepack:
It should be possible to create an groundpolygon, if it gets tweaked with mdl-tweaker. Set the texture-type to ground and remove the shadow, so that the gmax-drawn polygon has the right parameters.
To prevent flickering just use a "ZBIAS_" string before the material name in gmax (material name, not texture name).

This worked very good for me, but for larger groundpolys with several plane-segments it seems to have a bug at the edges...? I don't have an explanation therefor.

But however - 2002-polys work better within FS, so I also decided to downgrade again - Wouldn't there be the complicated way to manual asm-tweaking for seasonal textures...:rolleyes:
 
Concerning the FS2004-gamepack:
It should be possible to create an groundpolygon, if it gets tweaked with mdl-tweaker. Set the texture-type to ground and remove the shadow, so that the gmax-drawn polygon has the right parameters.
To prevent flickering just use a "ZBIAS_" string before the material name in gmax (material name, not texture name).

This worked very good for me, but for larger groundpolys with several plane-segments it seems to have a bug at the edges...? I don't have an explanation therefor.

In the past there have been quite some reports that this will result in sunken polygons from a distance. And besides that the aircraft will still not cast a shadow on your ground polygons. It might be a workaround in some cases, but using the FS2002 gamepack gives much better results.
 
Unfortunately, after reinstalling 2002 SDK I still cannot find the lines I have to edit:

Code:
; compile with BGLC /MDL E:\FS\GMax\GMax_MDL\testplane.asm
    db  'R','I','F','F'
    dd  aircraft_model_end - $ - 4
    db  'M','D','L','8'

    db  'M','D','L','H'
visual_model_header  label dword
    dd  visual_model_header_end - $ - 4
    dd  0
    dd  0
    dd  54
    dd  0
    dd  0
    dd  154
    db  'F','S','8','0'
    dd  2048
visual_model_header_end  label dword

    db  'D','I','C','T'                                                 
param_extension_dictionary     label dword                              
    dd  28
    dict_crash_check equ 152
    dd 4,152,2, 00EECADB4h, 041C61724h, 07AD877B9h, 0E844954Ch
param_extension_dictionary_end  label dword                              

    db  'B','B','O','X'   
    dd  bbox_end - $ - 4  
    df  -44.981, 0.000, -27.509  
    df  45.725, 0.000, 26.022  
bbox_end label word       

    db  'I','S','F','T'   
    dd  ver_end - $ - 4  
    db  "MakeMDL - Microsoft© Flight Simulator 2002 SDK (8.00.020403.01)",0
ver_end label word       

    db  'B','G','L',' '                                                 
    dd  aircraft_model_end - $ - 4                                      
aircraft_model    label    BGLCODE                                      
    VPOSITION    no_model,0,54,AIRCRAFT_PARAMS.llapbh.lla				
    VFILE_MARKER AIRCRAFT_PARAMS.texture_dir                            

    IFMSK           inside,AIRCRAFT_PARAMS.gen_model,GEN_MODEL_OUTSIDE+GEN_MODEL_DISPLAY
    BGL_CALL        shadow                                              
    VPOSITION       no_model,0,54,AIRCRAFT_PARAMS.llapbh.lla            
    SUPER_SCALE     no_model,0,0,6                                     
    VINSTANCE_CALL  model_outside,AIRCRAFT_PARAMS.llapbh.pbh            
no_model    label   BGLCODE                                             
    BGL_RETURN                                                          
shadow    label    BGLCODE                                              
    BGL_IF  AIRCRAFT_PARAMS.gen_model,GEN_MODEL_NOSHADOW                
        BGL_RETURN                                                      
    BGL_ENDIF                                                           
    SHADOW_VPOSITION    AIRCRAFT_PARAMS.llapbh.lla                      
    SUPER_SCALE         shadow_out,0,54,6                              
    SHADOW_VICALL       model_shadow,AIRCRAFT_PARAMS.llapbh.pbh        
shadow_out    label     BGLCODE                                         
    BGL_RETURN                                                          

inside label     BGLCODE                                                
    IFMSK        inside2,AIRCRAFT_PARAMS.gen_model,GEN_MODEL_FRONT        
inside1    label    BGLCODE                                               
    BGL_RETURN                                                                  
inside2    label    BGLCODE                                               
    IFMSK        inside3,AIRCRAFT_PARAMS.gen_model,GEN_MODEL_DOWNWARD     
    BGL_CALL     shadow                                                         
    BGL_RETURN                                                                  
inside3    label    BGLCODE                                               
    VPOSITION    no_model,0,54,AIRCRAFT_PARAMS.llapbh.lla                   
    SUPER_SCALE  no_model,0,0,6                                            
    VINSTANCE_CALL  model_inside,AIRCRAFT_PARAMS.llapbh.pbh                 
    BGL_RETURN                                                              

model_outside    label    BGLCODE
    IFMSK    model_crash_skip,dict_crash_check,-1
    BGL_CALL model_crash
model_crash_skip label BGLCODE
model_shadow label BGLCODE

LOD_0    label    BGLCODE
    BGL_JUMP_32    LOD_0L

model_inside  label    BGLCODE
    BGL_RETURN
model_crash label BGLCODE
    BGL_CRASH_START   model_crash_end, 54643
    BGL_CRASH_OCTTREE  crash_end_1
    dw     CRASH_FLAG_AIRCRAFT            ; crash type
    dw     85            ; nodes used
    real4  -46060.960938,0.000000,-28169.519531      ; Box x,y,z 
    real4  92883.367188,30961.123047,54816.460938      ; Box w,h,d 
    dw   1,  22,  43,  43,  43,  64,  85,  85    ; base offset into node table, one for each top-level branch
    ; So if you take branch 2 (count from 0), you add 43 to indices you encounter on that branch
    ; Nodes (254=empty 255=full, else an index into branch)
    OCTTREE_NODE     0,   0, 254, 254,   0,   0, 254, 254           ; node   0
    OCTTREE_NODE     1,   2, 254, 254,   3,   4, 254, 254           ; node   1
    OCTTREE_NODE     5,   6, 254, 254,   7,   8, 254, 254           ; node   2


...... [shortened to decrease post size] ........


    OCTTREE_NODE   255, 255, 254, 254, 255, 255, 254, 254           ; node  75
    OCTTREE_NODE   255, 255, 254, 254, 255, 255, 254, 254           ; node  76
    OCTTREE_NODE   255, 255, 254, 254, 255, 255, 254, 254           ; node  77
    OCTTREE_NODE   255, 255, 254, 254, 255, 255, 254, 254           ; node  78
    OCTTREE_NODE   255, 255, 254, 254, 255, 255, 254, 254           ; node  79
    OCTTREE_NODE   255, 255, 254, 254, 255, 255, 254, 254           ; node  80
    OCTTREE_NODE   255, 255, 254, 254, 255, 255, 254, 254           ; node  81
    OCTTREE_NODE   255, 255, 254, 254, 255, 255, 254, 254           ; node  82
    OCTTREE_NODE   255, 255, 254, 254, 255, 255, 254, 254           ; node  83
    OCTTREE_NODE   255, 255, 254, 254, 255, 255, 254, 254           ; node  84
crash_end_1 label word
model_crash_end label word
    BGL_RETURN

LOD_0L    label    BGLCODE
    include    E:\FS\GMax\GMax_MDL\testplane_0.asm



aircraft_model_end label     BGLCODE

Code:
;--------- WARNING - WARNING - WARNING - WARNING - WARNING - WARNING ---------
;
; This file was automatically generated from E:\FS\GMax\GMax_MDL\testplane
; using the MakeMDL tool.  Do not edit by hand, re-run the
; tool instead.
;
; generated on 06/11/08 14:29:49
;
;--------- WARNING - WARNING - WARNING - WARNING - WARNING - WARNING ---------
; BGL model for E:\FS\GMax\GMax_MDL\testplane
;
; $Header:$
;
;----------------------------------------------------------------------------
;
; Final Status:   32 polys
; Alpha Status:   0 polys
; Light Status:   0 polys
; Library Status: 0 polys
;
; Start Time: 06/11/08 14:29:49
; Stop Time : 06/11/08 14:29:49
;
; Modeling units = 1024.0000
; Radius = 53.3622
; Radius in meters = 53.3622
; Radius in modeling units = 54643
;
testplane_top label BGLCODE
    BGL_BEGIN 0800h ; version = 8.00
    MATERIAL_LIST_BEGIN
    MATERIAL_DEF 0.345098,0.694118,0.101961,1.000000,  0.345098,0.694118,0.101961,  0.000000,0.000000,0.000000,  0.000000,0.000000,0.000000,  0.000000 ; 0
    MATERIAL_LIST_END

    VERTEX_LIST_BEGIN
    VERTEX_DEF -46059.523438,    0.000000,26648.578125,   0.000000, 1.000000, 0.000000,   0.000000,1.000000 ;   0 part=  1 prim=0
    VERTEX_DEF -46059.523438,    0.000000,12943.360352,   0.000000, 1.000000, 0.000000,   0.000000,1.000000 ;   1 part=  1 prim=0


...... [shortened to decrease post size] ........


    VERTEX_DEF 46821.378906,    0.000000,-28168.193359,   0.000000, 1.000000, 0.000000,   0.000000,1.000000 ;  24 part=  1 prim=0
    VERTEX_LIST_END


; NonAlpha
testplane_NonAlpha label BGLCODE

    IFMSK           testplane_skip_1,AIRCRAFT_PARAMS.parts_visible,VISIBLE_ALLOTHER
    BGL_CALL_32 testplane_MasterScale_1        ; Node 1 - MasterScale
testplane_skip_1 label BGLCODE
    BGL_END
    BGL_RETURN


testplane_MasterScale_1 label BGLCODE
    MATERIAL 0 ; <88,177,26,255> 
    DRAW_TRI_BEGIN 0, 25
    DRAW_TRI    2,   7,   6 ; poly=17 part=1
    DRAW_TRI    8,   3,   4 ; poly=2 part=1


...... [shortened to decrease post size] ........


    DRAW_TRI_END
    BGL_RETURN



;--------- WARNING - WARNING - WARNING - WARNING - WARNING - WARNING ---------
;
; This file was automatically generated from E:\FS\GMax\GMax_MDL\testplane
; using the MakeMDL tool.  Do not edit by hand, re-run the
; tool instead.
;
; generated on 06/11/08 14:29:49
;
;--------- WARNING - WARNING - WARNING - WARNING - WARNING - WARNING ---------
 
Sorry, my bad. Didn't know I have to create a BGL. Exporting MDL with FS2002 seems only possible for aircraft MDLs.

Another lesson learned... :o
 
Back
Top