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

Bright_ texture name in CFS2 GSL SCENERY

Messages
80
Country
unitedkingdom
I develop for cfs2 and would like a little understanding of what I done with the asm code ,why it works, and is there a easier way. Objects in gsl scenery do not show night textures. I found a work around. The first object I do give the material the bright_name, when I save the asm, no mention of bright_ and is not bright in the game.
I then texture a object with the built in gmax white material and give the material opacity of 1. I then copy MATERIAL_DEF 0.000000,0.000000,0.000000,0.007843, 0.000000,0.000000,0.000000, 0.000000,0.000000,0.000000, 0.992157,0.992157,0.992157, 0.000000 ; 0 and past MATERIAL_DEF 0.000000,0.000000,0.000000,0.007843, 0.000000,0.000000,0.000000, 0.000000,0.000000,0.000000, 0.992157,0.992157,0.992157, 0.000000 ; 0 to the third object.

Hoping this is legible.

FIRST OBJECT
; Modeling units = 2.0000
; Radius = 60.0000
; Radius in meters = 60.0000
; Radius in modeling units = 121
;
fire_top label BGLCODE
BGL_BEGIN 0800h ; version = 8.00
TEXTURE_LIST_BEGIN
TEXTURE_DEF TEXTURE_AIRCRAFT , <255,255,255,255>, 185.952416, "RJ_EFFECT.BMP" ; 0
TEXTURE_LIST_END

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

SECOND OBJECT
; Modeling units = 2.0000
; Radius = 60.0000
; Radius in meters = 60.0000
; Radius in modeling units = 121
;
bright_top label BGLCODE
BGL_BEGIN 0800h ; version = 8.00
MATERIAL_LIST_BEGIN
MATERIAL_DEF 0.000000,0.000000,0.000000,0.007843, 0.000000,0.000000,0.000000, 0.000000,0.000000,0.000000, 0.992157,0.992157,0.992157, 0.000000 ; 0 MATERIAL_LIST_END

THIRD OBJECT

; Modeling units = 2.0000
; Radius = 60.0000
; Radius in meters = 60.0000
; Radius in modeling units = 121
;
fire_top label BGLCODE
BGL_BEGIN 0800h ; version = 8.00
TEXTURE_LIST_BEGIN
TEXTURE_DEF TEXTURE_AIRCRAFT , <255,255,255,255>, 185.952416, "RJ_EFFECT1.BMP" ; 0
TEXTURE_LIST_END

MATERIAL_LIST_BEGIN
MATERIAL_DEF 0.000000,0.000000,0.000000,0.007843, 0.000000,0.000000,0.000000, 0.000000,0.000000,0.000000, 0.992157,0.992157,0.992157, 0.000000 ; 0 MATERIAL_LIST_END
 

rhumbaflappy

Administrator
Staff member
Resource contributor
Messages
5,619
Country
us-wisconsin
This is the macro for MATERIAL_DEF:

Code:
MATERIAL_DEF macro dr,dg,db,da, ar,ag,ab, sr,sg,sb, er,eg,eb, sp

      real4 dr,dg,db,da       ; diffuse

      real4 ar,ag,ab,1.0      ; ambient

      real4 sr,sg,sb,1.0      ; specular

      real4 er,eg,eb,1.0      ; emissive

      real4 sp                      ; specular power

      endm

1st four numbers are your RGBA for daytime textures. Next 3 (ar,ag,ab,) are your traditional night textures. Then 3 numbers for specular, then 3 for emissive (er,eg,eb), then a final number for specular power....

You increased the emissive numbers, so the texture shows at night. But I think you'll loose the daytime shading in CFS2.

Dick
 

rhumbaflappy

Administrator
Staff member
Resource contributor
Messages
5,619
Country
us-wisconsin
I made some headway with this.

I made a cube for the night and a second cube for the day. The night cube was 40.1 and the day cube was 40.0... so the day object was inside the night cube.

I assigned a diffuse texture to the 'day' cube, and I assigned a lighting texture to the larger night cube ( That texture was white for the illumination, and had an alpha channel to make the rest transparent).

I exported the mess, and got an ASM file like this:

Code:
_40m_Cube_Test_top label BGLCODE
    BGL_BEGIN 0800h ; version = 8.00
    TEXTURE_LIST_BEGIN
    TEXTURE_DEF TEXTURE_AIRCRAFT    , <255,255,255,255>, 28.284271, "MYTEXTURE.BMP"	; 0
    TEXTURE_DEF TEXTURE_AIRCRAFT    , <255,255,255,255>, 28.354981, "MYTEXTURE_L.BMP"	; 1
    TEXTURE_LIST_END

    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

    VERTEX_LIST_BEGIN
    ....
; NonAlpha
_40m_Cube_Test_NonAlpha label BGLCODE
    BGL_FTAG "MasterScale", 0.00               ; Node 1 
    MATERIAL 0,0 ; <255,255,255,255> MYTEXTURE.BMP;;;
    DRAW_TRI_BEGIN 0, 24
    DRAW_TRI   17,  14,  20 ; poly=7 part=1
    DRAW_TRI   12,  15,   4 ; poly=2 part=1
    DRAW_TRI   11,  22,  19 ; poly=3 part=1
    DRAW_TRI   19,   8,  11 ; poly=4 part=1
    DRAW_TRI    5,  16,  21 ; poly=5 part=1
    DRAW_TRI   21,  10,   5 ; poly=6 part=1
    DRAW_TRI    4,   1,  12 ; poly=1 part=1
    DRAW_TRI   20,  23,  17 ; poly=8 part=1
    DRAW_TRI   13,   2,   7 ; poly=9 part=1
    DRAW_TRI    7,  18,  13 ; poly=10 part=1
    DRAW_TRI    0,   3,   9 ; poly=11 part=1
    DRAW_TRI    9,   6,   0 ; poly=12 part=1
    DRAW_TRI_END
    MATERIAL 0,1 ; <255,255,255,255> MYTEXTURE_L.BMP;;;
    DRAW_TRI_BEGIN 24, 24
    DRAW_TRI    4,   1,  12 ; poly=13 part=1
    DRAW_TRI   12,  15,   4 ; poly=14 part=1
    DRAW_TRI   11,  22,  19 ; poly=15 part=1
    DRAW_TRI   19,   8,  11 ; poly=16 part=1
    DRAW_TRI    5,  16,  21 ; poly=17 part=1
    DRAW_TRI   21,  10,   5 ; poly=18 part=1
    DRAW_TRI   17,  14,  20 ; poly=19 part=1
    DRAW_TRI   20,  23,  17 ; poly=20 part=1
    DRAW_TRI   13,   2,   7 ; poly=21 part=1
    DRAW_TRI    7,  18,  13 ; poly=22 part=1
    DRAW_TRI    0,   3,   9 ; poly=23 part=1
    DRAW_TRI    9,   6,   0 ; poly=24 part=1
    DRAW_TRI_END
    BGL_END
    BGL_RETURN

Here's what I altered:

Code:
_40m_Cube_Test_top label BGLCODE
    BGL_BEGIN 0800h ; version = 8.00
    TEXTURE_LIST_BEGIN
    TEXTURE_DEF TEXTURE_AIRCRAFT    , <255,255,255,255>, 28.284271, "MYTEXTURE.BMP"	; 0
    TEXTURE_DEF TEXTURE_AIRCRAFT    , <255,255,255,255>, 28.354981, "MYTEXTURE_L.BMP"	; 1
    TEXTURE_LIST_END

    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
    [COLOR="Red"]MATERIAL_DEF 1.000000,1.000000,1.000000,1.000000,  0.392157,0.392157,0.392157,  0.000000,0.000000,0.000000,  1.000000,1.000000,1.000000,  0.000000 ; 1[/COLOR]
    MATERIAL_LIST_END

    VERTEX_LIST_BEGIN ....

; NonAlpha
_40m_Cube_Test_NonAlpha label BGLCODE
    BGL_FTAG "MasterScale", 0.00               ; Node 1 
    MATERIAL 0,0 ; <255,255,255,255> MYTEXTURE.BMP;;;
    DRAW_TRI_BEGIN 0, 24
    DRAW_TRI   17,  14,  20 ; poly=7 part=1
    DRAW_TRI   12,  15,   4 ; poly=2 part=1
    DRAW_TRI   11,  22,  19 ; poly=3 part=1
    DRAW_TRI   19,   8,  11 ; poly=4 part=1
    DRAW_TRI    5,  16,  21 ; poly=5 part=1
    DRAW_TRI   21,  10,   5 ; poly=6 part=1
    DRAW_TRI    4,   1,  12 ; poly=1 part=1
    DRAW_TRI   20,  23,  17 ; poly=8 part=1
    DRAW_TRI   13,   2,   7 ; poly=9 part=1
    DRAW_TRI    7,  18,  13 ; poly=10 part=1
    DRAW_TRI    0,   3,   9 ; poly=11 part=1
    DRAW_TRI    9,   6,   0 ; poly=12 part=1
    DRAW_TRI_END
    [COLOR="Red"]MATERIAL 1,1[/COLOR] ; <255,255,255,255> MYTEXTURE_L.BMP;;;
    DRAW_TRI_BEGIN 24, 24
    DRAW_TRI    4,   1,  12 ; poly=13 part=1
    DRAW_TRI   12,  15,   4 ; poly=14 part=1
    DRAW_TRI   11,  22,  19 ; poly=15 part=1
    DRAW_TRI   19,   8,  11 ; poly=16 part=1
    DRAW_TRI    5,  16,  21 ; poly=17 part=1
    DRAW_TRI   21,  10,   5 ; poly=18 part=1
    DRAW_TRI   17,  14,  20 ; poly=19 part=1
    DRAW_TRI   20,  23,  17 ; poly=20 part=1
    DRAW_TRI   13,   2,   7 ; poly=21 part=1
    DRAW_TRI    7,  18,  13 ; poly=22 part=1
    DRAW_TRI    0,   3,   9 ; poly=23 part=1
    DRAW_TRI    9,   6,   0 ; poly=24 part=1
    DRAW_TRI_END
    BGL_END
    BGL_RETURN

I added a new material that uses the emissive RGB values, and I used it on the larger box. Because of the alpha transparency, just the 'light' areas show at night.

dayww.png


nightx.png


I made the GSL library like this:

Code:
; Damaged Object Library Template in ASM

; =================================================================

; This is the file header... use this 'as is'  It sets useable file bounds

library_header label word

    dw  0001
    dd   000A00000h		; North Bound
    dd   0FF600000h		; South Bound
    dd   000000000h		; East Bound
    dd   0FFFFFFFFh		; West Bound
    dw  22 dup(0)
    dd  library_data - library_header
    dw  10 dup(0)
    dd  02C1D3FF9h
    dd  04259FA73h
    dd  02C1D3FF9h
    dd  04259FA73h
    dw  13 dup(0)

; =================================================================
; =================================================================

; This is the start of the BGL data... use it 'as is'

library_data label word

; =================================================================

; Library List: add pointers to the Library here,
; and the offset to the end of the object following each pointer


rel_base = $

    LIBRARY_OBJECT_PTR   library_0000_start, 02C1D3FF9h, 04259FA73h, 04B77FAA3h, 0D3FB5C50h

        dd  (offset library_0000_end)

; add additional LIBRARY_OBJECT_PTRs and end offsets to the list here

; =================================================================

; First object I name the labels for the start and end of the object
;  as 'library_0000_start' and 'library_0000_end'

library_0000_start     label word

;  BGL_LIBRARY_OBJECT      G, U, I, D, 0, radius, scale, 0, 0, library-end-label, 'name'

; note how the scale is valued: 010000h is equal to 65536t and is 1.0 scaling
;                               020000h is equal to 131072t and is 0.5 scaling

   BGL_LIBRARY_OBJECT    02C1D3FF9h, 04259FA73h, 04B77FAA3h, 0D3FB5C50h, 0, 20, 020000h, 0, 0, library_0000_end, 'MyCube_GSL'

; =================================================================

; Possible to add crash code here???  problematic as they would need unique names.

; =================================================================

; IFMSK is the code to determine the destruction of the object, 
; and if NOT true, it will 'fail' to the Undamaged model
; note the unique name I use for different models. 
; In this case ‘library_0000_’ 

       IFMSK     library_0000_object_Undamaged_model,     24h, 40h
[COLOR="Red"]
; the *_0.asm files are straight from Gmax... 
; no fooling with the *_0.asm code needed[/COLOR]

        library_0000_object_Damaged_model      label  word
           include MyCube_D_0.asm

        library_0000_object_Undamaged_model      label  word
              include 40m_Cube_Test_0.asm



EOF
    
library_0000_end      label  word

; =================================================================

; add additional Dynamic library objects here 
; ( named as ‘library_0001_’, ‘library_0002_’, etc…

; =================================================================



This way, the actual object and the damaged object are just the *_0.asm files from gmax.

It might be possible to use a conditional branch to detect tod (time of day), and use separate objects for day and night... each with their own materials. I'll play with that later... the problem right now is that the emissive shows during the day.

Dick
 
Messages
80
Country
unitedkingdom
Hi rhumbaflappy,
I am glad you have found some interest in this thread, What I am trying to do is make lowpoly gsl fires. I made a searchlight for gsl scenery using bright_texture, I then tried to give a texture map bright_ and could not get it to work so I edited the asm as in my thread above and it worked.

A thread at SOH.

http://www.sim-outhouse.com/sohforums/showthread.php?67657-low-poly-object-for-night-bombing

What I am looking into is to make fx_3 texture show up at night, I changed the texture to look like flames so after bombing at night the ground craters look like bright fires.

I am wondering if there is a model for the damage ground that bombs use in cfs2.that you know of or is it all the info in the fx file.

I realy do not understand all the code jargon, most of my work is trial and error.

RJ
 
Last edited:
Top