Jump to content
Wrench

Converting SF/Wo* Terrains to SF2 Usage

Recommended Posts

As this question just came up again in the regular Forums, and I posted a response on "How To..", and I had actually planned to add this little tidbit anyway, now is a good time to do so..

 

A simple drag and drop to get the terrain into you Mods Folder and making sure the CatPointer line is correct is usualy it. Info on "Selecting the Proper Cat Pointer" © is coverd in the SF/Wo* KB, and just about EVERY readme for any terrain I've released; so consult the relevant document(s)

 

BUT....there have been changes in HOW the SF2 Engine handles all shaders, not just for aircraft, but more importantly, for Terrains.

And, yes, you'll may have clipping (water appearing THROUGH mountains, shimmering trees at times, etc) and other Visual Anomolies ™. This is basically because the terrain engine, for BOTH series needs a drastic overhaul, and the fact the we haven't gotten any kind of upgrade for the Terrain Editor since 2006 or so. But that's neither here nor there, as it relates to simply GETTING the terrain to work.

 

However, you'll need to make some changes in the terrain's data ini to take advantage of the new shader effects (for us cripples on XP or fully capable Vista/Win7 DX10ers); even so, on DX9 machines you must use the new terrain shader effect lines, or you'll not have ANY terrain effects (like moving water). Even if you extract and place the 0ld 08 Patch Level fx files into the terrain folder, they still won't/don't work. So, some edititing of the terrain's data ini is required.

 

It should be noted a this point, that not ALL 1stGen terrains have been upgraded to 08 standards (after all, I'm only ONE person!). So it may be necessary to ADD the BackgroundMaterial statement to the data ini in it's entirety --

 

[backgroundMaterial]

UseEffectShader=TRUE

EffectShaderName=FarTerrainEffect.fx

DepthBufferCheck=TRUE

DepthBufferWrite=TRUE

RenderedInOrder=FALSE

AlphaTestEnabled=FALSE

CullMode=CLOCKWISE

LightEnabled=TRUE

SpecularEnabled=FALSE

EmissiveEnabled=FALSE

FogEnabled=TRUE

AmbientColor=1.000000,1.000000,1.000000,1.000000

DiffuseColor=1.000000,1.000000,1.000000,1.0000000

ZBufferOffset=0.000000

BlendOp=ONE

NumTextureStages=1

TextureStage[01].TextureName=

TextureStage[01].MipMap=TRUE

TextureStage[01].FilterEnabled=TRUE

TextureStage[01].StageColorOp=TEXTURE_MODULATE_DIFFUSE

TextureStage[01].StageAlphaOp=NO_OP

 

It gets placed right after the WaterTextureMaterial statement. (you'll note, this is an 08 Level 1st Gen statement)

 

Another thing that should be mentioned, is depending simply on HOW old the 1stGen Terrain is, it may require rebuilding of ALL the sea and sea/land transition tiles with new AlphaChannels that at th least match 08 level tiles of the same type (as was done on my recent DBS Water Upgread Mod, and for a forthcoming terrain rebuild). Other changes would be in a new 'waternormal.bmp' that creates the sea-state (ie: the actual wave action itself as seen under and at the water's surface). Again, that's for another time...as the 'how to rebuild' sea, and sea/land transitons has been covered in the SF/Wo* KB)

 

Ok, lets update that data ini ... for our examples, I'm using the aformentioned DBS water fixit.

 

In the main terrain ini, all 08 and SF2s have a statement for weather, below the PlanningMap statement:

 

[WeatherChance]

ScatteredChance=35

BrokenChance=25

OvercastChance=20

InclementChance=10

 

If it's not already there, you'll have to add it. You can adjust the numbers, but they MUST add up to 100.

 

Now, to the data ini, again with our DBS example; when I made the fixes, I made SURE it would be usable on both 1st and 2nd Gen Sims, by simply adding the new ter***Effect.fx statement, albeit commented out for 1stGens, along with the 08-style effects:

 

[NormalTextureMaterial]

UseEffectShader=TRUE

EffectShaderName=TerrainEffect.fx

//EffectShaderName=terTerrainEffect.fx

 

[WaterTextureMaterial]

UseEffectShader=TRUE

EffectShaderName=WaterEffect.fx

//EffectShaderName=terWaterEffect.fx

 

[backgroundMaterial]

UseEffectShader=TRUE

EffectShaderName=FarTerrainEffect.fx

//EffectShaderName=terFarTerrainEffect.fx

 

REMEMBER: SF2 Series uses 2 more statements for the SolidObject and AlphaObjects (buildings and trees that are placed on the TOD files)

 

[solidObjectTextureMaterial]

//EffectShaderName=terSolidObject.fx

 

[AlphaObjectTextureMaterial]

//EffectShaderName=terAlphaObject.fx

 

These statements are NOT used in 08 Level 1stGens, and thusly are commented out here (for display purposes only <grin>)

 

So, what needs doing is ADDING the new SF2 ter***Effect.fx statements to your existing terrain's data ini. Now, I like to make sure EVERYONE (with both Generations of the game) can use things, so You can simply copy/paste the statement lines as above directly into your terrain data ini, and comment or uncomment lines as needed.

 

Meaning: you've installed DBS into you SF2 /Terrains folder. To activate them, simply comment OUT the original TerrainEffects statements, and uncomment the SF2 ter***Effect statements.

 

Thusly:

 

[NormalTextureMaterial]

//UseEffectShader=TRUE

//EffectShaderName=TerrainEffect.fx

EffectShaderName=terTerrainEffect.fx

 

And so forth ... Do that for all 5 listed, and that should take care of that. Don't forget, you'll HAVE to add to 2 lines for the SolidObject and AlphaObject fxs (fxis??)

 

Other than possible issues with old tiles and their AlphaChannels, that should pretty much bring your terran as close as possible, if not right up to, SF2 standards.

 

Comments? Questions? Elaborations? Post them in the Mods and Skinning Forums, and we'll try to address them!

 

Happy Landings!

Wrench

Kevin Stein

Share this post


Link to post
Share on other sites

Fixing the "Bleeding Water At the Sea/Land Interface"

 

Many (ok, just about all of them) of the 1stGen SF/Wo* terrains have these statements in their data inis:

 

[NoiseTextureMaterial]

DepthBufferCheck=TRUE

DepthBufferWrite=FALSE

RenderedInOrder=TRUE

AlphaTestEnabled=TRUE

CullMode=CLOCKWISE

LightEnabled=FALSE

SpecularEnabled=FALSE

EmissiveEnabled=FALSE

FogEnabled=FALSE

AmbientColor=1.000000,1.000000,1.000000,1.000000

DiffuseColor=1.000000,1.000000,1.000000,1.000000

ZBufferOffset=1.000000

BlendOp=MODULATE_INV_SRC

NumTextureStages=1

TextureStage[01].TextureName=

TextureStage[01].MipMap=FALSE

TextureStage[01].FilterEnabled=TRUE

TextureStage[01].TileU=TRUE

TextureStage[01].TileV=TRUE

TextureStage[01].StageColorOp=TEXTURE_MODULATE_DIFFUSE

TextureStage[01].StageAlphaOp=NO_OP

 

and...

 

[NoiseTexture]

Size=256

MinColor=229

MaxColor=255

Frequency=1.7

ResolutionFactor=4.0

StartFadeDistance=200.0

EndFadeDistance=500.0

 

These are NO longer used by the SF2 engine, and can cause some visual "oddities", in particular the ocean seeming to leak or bleed through any costal tiles (especially when there are hill & mountains at the water's edge). This is much more prevlant on terrains built with the Desert Terrain Editor than with the GermanyCE/VietnamSEA or IsrealME Terrain Editors. But, occasionally, the GCE and VSEA's DO have it. Just be aware.

 

The easiest, and simplest way is to FIRST, BACKUP THE ORIGINAL DATA INI!!!! (always the safest thing to do, yes?) Then, simply remove or delete those 2 statements. If one were to extract the data inis from any of the stock 4 SF2 terrains, you'll find they just aren't there anymore!

 

There are also some other issues, mostly related the HFD (height field), and with the sea/land transiton tile's _HM.bmp (height maps). There are several ways to help fix that (without rebuilding the terrain from the bottom up -not a viable option!).

 

1) open the terrain's data in, and for all the 'sea' and 'river' tiles, replace the height statments:

 

old stock statment:

 

[Texture001]

Filename=sea1.TGA

HasWater=2

HeightMap=sea1_hm.BMP

HeightMapScale=75.000000

Color=0.212429,0.268664,0.327297

SolidObjectTexture=terobject_buildings1.BMP

AlphaObjectTexture=terobject_trees1.TGA

 

replace with:

 

HeightMapScale=2.000000

 

that should help a LOT.

 

YOu should also check the TOP statments (these from the SF2 Desert terrain):

 

[HeightField]

DetailScale=1.0

DetailFrequency=1.0

MaxHeight=1000

MinHeight=0

 

[HeightOffset]

LowDetailMesh=-1.5

WaterMesh=0.8

 

Make sure they match what you already have. If not, replace them. (you DID back up the data ini, right???)

The other thing, is each individual tile's _hm.bmp can be repainted a SOLID black. This 'fools the engine into thinking it's 'solid', and allows terrain and ground objects to sit at their normal heights. (there should be 2 pack here in the downloads section; one for Desert terrains and one for VNSEAs, but I can't find them!!!)

 

In short: ALWAYS compare 'like with like', those terrains built with the desert TE, compare their data inis with a freshly extracted one from SF2's desert. The same can be said for other terrains, based on GermanyCE, or VeitnamSEA or IsrealME. When in doubt, change it out (after backing up the original data ini, of course!)

 

Hope this help!

Wench

Kevin Stein

 

ps: it should be noted, that it may not ALWAYS work ... DBS, for example, still exhibits some water bleed on the coastlines. I have been unable to fix this.

W

Edited by Wrench

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.

×

Important Information

By using this site, you agree to our Terms of Use, Privacy Policy, and We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue..