• There seems to be an uptick in Political comments in recent months. Those of us who are long time members of the site know that Political and Religious content has been banned for years. Nothing has changed. Please leave all political and religious comments out of the forums.

    If you recently joined the forums you were not presented with this restriction in the terms of service. This was due to a conversion error when we went from vBulletin to Xenforo. We have updated our terms of service to reflect these corrections.

    Please note any post refering to a politician will be considered political even if it is intended to be humor. Our experience is these topics have a way of dividing the forums and causing deep resentment among members. It is a poison to the community. We appreciate compliance with the rules.

    The Staff of SOH

  • Server side Maintenance is done. We still have an update to the forum software to run but that one will have to wait for a better time.

TIFFs files for CFS3 landclasses

odin_br

Members +
Hello all!
I´m trying to generate a cfs3 landclass file using Martin´s (mwgfx.co.uk) cfs3 scenery tutorial.
I´m using a Photosho cs6 to generate de 32bit Tiff file, but during the TIFF2LCF conversion, i received this message (attached).
The Tiff file generated was checked if containing only the colours defined on c2v.txt...

Please help...
 

Attachments

  • tiff2lcf _error.JPG
    tiff2lcf _error.JPG
    37.6 KB · Views: 25
Firstly, somebody is working on landclasses? Hooray! This is something I've wanted to try for a long time, but the tool won't work at all for me. I can try to look over things when I get home from work and see if I can see what the issue might be. What are your plans for working on the landclasses?
 
Main Objective on Landclasses

Dear gecko,

After studied CFS3 terrain SDK a lot, some questions fired in my mind:
- Why CFS3 sdk terrain tools are more complex than CFS2 and the results are so bad?
- The terrain resolution can be improved if you have a good shoreline generated with the same terrain resolution. Landclasses tools can supports higher resolutions (Strider 90m and 32m per pixel)?
- For my landclasses studies, i need to generate a test tiff file with lower parameters: Lower TIFF 32bits image size (1000x1000), higher stride (1024), same landclasses.xml used on cfs3 original... WHY I CANNOT GENERATED the LCF file???? What´s wrong???

Well, I believe that the landclass system is the saint graal of cfs3 detailed scenery. Of course, if I get hability to work with landclasses tools, I´ll write a detailed lanclass tutorial for all SOH team .

Best Regards,
(Sorry my bad English)
 
Bob would be the best person to ask but he has retired from cfs3 design . Maybe you could a send private message ? his username is rbp71854 .
If you don't have any luck , I can try to email him for you.

He does seem to pop in here from time to time
 
In the meantime, check the options in Photoshop for saving in TIFF. You may have one or more options set by default which the TIFF2LCF tool can't handle: there are a few:–


329156.image0.jpg



These are not the recommended options shown, it's just an illustration of how many options there are!
 
Photoshop version issue for TIFFs

Dear all, Thanks a lot by your support...

Hairyspin, whats is your photoshop version?

My CS6 Do not have RLE compression option for TIFF export, only ZIP. Maybe its a big issue (image attached)

But, if RLE compression is needed for layers compression, It means that each landclass color must be in a separeted layer?

Popsaka,
About the terrain mesh, It is possible to use SRTM3 files ~ 90m per pixel. CFS3 uses SRTM30 ~ 1024m per pixel.
But SRTM3 files with original cfs3 shorelines causes many spikes at shorelines regions. A new shoreline must be generated with the same SRTM3 resolution. I find a way to make this. But I´m not tested yet. I Need the landclass LCF first...

sdsbolt,
Thanks by the info about rbp71854. If I do not get success until friday, i´ll try to contact him.
 

Attachments

  • Photoshop_CS6_TIFF_Options.JPG
    Photoshop_CS6_TIFF_Options.JPG
    28.2 KB · Views: 25
Hmm. I'd save in IBM PC byte order for starters, uncompressed and flattened to a single layer. I'm not at my own PC this week so can't check exact details and I use Photoshop CS4 anyway, but don't think CS6 can be much different for TIFF saves.
 
Tiff configurations already confirmed for LCF tool

Dear all,
An image attached shows a photoshop export configurations that TIFF2LCF tool loads with a pixel type error. The options in red, only one of them, will generate a Tiff file rejected by the TIFF2LCF tool.

The CFS3 sdk was made on 2003 year. The Photoshop version on 2003 was CS2. The first version with 32 bits mode capacity. Tiff 32bits Files generated by CS2 are every flattened (no multilayers). Then, like hairyspin said:uncompressed and flattened to a single layer.

More info for Tiff generation...

One more: I think that a TIFF 32bit RGB file generated until now doesn´t work because the file need an ALPHA CHANNEL. But i need to learn to work with alpha channel in Photoshop, and save the file in a RGBA format (maybe its a 4 samples per pixel requested by an error message).

Best Regards.
 

Attachments

  • Tiff Export.JPG
    Tiff Export.JPG
    24.7 KB · Views: 25
I think you need to enable alpha in TIFFs via the Photoshop preferences first, but I can't check myself yet...
 
Martin Wright's Commentary on making landclass files

I've just dug up some extracts from a document I found on Martin Wright's website. I hope this stuff helps.....

MartinW on CFS3 Terrain SDK

CFS3 Terrain SDK
We are currently slowly working through the public beta of the CFS3 Terrain sdk. My plan is to collect together bits and pieces as we work through it slowly. Hopefully the end result will be new Theatres available for CFS3.
Where there are links below to view text of image files you can either left-click to view them in your browser or right-click and select "Save Target as.." to download them to your computer
Step 1 - Creating Mesh files
Step 2 - Creating the Landclass file
Step 3 - Putting the bare theatre into CFS3

Now, skipping through to his Step 2......

Second step.......Creating Landclass
Landclass (LCF) files are required for theatres to tell CFS3 what type of terrain texture to use at a particular location.
There are 15 landclass types defined in CFS3. You can add your own or create a whole new set for your theatre but as each landclass type requires a full set of multiple seasonal mosaics it would be easiest to stick with the default ones for the moment. If you want to mainly use the default landclasses but add an additional one or two then you should make a copy of Landclasses.xml (found in terrdata.zip in the Terrains folder) rename it to something else and then open and edit it to add additional landclasses using free numbers.
Landclass numbers found in the default landclasses.xml file
1
Ice/snow
6
Grass
8
Crop and Town
10
Grass, Crop and Scrub
15
Crops
17
Marsh
24
Forest
25
Forest and Fields
26
Coniferous Forest
27
Mixed Forest
31
Large City
34
Medium City
47
Small City
51
Dry wooded scrub
56
Rock

Landclass files are created using the TIFF2LCF tool. The Tiff image used is an image of the theatre with each pixel representing a certain area and the colour of that pixel is used to define the landclass to use at that location in the Theatre.
In order to be able to translate a colour to a specific landclass value the tool requires a translation table. This takes the form of a text file where each line contains 4 numbers seperated by commas. The first number is the landclass value. The other 3 are the RGB values that make up the colour.
You can make up your own translation file or you can use the one I have created for my own use. My file is c2v.txt .Using my selection of landclass colours and applying them to the default theatre landclass file we see :-

[sorry you can't see - my document does not have the image]

I feel that these colours give a fairly good representation. You can of course use any colours you like.
In order to create an LCF file for your theatre you will need to create an image of your theatre similar to the map section above and colour in the various parts with the landclasses you wish to appear there.
There is a technical problem as TIFF2LCF is very fussy about the type of Tiff file you use. It must be a 32 bit Tiff containing ONLY the colours you have defined in your translation file. A further complication is that the only paint program I have found that will create Tiff images that work with this tool is PhotoShop. Tiff files created by PaintShopPro are rejected by the tool. There may be other paint programs that can create the correct sort of Tiff but the only one I can definitely confirm is PhotoShop.
TIFF2LCF parameters in order
InTIFF
The Tiff image file to use. Must be 32 bit
Color2Vulcan
The text file containing the translation table linking specific RGB values to a landclass number. See c2v.txt
TheatreDim
The width of the theatre in metres
Stride
The width in metres of each single landclass tile. SDK says this must be a power of 2.
LandclassesXML
The name (without path) of the XML file to be used at runtime to find the details of each landclass type. Unless you are going to create your own just use Landclasses.xml
OutLCF
The name of the LCF file to create.

eg - TIFF2LCF "myterrain.tif" "c2v.txt" 786650 1024 Landclasses.xml "myterrain.lcf"
This will create the Landclass file MyTerrain.lcf from the supplied parameters.
Note that the TheatreDim divided by the Stride must exactly equal the width of your Tiff image! You may have to resize your tiff after doing the relevant calculations.
TIFF2LCF will stop with an error if it calculates that the Tiff image size is not correct for the TheatreDim and Stride settings. It will also stop with an error if it finds a colour in the image that doesn`t appear in your translation table.

Anyway Odin_br I am very excited that someone is looking at this stuff. I've also got a lot of guides on terrain creation which I've nver had time to digest properly - but happy to share if you PM me.
 
This stuff is brain drain to the limit... I dunno why I can't wrap my head around it
I'm beside meself with awe and respect :semi-twins:
Cripes Martin must've put a lot of time a'thunkin'...
...and the possibilities are really wonderful! Imagine flying low through Northern Italy's
mountains and gulleys with nothing to JAR you out of your immersion!
 
We are real close...

Dear all,

Thanks a lot by your efforts...
I believe that Hairyspin will bring good news next week...

Also, more News:
I´ve received a Martin Wright's contact. He only remember that TIFFs must be a RGBA (with alpha channel). And, recommended to contact MAW team for infos.

(Sorry my bad english)
Best Regards!
 
Adding an Alpha channel in Photoshop

Really easy this, here we go!

TiffAlpha01_zpskdoww5it.jpg





The new channel will be an alpha channel by default, all the other channels will be immediately hidden:–


TiffAlpha02_zpslyyze24r.jpg



(if you click on the visibility box for RGB, the others will all be shown)


TiffAlpha03_zps3qbjr6ly.jpg




The bitmap is now ready to save as a TIFF, but remember to include the Alpha channel with it:–


TiffAlpha04_zpslbdynvru.jpg





We've already covered the other options.
 
You don't see the finished image in Photoshop as it will be seen by other programs.

Here I've put a diagonal graduated monochrome band in the alpha channel and with all channels visible the reddish band is all you see to indicate anything unusual:–


TiffAlpha05_zpscitc9jlp.jpg





However view the saved TIFF in Windows Photo Viewer and you get this:–


TiffAlpha06_zps65upqc83.jpg




That's how we do transparency and degrees of it in texture files for conversion to .DDS (DXT3)
 
Yahoo this looks really good, thanks, Hairyspin! I really hope this stuff can be recorded permanently, as valuable terrain building info from the Pacific theatres might not be around any more....(which would be a crying shame but I cannot criticise people who have burnt themselves out to provide us with a new sandbox to play in......)

:applause:
 
Not yet...

Dear all,

I get no conversion with TIFF 32bits RGBA (With alpha channel). Please, can anyone contact RS or MAW developers to check what are the tiffs requirements to TIFF2LCF tool?

Also, I attached my stydies files: A 1000x1000 8bit RGBA file (8bits for small file size) with all landclass colors described by Martin´s c2v.txt.
You must to convert to 32bit mode in PHOTOSHOP before saving - Menu Image - Mode 16bits/channel
again- Menu Image - Mode 32bits/channel
save with alpha channel enable.
A c2v.txt
A text file with TIFF2LCF command to you to copy and paste on command line window (Comando_LC.txt).
All those files must be in a dir with SDK tools and required DLLs.
Please, try to convert. If you get a sucess, please post ASAP!!
Best regards!
 

Attachments

  • cfs3_LC_Study.rar
    79.3 KB · Views: 4
Back
Top