Jump to content
Sign in to follow this  
arno

Alternate TextureSets, LandClass, and Autogen

Recommended Posts

Hi Arno!We lost our earlier posts.Your team is using alternate texturesets with alternate autogen ( most probably in a local folder structure )... You wanted to know if you could access these textures and autogen with VTP polys using the landclass number.No. But there is a work-around. If your polys are not too extensive, you can copy the correct texture and autogen and rename as a CUSTOM name set. Then vertically flip and remip ( as DXT1 ) the textures ( to accomidate that terrain engine bug ). The autogen do not need to be flipped. If the polys extend more than a single groundtile, as they probably will, just randomly mix the textureset like MS does, and give them the proper CUSTOM names.As far as the VTP texture name? "252" for CUSTOM with seasons.I believe the textures and autogen will need to be in the "worldtexture" folder with the default autogen and textures. The VTPLayer could be 4-7, and the LWM masking will still work right.Dick

Share this post


Link to post
Share on other sites

Hi Dick,Just wanted to do a repost of it :).The polygons are over the entire country and I think we are talkng about 10 different textures or so. I'll give your suggestions a try.Here is also a repost of the landclass variations I posted on the old new forum :).http://home.wanadoo.nl/arno.gerretsen/pics/lcvar.jpgArno


Member Netherlands 2000 Scenery Team[a href=http://home.wanadoo.nl/arno.gerretsen]http://home.wanadoo.nl/arno.gerretsen/banner.jpg[/a]

Arno

If the world should blow itself up, the last audible voice would be that of an expert saying it can't be done.

FSDeveloper.com | Former Microsoft FS MVP | Blog

Share this post


Link to post
Share on other sites

Hi Arno.With a complete textureset, and many LOD13 Areas... each requiring a CUSTOM name... that could be a huge amount of textures.Dick

Share this post


Link to post
Share on other sites

Yes, I thought about it while sitting in the train to Brussels last evening. I'll have to find another solution I think, but it seems hard to do :(.Arno


Member Netherlands 2000 Scenery Team[a href=http://home.wanadoo.nl/arno.gerretsen]http://home.wanadoo.nl/arno.gerretsen/banner.jpg[/a]

Arno

If the world should blow itself up, the last audible voice would be that of an expert saying it can't be done.

FSDeveloper.com | Former Microsoft FS MVP | Blog

Share this post


Link to post
Share on other sites
Guest christian

Sorry for stepping in here although I have no clue what you are talking about exactly...Are you trying to use LOD13 squares to do land class sceneries? I think that could work... Do you really need lots of textures? You need the same amount like the default ones, don't you. As I remember using VTP you can just call the land class numbers, so if you'd replace the original textures that might work. Just a side thought, couldn't you just use LOD13 polygons when ever you actually need more detail, otherwise stick to the default LOD5 (eg use farm land as a LOD5 base and pop a LOD13 village over the top when you need it). That way you couldn't call landclasses anymore though, you'd have to refer to actual texture names.What a nightmare mixing those LOD13 textures together though. I suppose they won't have much detail (ie they must be very small) and they still have to tile...Cheers, Christian

Share this post


Link to post
Share on other sites

Thanks for the input, but that was not really the problem :D.I'll explain it in a bit more detail, maybe that also can result in some input from other people.In our scenery we use a LandClass scenery to place the basic ground textures (different kinds of fields basically). This works fine, we use our own texture with our own autogen for this.On top of that we use LWM to display the lakes and rivers and VTP for the town, villages, forests, etc (everything else basically). But untill know we didn't succeed in getting autogen to display on them.When we use the MS default forest for example (0027) we do get autogen, so this made me think if I call one of our own landclass textures I should be able to get autogen also. But I can only get the MS texture, even if I made an own version of the number. So it seems that VTP polygons use the landclass texture from the main texture folder and not from the texture folder that belongs to the scenery folder.So this is the problem we are trying to solve. How to get your own texture with autogen on a VTP?Dick suggested to use a CUSTOM texture, but because the polygons are over the entire country (although the Netherlands are small, it will still result in a huge amount of textures) this is not a good solution.Arno


Member Netherlands 2000 Scenery Team[a href=http://home.wanadoo.nl/arno.gerretsen]http://home.wanadoo.nl/arno.gerretsen/banner.jpg[/a]

Arno

If the world should blow itself up, the last audible voice would be that of an expert saying it can't be done.

FSDeveloper.com | Former Microsoft FS MVP | Blog

Share this post


Link to post
Share on other sites

Hi Arno.I think the problem gets even more complicated.I can get the replacement autogen, but with the default texture.I tried to place just a tiny texture to display each autogen individually....seems possible, but incredibly complicated.include TDFMacros.incinclude TDFHeaders.inc; Delavan Santa; N42* 38.13' W88* 37.33'BGLHeader 44, 41, -87, -90, TerrainHeaderStart, VTPHeaderVTPHeader label word VTPFileHeader 256, VTPIndexStart, TextureStart, VTPEndVTPStart label word; ---------------------------------------------------------------------------------------------------------; Cell_194_134datamark_0 label word VTPDataArea 1, 0, 28, 23 VTPLayer 4, 0 VTPNumTexturesInLayer 1, 0 VTPTextureId 0, 0 VTPPolyCount 1, 0 VTPPolyMethod1 6, 0, 1 VTPPointXYUV 122, 155, 122, ( 255 - 155 ) VTPPointXYUV 170, 12, 170, ( 255 - 12 ) VTPPointXYUV 252, 25, 252, ( 255 - 25 ) VTPPointXYUV 252, 115, 252, ( 255 - 115 ) VTPPointXYUV 202, 182, 202, ( 255 - 182 ) VTPPointXYUV 122, 155, 122, ( 255 - 155 ) VTPDataArea 1, 1, 28, 23 VTPLayer 4, 0 VTPNumTexturesInLayer 1, 0 VTPTextureId 1, 0 VTPPolyCount 1, 0 VTPPolyMethod2 4, 0, 0 VTPPointXY2 11456, 10057 VTPPointXY2 11461, 10057 VTPPointXY2 11461, 10062 VTPPointXY2 11456, 10062datamark_1 label word; ---------------------------------------------------------------------------------------------------------Cell_194_134 EQU VTPCellID 0, 194, 134 VTPIndexStart label word VTPIndexHeader 1, VTPIndexData, VTPStart VTPIndexData label word VTPIndexEntry Cell_194_134, VTPStart, datamark_0, datamark_1; ---------------------------------------------------------------------------------------------------------TextureStart label word VTPTextureListHeader 2, TextureIndexStart, TextureDataStart,TextureDataEndTextureIndexStart label word VTPTextureListEntry TextureDataStart, texturemark_0, texturemark_1 VTPTextureListEntry TextureDataStart, texturemark_1, texturemark_2TextureDataStart label word texturemark_0 label word VTPTextureName "001b2wi1.bmp;001b2hw1.bmp;001b2sp1.bmp;001b2su1.bmp;001b2fa1.bmp;001b2lm1.bmp" VTPTextureType 1, 0, 0, 4 texturemark_1 label word VTPTextureName "122" VTPTextureType 1, 0, 0, 4 texturemark_2 label wordTextureDataEnd label word; ---------------------------------------------------------------------------------------------------------VTPEnd label wordHere I make a VTPm1 poly from the name of a texture, rather than the LC number, and I flip it vertically, so it displayes properly. Then I place a tiny LC numbered poly, that has some autogen.As I said, very complicated.You can placed named ( not LC numbered ) textures. After that, it may be actually easier to place simple objects... but then the effect on framerates may be a problem.Dick

Share this post


Link to post
Share on other sites

Hi Arno.My previous post showed the convolutions needed to place the autogen.Have you considered placing simple building objects?With BGLPlacer, I made this simple code:BUILDING,,N 26* 0.00',E 26* 0.00',AGL,0.00,0.00,0.00,Very Sparse,"SIZE_X=20;SIZE_Z=40;BOT_SIZE_Y=4;BOT_TEX=8;BOT_TEX_X=256;BOT_TEX_Z=256;WIN_SIZE_Y=2;WIN_TEX=4;WIN_TEX_X=256;WIN_TEX_Y=256;WIN_TEX_Z=256;TOP_SIZE_Y=4;TOP_TEX=9;TOP_TEX_X=256;TOP_TEX_Z=256;ROOF_SIZE_Y=0;ROOF_TEX=9;ROOF_TEX_X=256;ROOF_TEX_Y=256;ROOF_TEX_Z=256"BUILDING,,N 26* 0.00',E 26* 0.02',AGL,0.00,0.00,0.00,Very Sparse,"SIZE_X=20;SIZE_Z=40;BOT_SIZE_Y=4;BOT_TEX=8;BOT_TEX_X=256;BOT_TEX_Z=256;WIN_SIZE_Y=2;WIN_TEX=4;WIN_TEX_X=256;WIN_TEX_Y=256;WIN_TEX_Z=256;TOP_SIZE_Y=4;TOP_TEX=9;TOP_TEX_X=256;TOP_TEX_Z=256;ROOF_SIZE_Y=0;ROOF_TEX=9;ROOF_TEX_X=256;ROOF_TEX_Y=256;ROOF_TEX_Z=256"In SCASM, It can look like this:Header( 1 N26:00:00.00 N26:00:00.00 E026:00:03.60 E026:00:02.40 )LatRange( N26:00:00.00 N26:00:00.00 )Area( A N26:00:00.00 E026:00:02.40 100 ) PerspectiveCall( :L00001D ) Jump( : ):L00001D RefPoint( rel :L000067 1.00 N26:00:00.00 E026:00:02.40 V1= 0 V2= 40 ) AdvBldg( normal 20 40 LEVEL1 8 4 256 256 LEVEL2 4 2 256 256 256 LEVEL3 9 4 256 256 ROOF 9 256 256 ):L000067 ReturnEndAArea( A N26:00:00.00 E026:00:03.60 100 ) PerspectiveCall( :L00007C ) Jump( : ):L00007C RefPoint( rel :L0000C6 1.00 N26:00:00.00 E026:00:03.60 V1= 0 V2= 40 ) AdvBldg( normal 20 40 LEVEL1 8 4 256 256 LEVEL2 4 2 256 256 256 LEVEL3 9 4 256 256 ROOF 9 256 256 ):L0000C6 ReturnEndAI've never played with these types of buildings, but the above code automatically displays shadows, and contains crash detection... so I'm assuming that MS has "hardcoded" much of the routine, and I think it mmight use floating point routines.At any rate, these would be easier to place, than to fool with the autogen as I outlined earlier. A program could be written to place preset definitions of simple buildings from a list, with an FSUIPC interface... slew, rotate, and click to place a building, and output as a CSV file? Just an idea... I know you are writing about 1000's of objects.Dick

Share this post


Link to post
Share on other sites

Hi Dick,Thanks for the ideas :).And about placing object ourself, yes we thought about that before. But I think autogen is better. Autogen seems better on the frames and also the user can set the density of it (we could do the same with the scenery complexity, but that also effects other buildings). Besides that I don't like the idea of having to place 10000+ objects :). In our previous version the scenery consisted of circa 55000 objects. Part of this are macros of course, but also a resonable part are polygons for towns and forests. Maybe we could automatically place the objects with our tool, but I am afraid of the framerate hit in that case. Might be worth a little test.The FSUIPC placement method we already have built into our scenery tool. You can go to a position in FS and then place something on that spot. We use it to place the macros, but we could also use it to draw polygons if we want.Arno


Member Netherlands 2000 Scenery Team[a href=http://home.wanadoo.nl/arno.gerretsen]http://home.wanadoo.nl/arno.gerretsen/banner.jpg[/a]

Arno

If the world should blow itself up, the last audible voice would be that of an expert saying it can't be done.

FSDeveloper.com | Former Microsoft FS MVP | Blog

Share this post


Link to post
Share on other sites
Guest christian

About your automatic placement:I think the framerate hit will come from the culling. I think the autogen scenery is tied to the CLOD scheme, so FS2002 will cull whole chunks of 3D objects. If you were to place all the 3D objects individually, you'd do the culling computation for each object which of course will eat quite a few framerates.Here's an idea:Use all 3D objects as libraries (to be as memeory efficient as the autogen scenery). Place the 3D objects randomly. It should be easy to write a quick routine to do that (I've done that for a work project). Then group the individual objects into CLOD squares (eg LOD10 or so). This way I would assume, FS2002 will do culling for your LOD10 size squares and your objects will pop in and out of the view (depending on distance) just like autogen. I think this way you should get similar memeory usage and framerates to the autogen scenery...Cheers, Christian

Share this post


Link to post
Share on other sites
Guest christian

Just another thought...I think autogen is also tied to framerates, ie if framerates drop below a value then FS2002 won't draw the autogen. I'm not sure, but is the framerate in one of the variables we can access? If yes you could just insert an IF statement into the BGL to tie your autogen to framerates...Christian

Share this post


Link to post
Share on other sites

That would be great if we could access the framerate, but I think it can't be done. I have never seen that variable in a SDK (Fs98, Fs2000 or Fs2002).And about the object placement, I'll think about it. But I am first going to see if I can find a way to get the autogen working. Otherwise we need to build in such a random object thing in our design program. Probably if you put all the object for a certain LOD in one Area block (one RefPoint might be difficult due to altitude problems) it might not be such a big framehit. Would be an interesting test at least :).Arno


Member Netherlands 2000 Scenery Team[a href=http://home.wanadoo.nl/arno.gerretsen]http://home.wanadoo.nl/arno.gerretsen/banner.jpg[/a]

Arno

If the world should blow itself up, the last audible voice would be that of an expert saying it can't be done.

FSDeveloper.com | Former Microsoft FS MVP | Blog

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