Jump to content
Sign in to follow this  
Guest osman

Ground2k4 excludes

Recommended Posts

Guest osman

Hi,maybe this has been discussed before, but I could not find a reference. If you look at the .asm files produced by Ground2k4 if you used the exclude tool, you will notice that code lines like VTPDataArea 4, 0, 3, 21together with Cellv_453_169 EQU VTPCellID 0, 453, 169do not conform to the rules in the MS SDK, which I quote: struct VTPDataArea { enum{ MaxLayerCount = 31 }; UINT16 wLayerCount:5; // The number of layers in this area up to 31 UINT16 wAutoCalc:1; // Must be set to 1 UINT16 wU:5; // Must be set to (VTPCellID::m_dwU | 0x1F) UINT16 wV:5; // Must be set to (VTPCellID::m_dwV | 0x1F)};because 453 (= 0x1c5) AND 0x1f would be 5 and 169 ( = 0xa9) AND 0x1f would be 9. If you look to a original FS file disassembled by LWMVieweryou will find that the 3rd and 4th parameter of the VPDataArea instruction follow the rule in the SDK (which, BTW, should read m_dwU & 0x1f and m_dwV & 0x1f in correct C notation).I have the impression that Ground2k4 uses instead of the correct parameters the ID# of the area, in which you applied the exclude command, but as far as I know the VPDataArea structure refers to the cell, not to the area, i.e. an exclusion will always work for a complete cell. Or am I wrong with this? It saves, of course, a lot of work if you can use the exclude feature this way, instead of defining excludes for every single area (32 x 32 for each cell!).

Share this post


Link to post
Share on other sites

Hi osman.Have a look at this thread:http://forums.avsim.net/dcboard.php?az=sho...14782&mode=fullHere's my definition of the data structure in BGLC ( from TDFMacros.inc ):

VTPDataArea	Macro	LayerCount, AutoCalc, ZoneX, ZoneY;	enum{ MaxLayerCount = 31 };;	WORD wLayerCount:5;	// The number of layers in this area up to 31;	WORD wAutoCalc:1;	// 0 = Method 1, 1 = Method 2;	WORD wZoneX:5;		// LOD8 position as 1/32nd of an LOD3 numbered 0-31 ( if VTP1, then LOD13 position as 1/32nd of LOD8 );	WORD wZoneY:5;		// LOD8 position as 1/32nd of an LOD3 numbered 0-31 ( if VTP1, then LOD13 position as 1/32nd of LOD8 )	WORD	( ZoneY * 800h ) + ( ZoneX * 40h ) + ( AutoCalc * 20h ) + LayerCountEndM

The Zone must be calculated correctly, or TMFViewer won't display it properly. Both Ground2K4 and LWMViewer code the Zone correctly. Zone is the LOD8 position within an LOD3.Dick

Share this post


Link to post
Share on other sites
Guest osman

Hi Dick,the bottom line is: the VTPDataArea instruction refers to a LOD8 cell, not to a LOD13 area, at least for FS2004, where there is no VTP1. If this data structure is used for an exclude by setting the number of textures in a layer to zero, this should work for the whole LOD8 cell. In contrast, the asm file produced by Ground2k4 has one VTPDataArea instruction for each LOD13 area for which an exclusion was defined. The same is true for DefArea20. So - what is correct??N.B.: in defining lines and polygons, Ground2k4 produces the code confirming to what you have written. It is only with the excludes that I find these inconsistencies.

Share this post


Link to post
Share on other sites
Guest osman

Hi Dick,a test done seems to reveal, that indeed the exclude feature (i.e. the setting of the number of textures to zero) does not work on the LOD8 cell level (I have no explanation for that), but it works if you generate one instruction for each LOD13 area ! Very strange.

Share this post


Link to post
Share on other sites

Hi osman.I think the key to the G2k4 VTP excludes is this:VTPDataArea 4, 0, 3, 21which forces the exclude to use the VTP Method1 ( not used in FS9 ), which does effect only the LOD13 Area. Even though we can't draw VTP1, we apparently can exclude with it.Dick

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Tom Allensworth,
    Founder of AVSIM Online


  • Flight Simulation's Premier Resource!

    AVSIM is a free service to the flight simulation community. AVSIM is staffed completely by volunteers and all funds donated to AVSIM go directly back to supporting the community. Your donation here helps to pay our bandwidth costs, emergency funding, and other general costs that crop up from time to time. Thank you for your support!

    Click here for more information and to see all donations year to date.
×
×
  • Create New...