SdC Redux (New techniques example)

leroy10

Members +
Below are some screenies demonstarting VTP2 polys in CFS2 and My soon to be released RAAF Base Fanning.


source code:


;----------------------------------------
; ----------------------------------------
; Fanning.bgl disassembled by BGLAnalyze (c) on Fri Jan 22 20:29:01 2010

; ----------------------------------------

; ----------------------------------------
; This file contains terrain data of textured polygon type
; ----------------------------------------
; Since there are no instructions in SCASM to assemble
; such data, the following code can only be assembled
; with the BGLC assembler.
; You will need the following files to do that:
; TDFHeaders.inc
; TDFMacros.inc
; by Richard Ludowise
; ----------------------------------------
include TDFMacros.inc
include TDFHeaders.inc
; ----------------------------------------
BGLHeader -20, -20, 147, 147, TerrainHeaderStart, VTPHeader

VTPHeader label word
VTPFileHeader 100h, VTPIndexStart, TextureStart, VTPEnd

VTPDataStart label Word
BeginData0 label word
VTPDataArea 1, 0, 18, 20
VTPLayer 4, 0
VTPNumTexturesInLayer 1, 0
VTPTextureId 0, 0
VTPPolyCount 1, 0
VTPPolyMethod1 4, 1, 1
VTPPointXYUV 255, 1, 255, 255
) VTPPointXYUV 1, 1, 0, 255
) VTPPointXYUV 255, 255, 255, 0
) VTPPointXYUV 1, 255, 0, 0
)VTPDataArea 1, 0, 18, 21
VTPLayer 4, 0
VTPNumTexturesInLayer 1, 0
VTPTextureId 1, 0
VTPPolyCount 1, 0
VTPPolyMethod1 4, 1, 1
VTPPointXYUV 255, 1, 255, 255
) VTPPointXYUV 1, 1, 0, 255
) VTPPointXYUV 255, 255, 255, 0
) VTPPointXYUV 1, 255, 0, 0
)VTPDataArea 1, 0, 19, 20
VTPLayer 4, 0
VTPNumTexturesInLayer 1, 0
VTPTextureId 2, 0
VTPPolyCount 1, 0
VTPPolyMethod1 4, 1, 1
VTPPointXYUV 255, 1, 255, 255
) VTPPointXYUV 1, 1, 0, 255
) VTPPointXYUV 255, 255, 255, 0
) VTPPointXYUV 1, 255, 0, 0
)VTPDataArea 1, 0, 19, 21
VTPLayer 4, 0
VTPNumTexturesInLayer 1, 0
VTPTextureId 3, 0
VTPPolyCount 1, 0
VTPPolyMethod1 4, 1, 1
VTPPointXYUV 255, 1, 255, 255
) VTPPointXYUV 1, 1, 0, 255
) VTPPointXYUV 255, 255, 255, 0
) VTPPointXYUV 1, 255, 0, 0
)EndData0 label word

VTPIndexStart label word
VTPIndexHeader 1, VTPIndexData, VTPDataStart

VTPIndexData label word
Cell_696_312 EQU VTPCellID 0, 696, 312
VTPIndexEntry Cell_696_312, VTPDataStart, BeginData0, EndData0
TextureStart label word

VTPTextureListHeader 4, TextureIndexStart, TextureDataStart, TextureDataEnd
TextureIndexStart label word
VTPTextureListEntry TextureDataStart, BeginTexture0, EndTexture0
VTPTextureListEntry TextureDataStart, BeginTexture1, EndTexture1
VTPTextureListEntry TextureDataStart, BeginTexture2, EndTexture2
VTPTextureListEntry TextureDataStart, BeginTexture3, EndTexture3

TextureDataStart label word
BeginTexture0 label word
VTPTextureName "MR_Fanning_1.bmp"
VTPTextureType 13, 0, 2, 82
; Reserved not 0 in VTPTxtureType, position 135
EndTexture0 label word
BeginTexture1 label word
VTPTextureName "MR_Fanning_3.bmp"
VTPTextureType 13, 0, 2, 82
; Reserved not 0 in VTPTxtureType, position 146
EndTexture1 label word
BeginTexture2 label word
VTPTextureName "MR_Fanning_2.bmp"
VTPTextureType 13, 0, 2, 82
; Reserved not 0 in VTPTxtureType, position 157
EndTexture2 label word
BeginTexture3 label word
VTPTextureName "MR_Fanning_4.bmp"
VTPTextureType 1, 1, 0, 0
BYTE "C"
BYTE 0 EndTexture3 label word
TextureDataEnd label word

VTPEnd label word
;-------------------------------------------------
 
here's another source code example, probably a better one.


; ----------------------------------------
; Bowen.bgl disassembled by BGLAnalyze (c) on Fri Jan 15 00:52:25 2010

; ----------------------------------------

; ----------------------------------------
; This file contains terrain data of textured polygon type
; ----------------------------------------
; Since there are no instructions in SCASM to assemble
; such data, the following code can only be assembled
; with the BGLC assembler.
; You will need the following files to do that:
; TDFHeaders.inc
; TDFMacros.inc
; by Richard Ludowise
; ----------------------------------------
include TDFMacros.inc
include TDFHeaders.inc
; ----------------------------------------
BGLHeader -15, -15, 145, 145, TerrainHeaderStart, VTPHeader

VTPHeader label word
VTPFileHeader 100h, VTPIndexStart, TextureStart, VTPEnd

VTPDataStart label Word
BeginData0 label word
VTPDataArea 1, 1, 5, 30
VTPLayer 4, 0
VTPNumTexturesInLayer 1, 0
VTPTextureId 2, 0
VTPPolyCount 1, 0
VTPPolyMethod2 4, 0, 3
; Reserved bits not 0 in VTPPolyMethod2, position ac
VTPPointXY2 511, 65535
VTPPointXY2 257, 65280
VTPPointXY2 65535, 255
VTPPointXY2 65281, 0
VTPDataArea 1, 1, 6, 30
VTPLayer 4, 0
VTPNumTexturesInLayer 1, 0
VTPTextureId 3, 0
VTPPolyCount 1, 0
VTPPolyMethod2 4, 0, 3
; Reserved bits not 0 in VTPPolyMethod2, position c3
VTPPointXY2 511, 65535
VTPPointXY2 257, 65280
VTPPointXY2 65535, 255
VTPPointXY2 65281, 0
VTPDataArea 1, 1, 6, 31
VTPLayer 4, 0
VTPNumTexturesInLayer 1, 0
VTPTextureId 4, 0
VTPPolyCount 1, 0
VTPPolyMethod2 4, 0, 3
; Reserved bits not 0 in VTPPolyMethod2, position da
VTPPointXY2 511, 65535
VTPPointXY2 257, 65280
VTPPointXY2 65535, 255
VTPPointXY2 65281, 0
VTPDataArea 1, 1, 5, 31
VTPLayer 4, 0
VTPNumTexturesInLayer 1, 0
VTPTextureId 5, 0
VTPPolyCount 1, 0
VTPPolyMethod2 4, 0, 3
; Reserved bits not 0 in VTPPolyMethod2, position f1
VTPPointXY2 511, 65535
VTPPointXY2 257, 65280
VTPPointXY2 65535, 255
VTPPointXY2 65281, 0
EndData0 label word
BeginData1 label word
VTPDataArea 1, 1, 5, 0
VTPLayer 4, 0
VTPNumTexturesInLayer 1, 0
VTPTextureId 0, 0
VTPPolyCount 1, 0
VTPPolyMethod2 4, 0, 3
; Reserved bits not 0 in VTPPolyMethod2, position 7e
VTPPointXY2 511, 65535
VTPPointXY2 257, 65280
VTPPointXY2 65535, 255
VTPPointXY2 65281, 0
VTPDataArea 1, 1, 6, 0
VTPLayer 4, 0
VTPNumTexturesInLayer 1, 0
VTPTextureId 1, 0
VTPPolyCount 1, 0
VTPPolyMethod2 4, 0, 3
; Reserved bits not 0 in VTPPolyMethod2, position 95
VTPPointXY2 511, 65535
VTPPointXY2 257, 65280
VTPPointXY2 65535, 255
VTPPointXY2 65281, 0
EndData1 label word

VTPIndexStart label word
VTPIndexHeader 2, VTPIndexData, VTPDataStart

VTPIndexData label word
Cell_700_312 EQU VTPCellID 0, 700, 312
VTPIndexEntry Cell_700_312, VTPDataStart, BeginData0, EndData0
Cell_700_313 EQU VTPCellID 0, 700, 313
VTPIndexEntry Cell_700_313, VTPDataStart, BeginData1, EndData1
TextureStart label word

VTPTextureListHeader 6, TextureIndexStart, TextureDataStart, TextureDataEnd
TextureIndexStart label word
VTPTextureListEntry TextureDataStart, BeginTexture0, EndTexture0
VTPTextureListEntry TextureDataStart, BeginTexture1, EndTexture1
VTPTextureListEntry TextureDataStart, BeginTexture2, EndTexture2
VTPTextureListEntry TextureDataStart, BeginTexture3, EndTexture3
VTPTextureListEntry TextureDataStart, BeginTexture4, EndTexture4
VTPTextureListEntry TextureDataStart, BeginTexture5, EndTexture5

TextureDataStart label word
BeginTexture0 label word
VTPTextureName "MR_Bowen_1.bmp"
VTPTextureType 13, 0, 2, 82
; Reserved not 0 in VTPTxtureType, position 17d
EndTexture0 label word
BeginTexture1 label word
VTPTextureName "MR_Bowen_6.bmp"
VTPTextureType 13, 0, 2, 82
; Reserved not 0 in VTPTxtureType, position 18c
EndTexture1 label word
BeginTexture2 label word
VTPTextureName "MR_Bowen_5.bmp"
VTPTextureType 13, 0, 2, 82
; Reserved not 0 in VTPTxtureType, position 19b
EndTexture2 label word
BeginTexture3 label word
VTPTextureName "MR_Bowen_4.bmp"
VTPTextureType 13, 0, 2, 82
; Reserved not 0 in VTPTxtureType, position 1aa
EndTexture3 label word
BeginTexture4 label word
VTPTextureName "MR_Bowen_3.bmp"
VTPTextureType 13, 0, 2, 82
; Reserved not 0 in VTPTxtureType, position 1b9
EndTexture4 label word
BeginTexture5 label word
VTPTextureName "MR_Bowen_2.bmp"
VTPTextureType 1, 1, 0, 0
BYTE "O"
BYTE 0 EndTexture5 label word
TextureDataEnd label word

VTPEnd label word
;-----------------------------------------
;-----------------------------------------


Cheers :ernae:
Lindsay
 
VTPPolyMethod1 4, 1, 1

-----

Ah, VTP1.... sorry to be the one to :pop4: your balloon... Still, if it works, it works! :icon29::icon29::icon29:


Hmmm the reset of the code does look a bit VTP2'ish, I'll look into it when I get home
 
Looks great Lindsay :applause:

can you add other data to the source prior to compiling - such as the runway ? or is it preferred to compile it into a separate .bgl ?

Silly question - :isadizzy: - I take it the scenery objects are .gsl ?

Keep up the great work :salute:

Pete
 
Here's the second example decompiled using LWMVeiwer


;Created by LWMViewer at 01/23/10 10:48:03
; Original filename : C:\Program Files\Microsoft Games\Combat Flight Simulator 2\SCENEDB\world\scenery\Bowen.bgl
; Original boundary :
; N -15.43314
; S -15.43322
; E 145.16633
; W 145.16633
;
; Please note that only LWMs and VTPs are disassembled. Any other
; information in the original file is not here.

include TDFHeaders.inc
include TDFMacros.inc

_UseWidth_ EQU 1
_IsLine_ EQU 1
_IsFan_ EQU 0
_IsStrip_ EQU 1
_Method1_ EQU 0
_Method2_ EQU 1

BGLHeader -15,-16,146,145, TerrainHeaderStart, VTPHeader
VTPHeader label word
VTPFileHeader 256, VTPIndexStart, VTPTexStart, VTPEnd

VTPTexStart label word

VTPTextureListHeader 6,VTPTexListStart, VTPTexNameStart, VTPTexNameEnd

VTPTexListStart label word
VTPTextureListEntry VTPTexNameStart, VTPTexName0, VTPTexName1
VTPTextureListEntry VTPTexNameStart, VTPTexName1, VTPTexName2
VTPTextureListEntry VTPTexNameStart, VTPTexName2, VTPTexName3
VTPTextureListEntry VTPTexNameStart, VTPTexName3, VTPTexName4
VTPTextureListEntry VTPTexNameStart, VTPTexName4, VTPTexName5
VTPTextureListEntry VTPTexNameStart, VTPTexName5, VTPTexName6
VTPTexNameStart label word
VTPTexName0 label word
VTPTextureName "MR_Bowen_1.bmp"
VTPTexName1 label word
VTPTextureName "MR_Bowen_6.bmp"
VTPTexName2 label word
VTPTextureName "MR_Bowen_5.bmp"
VTPTexName3 label word
VTPTextureName "MR_Bowen_4.bmp"
VTPTexName4 label word
VTPTextureName "MR_Bowen_3.bmp"
VTPTexName5 label word
VTPTextureName "MR_Bowen_2.bmp"
VTPTexName6 label word
VTPTexNameEnd label word

VTPDataStart label word

; Start of cell 700 x 312 data
CELLSTART_000000 label word
CellID_000000 EQU VTPCellID 0, 700, 312
VTPDataArea 1, _Method2_, 5, 30
VTPLayer 4, 0
VTPNumTexturesInLayer 1, 0
VTPTextureId 2, 0
VTPPolyCount 1, 0

VTPPolyMethod1 4, _IsStrip_, 1
VTPPointXYUV 255, 1, 255, 255
VTPPointXYUV 1, 1, 0, 255
VTPPointXYUV 255, 255, 255, 0
VTPPointXYUV 1, 255, 0, 0
VTPDataArea 1, _Method2_, 6, 30
VTPLayer 4, 0
VTPNumTexturesInLayer 1, 0
VTPTextureId 3, 0
VTPPolyCount 1, 0

VTPPolyMethod1 4, _IsStrip_, 1
VTPPointXYUV 255, 1, 255, 255
VTPPointXYUV 1, 1, 0, 255
VTPPointXYUV 255, 255, 255, 0
VTPPointXYUV 1, 255, 0, 0
VTPDataArea 1, _Method2_, 6, 31
VTPLayer 4, 0
VTPNumTexturesInLayer 1, 0
VTPTextureId 4, 0
VTPPolyCount 1, 0

VTPPolyMethod1 4, _IsStrip_, 1
VTPPointXYUV 255, 1, 255, 255
VTPPointXYUV 1, 1, 0, 255
VTPPointXYUV 255, 255, 255, 0
VTPPointXYUV 1, 255, 0, 0
VTPDataArea 1, _Method2_, 5, 31
VTPLayer 4, 0
VTPNumTexturesInLayer 1, 0
VTPTextureId 5, 0
VTPPolyCount 1, 0

VTPPolyMethod1 4, _IsStrip_, 1
VTPPointXYUV 255, 1, 255, 255
VTPPointXYUV 1, 1, 0, 255
VTPPointXYUV 255, 255, 255, 0
VTPPointXYUV 1, 255, 0, 0
CELLEND_000000 label word
; End of cell 700 x 312 data

; Start of cell 700 x 313 data
CELLSTART_000001 label word
CellID_000001 EQU VTPCellID 0, 700, 313
VTPDataArea 1, _Method2_, 5, 0
VTPLayer 4, 0
VTPNumTexturesInLayer 1, 0
VTPTextureId 0, 0
VTPPolyCount 1, 0

VTPPolyMethod1 4, _IsStrip_, 1
VTPPointXYUV 255, 1, 255, 255
VTPPointXYUV 1, 1, 0, 255
VTPPointXYUV 255, 255, 255, 0
VTPPointXYUV 1, 255, 0, 0
VTPDataArea 1, _Method2_, 6, 0
VTPLayer 4, 0
VTPNumTexturesInLayer 1, 0
VTPTextureId 1, 0
VTPPolyCount 1, 0

VTPPolyMethod1 4, _IsStrip_, 1
VTPPointXYUV 255, 1, 255, 255
VTPPointXYUV 1, 1, 0, 255
VTPPointXYUV 255, 255, 255, 0
VTPPointXYUV 1, 255, 0, 0
CELLEND_000001 label word
; End of cell 700 x 313 data

VTPIndexStart label word
VTPIndexHeader 2, VTPIndexData, VTPDataStart
VTPIndexData label word
VTPIndexEntry CellID_000000, VTPDataStart, CELLSTART_000000, CELLEND_000000
VTPIndexEntry CellID_000001, VTPDataStart, CELLSTART_000001, CELLEND_000001
VTPEnd label word

;-----------------------
;-------------------------


Cheers :ernae:
Lindsay
 
Hey Pete,

Long time no see buddy. How's everything your end? Hope all 's well..

All the objects in the scenery are GSL and the VTP bgl needs to be compiled seperately and placed in the SCENEDB\world\scenery folder.

Rhumba,

Strange you couldn't compile the source, I used BGLC that came with G2k v4.0 with no issues.

Cheers :ernae:
Lindsay
 
Hi All,

The benefit of using this new method, if together we can work it out, is that it allows us to add alpha channel blended textures in a similar method to how CFS2 adds landclass. Not only will it look better than previous methods used but it will also give better frame rates and be far more flexible.

You can add a lot more finer detail to base textures and if you think outside the box a little you could really do some neat stuff with it.

Cheers :ernae:
Lindsay
 
Geez I just put down PHP and now you the groundpounders are raising my ears again. Guess I will be redoing the airfields.

Now give me all the info you have on the new techniques.:icon_lol:
 
LOL Hey James!

How you going mate?

All the info we have for now is in the above second example. It's very much in the alpha stage at the moment but with Rhumba and SdC Redux looking into it aswell we should have something that coould go beta any day. Did I send you my Bowen scenery a few years back? If so you already have a working example.

Cheers :ernae:
Lindsay
 
Ok will check it out as I do have Bowen. Really interesting about the use of SBuilder... I used the older version to convert the CFS2 Oahu shores to FSX.

Looks like the ol Groundpounder forum is about to get more use. :applause:
 
Hi Lindsay.

The problem is/was BGLAnalyze cannot decompile VTP1 properly.

LWMViewer does, and the LWMViewer example does compile... but it is VTP1. I think your BGLs were always VTP1...just decompiled erroneously by BGLAnalyze.

Jim Keir spent a bit of time making sure VTP1 and LWM1 were included in his decompiler. ( And I spent some time twisting his arm about it ).

Dick
 
Hi Dick,

Yeah I hear you there. BGLAnalyze is a bit rough when it comes to decompiling BGLs. So we're still dealing with VTP1 then. Guess that's better then nothin. :jump:
Cheers :ernae:
Lindsay
 
Looks great Lindsay :applause:

can you add other data to the source prior to compiling - such as the runway ? or is it preferred to compile it into a separate .bgl ?
Always separate....

Silly question - :isadizzy: - I take it the scenery objects are .gsl ?

Keep up the great work :salute:

Pete
scenery objects themselves are BGL, they can be called on specific coordinates by the GSL (=destroyable; object must have .DP) or a BGL (=non-destroyable). Runways, NDB's etc. are always BGL
 
It would be very nice to get detailed ground/water/land textures, that is one of the big visual handicaps of CFS2 that I can see, it make the ground look naked no matter how it is painted and out of balance with the high detail of objects and planes and ships....
 
It would be very nice to get detailed ground/water/land textures, that is one of the big visual handicaps of CFS2 that I can see, it make the ground look naked no matter how it is painted and out of balance with the high detail of objects and planes and ships....
There is no way to change the pixels/meter ratio for ground textures so there is no room for improvement there. I don't think the textures themselves are that bad. I'm more bothered about the tiny "circle of visibility", and the lack of control we have of the colors of the tiles outside the circle.
 
Keep it up ! As soon as I have a little more time I will see what I can do with this new methode !

Very interesting !

Arndt
 
Back
Top