Jump to content
Sign in to follow this  
Tonto-

Terrain textures don't match with mask -layer.

Recommended Posts

Problem is that generating layers make my terrain surface look nothing like planned in mask-image. For example, i have a field surface texture and i set color 244,0,253(purple) for it. Then a have texture for rock surface and for it i set color 255,30,30(red). Both colors match with MapLegend.

After generating layers and reviewing it in bulldozer I see field surface where there should be a rock.. The problem disappeares if I remove field texture from layers.cfg..

Screenshot of settings:

https://www.dropbox.com/s/cqdh4xt1vm91p36/demonstrate.jpg?dl=0

Mask -image is size 12000x12000px and it covers 6kmx6km area.

Am i suffering from a bug?

Edited by Tonto-

Share this post


Link to post
Share on other sites

Here is my legend:

class Legend
{
picture="P:\@isokartta\source\MapLegend.png";
class Colors
	{
		nurmikko[]={{204,255,0}};
		hietikko[]={{255,255,0}};
		kivikko[]={{255,128,0}};
		metsa_green[]={{0,255,0}};
		kallio_rock[]={{255,30,30}};
		pelto_dry[]={{244,0,253};
	};
};

Edited by Tonto-

Share this post


Link to post
Share on other sites

Could be this ?

Also I had the same issue and from memory it was due to my mask not being 1:1

pelto_dry[]={{244,0,253};

missing }

pelto_dry[]={{244,0,253}[color="#FF0000"]}[/color];

Share this post


Link to post
Share on other sites

Fixing legend didn't solve this.

My terrain hf is 4096x4096 and sat/mask images are size 12000x12000px.. Every layer is size 6000m x 6000m in TB. So you think this could cause my problem?

Share this post


Link to post
Share on other sites

I agree with 1PARA about making sure it is the correct multiple with cell size.

Also (please ignore if I am wrong about this) - looking at the image it looks like you have blended the edges of each texture with the one next to it - this will mean that the RGB will be many different colours. I would check this in Photoshop or Gimp with the colour sampler to see if the edges are not a different RGB than what you require. A good way of blending the edges would be to use the spray feature in L3DT as this will spray a solid colour.

Good luck.

Share this post


Link to post
Share on other sites

you can also use photoshop to change "Mode" and change to "Indexed Colour" and enforce a strict palette of just your specific colours - that will eliminate dodgy "shaded borders" too...

B

Share this post


Link to post
Share on other sites

So far i've been unable to generate map layers of my map with any higher grid size than 1024 so i used it for testing purposes. But I tested the mask on 512x512 terrain with correct multiple cell size and it still painted wrong textures.

Herricktune, thats exactly how I made it. I opened my sat image in photoshop and colored different areas on different layers and merged it all together.

Ill try with whole new mask image.

Share this post


Link to post
Share on other sites

Thank you all for your help. I made custom color palette for my mask image but now when I launch my terrain in bulldozer it looks like this.

https://www.dropbox.com/s/wlhh2l7pkvmg8bv/Untitled.jpg?dl=0

Terrain Sampler

Grid Size: 4096 x 4096

Cell Size (m): 1.465

Terrain Size (m): 6000.000

Satellite/Surface (mask) source images

Size (px): 6000 x 6000

Resolution (m/px): 1

Satelitte/Surface (mask) tiles

Size (px): 1024 x 1024

Desired overlap (px): 16

Texture layer

Size (m): 46.88 x 46.88

It does this no matter what settings i use. Plain terrain looks right, so its satellite texture that makes "artifacting".

Share this post


Link to post
Share on other sites

I don't know how it happened, but I got rid of artifacting i told in last post.

So back to the topic. I managed to make TB generate terrain with these settings

Terrain Sampler

Grid Size: 4096 x 4096

Cell Size (m): 1.465

Terrain Size (m): 6000.000

Satellite/Surface (mask) source images

Size (px): 6000 x 6000

Resolution (m/px): 1

Satelitte/Surface (mask) tiles

Size (px): 2048 x 2048

Desired (m/px): 16

Texture layer

Size (m): 46.88 x 46.88

Now it should be 1:1. I've made custom color palette for my mask image so there is no borders between colors. I also tried different color with rock and field textures.. Yet, field is still generated over rock texture.

Edited by Tonto-

Share this post


Link to post
Share on other sites

It sounds to me like your surfaces and respective classes in the configs are out of order; check to be sure that the first layer corresponds to the first one you want, the second one matches the second, and so on. I ran into this just last night and reordering my surfaces, clutters and layers solved it.

Share this post


Link to post
Share on other sites

Here is my configs.

layers.cfg:

class Layers
{
class metsa_green
{
	texture = "p:\@isokartta\data\metsa_green_co.paa";
	material = "p:\@isokartta\data\metsa_green.rvmat";
};	
class hietikko
{
	texture = "p:\@isokartta\data\hietikko_gravel_co.paa";
	material = "p:\@isokartta\data\hietikko_gravel.rvmat";
};
class kivikko
{
	texture = "p:\@isokartta\data\kivikko_rock_co.paa";
	material = "p:\@isokartta\data\kivikko_rock.rvmat";
};
class pelto_dry
{
	texture = "p:\@isokartta\data\pelto_dry_co.paa";
	material = "p:\@isokartta\data\pelto_dry.rvmat";
};
class metsa_dry
{
	texture = "p:\@isokartta\data\metsa_dry_co.paa";
	material = "p:\@isokartta\data\metsa_dry.rvmat";
};

class kallio2_rock
{
	texture = "p:\@isokartta\data\kallio2_rock_co.paa";
	material = "p:\@isokartta\data\kallio2_rock.rvmat";
};
};

class Legend
{
picture="p:\@isokartta\source\MapLegend.png";
class Colors
	{
		metsa_green[]={{0,255,0}};		
		hietikko[]={{255,255,0}};
		kivikko[]={{255,128,0}};
		pelto_dry[]={{7,0,254}};			
		metsa_dry[]={{255,0,122}};				
		kallio2_rock[]={{255,30,30}};
	};
};

cfgSurfaces:

class CfgSurfaces 
{
class Default {};
class metsa_Surface : Default
{	
	 files = "metsa_green_*";
	 rough = 0.1;
	 dust = 0.05;
	 soundEnviron = "grass";
	 character = "metsa_green_Clutter";
	 soundHit = "soft_ground";
};
class Default {};
class hietikko_Surface : Default
{
	files = "hietikko_gravel_*";
	rough = 0.5;
	dust = 0.1;
	soundEnviron = "gravel";
	character = "Empty";
	soundHit = "gravel";
};
class Default {};
class kivikko_Surface : Default 
{
	files ="kivikko_rock_*";
	rough = 1;
	dust = 0.1;
	soundEnviron = "debris";
	character = "Empty";
	soundHit = "rock";
};
class default {};
class pelto_dry_Surface : Default
{
	files = "pelto_dry_*":
	rough = 0.1;
	dust = 0.05;
	soundEnviron = "drygrass";
	character = "Empty"; 
	soundhit = "drygrass";
};	
class Default {};
class metsa_dry_Surface : Default
{	
	 files = "metsa_dry_*";
	 rough = 0.1;
	 dust = 0.05;
	 soundEnviron = "drygrass";
	 character = "Empty";
	 soundHit = "soft_ground";
};
class default {};
class kallio2_rock_Surface : Default 
{
	files = "kallio2_rock_Surface*"; 
	rough = 0.1;
	dust = 0.05;
	soundEnviron = "concrete";
	character = "Empty"; 
	soundHit = "concrete";
};
};
class CfgSurfaceCharacters
{
class metsa_green_Clutter
 	{
		probability[]={1.00};
		names[]={"nurmikko_clutter"};
 	};
};

And cfgClutter:

class Clutter	
{
class nurmikko_clutter : DefaultClutter
  {
   model = "A3\plants_f\Clutter\c_StrGrassGreen_group.p3d";
   affectedByWind = 0.6;
   swLighting = "true";
   scaleMin = 0.7;
   scaleMax = 1.0;
  };
};

For me it looks like same what you described.

Share this post


Link to post
Share on other sites

In Layers.cfg

This part is wrong...

texture = "p:\@isokartta\data\metsa_green_co.paa";

You should path to the _co textures (and the _nopx textures) via the corresponding ground texture .rvmat.

In layers.cfg, for ALL the "texture=" lines, use - "texture = #(rgb,1,1,1)color(0.5,0.5,0.5,1,cdt);"

In cfgSurfaces...

You don't need to keep declaring " class Default {};" all the time - the first one at the beginning on line 2 is enough...

This is a wierd cell size to use...

Cell Size (m): 1.465

Presumably to match the equally odd sized sat & mask imagery which is 6000x6000px

You might find things work out better if you keep to nice, easily divisable numbers like

Heightmap

4096x4096

Cell size = 2.0

Sat & mask = 8192x8192px

make sure your heightmap, sat, mask and mapframe all have 200000E, 0N as their Bottom Left corner and they're all set to the correct width and height, so everything overlays neatly in the TB 2D view, and that the mapframe surrounds it neatly.

Go to your projectfolder\data location - DELETE the "Layers" folder - then Re-Generate it in TB mapframe properties Processing tab...

See if that lot makes any difference....

P.S.

This name.... "@isokartta" for your project folder is probably not a good idea.... Avoid special characters, punctuation, etc - just "isokartta" will do - you can put it in an "@isokartta" MODFolder later if you want...

B

Edited by Bushlurker

Share this post


Link to post
Share on other sites

About these odd values, I'm trying to use image and heightfield data from national land survey of finland download service. HF images from there are size 3000x3000 and it covers 6km x 6km area. I resized the one i downloaded to 4096x4096. Just for testing. I'm trying to keep them as accurate as possible, so i'm using cell size counter gave me.

And so far it has worked.

Except that stupid rock.

I'm starting to belive this is about too many mask colors for TB to handle. I'm going to make my mask image more simple just to make sure there is no 5 materials in one grid. I guess there is no way to get more sat/mask image grids instead of simpler mask -image because when trying (for example 512 x 512) TB gives me "default satellite file does not exist" -error.

I took one more screenshot to show the situation. Smaller red area works and larger stays as field. :D

https://www.dropbox.com/s/l8wz8khrlgswo6l/demonstrate2.jpg?dl=0

Edited by Tonto-
typo

Share this post


Link to post
Share on other sites

Hmmm... "resizing", as well as "odd sizes" can bring unexpected problems... Still - first things first...

your mask image is only 6000x6000px - shouldn't be a big filesize - can you post a link to your actual mask image itself so we can take a closer look....

B

Share this post


Link to post
Share on other sites

Mask image looks OK - though it's still in "indexed colour" mode - you should really change back to RGB once you've used indexed colour to "enforce" your palette - its safe - no extra colours will be added unless you do further editing, etc...

Then reimport to TB...

It is 12000 x 12000px though.

says here 6000...?

Satellite/Surface (mask) source images

Size (px): 6000 x 6000

Resolution (m/px): 1

Hmm...

Mask looks OK - assuming you fixed the config glitches I mentioned before - your configs look OK...

6 colours IS OK - assuming you choose the 6 colour option in TB Processing tab when you generated the layers...

Are your groundtexture rvmats correct? - HERE's a generic one to check against your own... Main thing to check is those paths to the "_co" and "_nopx" texture files are correct...

Other than that I'm starting to run out of ideas....

B

Share this post


Link to post
Share on other sites

After editing mask image and cfgs, the problem seems to be now gone. :)

Thank you for your help!

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  

×