Jump to content
Sign in to follow this  
.kju

Layers.cfg

Recommended Posts

http://community.bistudio.com/wiki/Layered_Terrain_Surface_Representation

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">class Layers

{

class Grass

{

texture="layertest\data\grass_lco.paa";

material="layertest\data\grass.rvmat";

};

class Sand

{

texture = "#(argb,8,8,3)color(0.5,0.5,0.5,1)";

material="layertest\data\sand.rvmat";

};

class Rock

{

texture = "#(argb,8,8,3)color(0.5,0.5,0.5,1)";

material="layertest\data\rock.rvmat";

};

class Mud

{

texture = "#(argb,8,8,3)color(0.5,0.5,0.5,1)";

material="layertest\data\mud.rvmat";

};

};

class Legend

{

picture="layertest\src\mapLegend.png";

class Colors

{

/// color names should correspond to surface layer names

snow[]={{255,255,255}};

wetSand[]={{0,0,0}};

grass[]={{0,255,131},{255,255,0}};

sand[]={{207,115,0}};

rock[]={{0,255,255},{121,255,0}};

mud[]={{0,255,0}};

}

};

So lets start with the basics again.

The each layer map mask defines what ground texture should be

drawn in the players vicinity.

From the layers.cfg there is a relation made between certain

RGB colors and the textures.

Visitor is said to process the satellite map (Satellite-map_lco.png),

layer map mask (Layer-map_lco.png) and the Layers.cfg.

The result are the numerous m_*.paa, s_*.paa and p_*.rvmat

files. So far so good.

(is said as I didn't do the process myself yet)

What I don't get is where the mapping information from the

layers.cfg was transfered to???

Any help is very much appreciated!

PS: Could be related to the other thread about "StageX".

Share this post


Link to post
Share on other sites

Not sure I understand your question Q .....

But heres some info along the lines .... excuse me if I'm stating the bleeding obvious.

- The "data/layers" directory at the start of a project contains nothing.

- I generally delete everything in it whenever I make a change.

- The "data" directory will contain similar to below.

Visitor_1.jpg

- The files in here match the lines used in your customised "layers.cfg".

- Your Mask colours should match colours used in the bottom of the Layers.cfg

- When you generate a project for the first time ("Import Satellite + Mask") Visitor will fill the Layer directory with files

- Once you run Buldozer, many of those new PNG tiles will be converted to PAA

- The "layer" information (the textures you see at ground level) are determined ingame by the "mask" PAA tile of the "m_XXXX" series.

- BUT .... I have noticed that the RGB colours in this PAA tile don't nessisarily always match the RGB in your layers.cfg. ... but it still seems to work.

EDIT: I think I know what your asking now .... (so ignore above smile_o.gif )

The Layer tile key info seems to be stored in the RVMATs, both the file name coding as well as certain texture tiles file names get mentioned inside the file.

P_001-006_L02_L03_L05.rvmat

But, what does this "L02_L03_L05" mean?

Share this post


Link to post
Share on other sites

You basically answered it yourself smile_o.gif

The rvmats you put in the layers.cfg are used to create a single rvmat for each texture cell when applying a sat-texture in Visitor.

Depending on how many of the 4 possible terrain types you've used in a texture cell, the associated rvmats of a terrain (the ones from the layers.cfg) get included as the additional stages in the texture cell rvmat (like you posted in the Stagex thread).

Rvmats seem to directly feed a shader with the info it needs and since that can be quite different depending on how the shader was coded, you'll probably see different structured rvmats for different shaders. So to know what parameters you have to put where in the rvmat, you'll have to know what the shader expects.

In the case of the terrain shader, it seems that the first "stage" is the sat texture, the second the mask texture for looking up the different terrain types (like you mentioned in the Stagex thread) and the following stages represent the detail textures (3 for each terrain type) of each terrain type used in the texture cell.

All this is generated automatically when you import a sat-texture in Visitor, if your mask-texture, layers.cfg and the terrain type rvmats are all done right.

Share this post


Link to post
Share on other sites

Did I miss that rule somewhere? There can only be 4 terrain types per texture tile/cell ?

Share this post


Link to post
Share on other sites
Quote[/b] ]Game Engine Notes

The information about the layer map above relates to tool use rather than the ArmA game engine. For game engine use each segment of the Layer map uses its own pallete that is unrelated to the Layer Legend mentioned above. Each terrain type within a segment uses a colour based upon the order in which the terrain types are defined in the config. Colours are used in the following order : Black (000000), Red (FF0000), Green (00FF00), Blue (0000FF). This method of defining terrain types restricts each segment to a maximum of four different terrain types. All 4 terrain types can be blended together within one pixel of the layer map (2m x 2m on Sahrani), although blending is rarely used. Ground clutter appears to be placed based upon the dominant terrain type.

(Source: Layered Terrain Surface Representation, BI Wiki)

From what it looks like, 1 texture cell is rendered with a single shader and the rvmat provides the input to that shader. So the amount of textures that a shader expects can't be variable since it's hard-coded into the shader. Somewhere they had to draw the line and it seems that 4 layers was it.

From how the rvmats are done when applying a sat-texture, it seems that you can use as many terrain types in the layers.cfg as you like, as long as you make sure the shader isn't supposed to be fed more than 4 of those in a single texture cell.

Share this post


Link to post
Share on other sites

Thanks Rom.

Darn, that may explain why some of my islands don't seem to have the textures I intended.

...... going to make it harder to manage.

Well ..... first thing to go is a separate texture for the seabed!!

Share this post


Link to post
Share on other sites

Sincere thanks Romolus and Gnat. smile_o.gif

Almost no sleep and clear-thinking doesn't seem to to fit very well

together. biggrin_o.gif

Quote[/b] ]P_001-006_L02_L03_L05.rvmat

But, what does this "L02_L03_L05" mean?

L = layer(s)

LXX = layer01, layer02 - It should be an auto generated naming

format for the given source textures of the layers.cfg

So for example:

L00 could be pisek

L01 could be leslist etc.

N (p_034-012_n_l02_l04_l05.rvmat) could mean 'none' (no texture / default texture).

The mapping depends on your layers.cfg most likely I guess.

Max number of 4 of these tags are added to the rvmat name.

Also the way the ordering should represent some kind of information.

Not sure which though.

---

Little context here. I am coming from an OFP WRP (4WVR) file.

So far we are using the single texture method outlined by Solus.

I was curious, if we could go for more by manually creating and

editing rvmats. whistle.gif

Anyway it should make more sense to get our islands binarized

and to the ArmA WRP format... if only binarize would work ..

Rom you don't have a little nifty tool to convert a 4WVR to

OPRW or PEW rather than binarize1.0exe on your HDD. wink_o.gif

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×