Jump to content
Sign in to follow this  
jezpops

how to make object texture match terrain texture

Recommended Posts

So the problem is i have a .p3d object that i would like to be camouflaged in the terrain, i have used the same paa file but it looks completely different to the terrain, how do i go about making both match each other?

Share this post


Link to post
Share on other sites

Your description doesn't give much of a clue. If you provided a screenshot it would be so much easier to help.

Have you used the same rvmat file for the object?

Share this post


Link to post
Share on other sites

The terrain uses at least 4 different paa files, including the satellite mask which uses a different paa file depending on where the object is placed. I'm not sure if you can make an object do that (without hard coding a lot of objects). V2 users don't really need to know anything about rvmats etc, i think this question would be more likely to get a good answer if asked in the oxygen forum.

Have you considered making the object look like broken earth/dirt?

Share this post


Link to post
Share on other sites

I dont mind having to write a few config files for the objects in question but i am not sure how to replicate the same terrain in a config file, any directions greatly appreciated.

Share this post


Link to post
Share on other sites

here is a terrain rvmat. each segment of the terrain sat/layer mask may use up to 16 of these (assuming 16 texture grids per segment as used on sara) :

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

PixelShaderID="Terrain1";

VertexShaderID="Terrain";

ambient[]={0.900000,0.900000,0.900000,1.000000};

diffuse[]={0.900000,0.900000,0.900000,1.000000};

forcedDiffuse[]={0.020000,0.020000,0.020000,1.000000};

emmisive[]={0.000000,0.000000,0.000000,0.000000};

specular[]={0.000000,0.000000,0.000000,0.000000};

specularPower=0.000000;

class Stage0

{

texture="ceeb\rezina2007\data\Layers\S_000_021_lco.png";

texGen=3;

};

class Stage1

{

texture="ceeb\rezina2007\data\Layers\M_000_021_lco.png";

texGen=4;

};

class TexGen3

{

uvSource="worldPos";

class uvTransform

{

aside[]={0.001563,0.000000,0.000000};

up[]={0.000000,0.000000,0.001563};

dir[]={0.000000,-0.001563,0.000000};

pos[]={0.031250,20.343750,0.000000};

};

};

class TexGen4

{

uvSource="worldPos";

class uvTransform

{

aside[]={0.001563,0.000000,0.000000};

up[]={0.000000,0.000000,0.001563};

dir[]={0.000000,-0.001563,0.000000};

pos[]={0.031250,20.343750,0.000000};

};

};

class TexGen0

{

uvSource="tex";

class uvTransform

{

aside[]={1.000000,0.000000,0.000000};

up[]={0.000000,1.000000,0.000000};

dir[]={0.000000,0.000000,1.000000};

pos[]={0.000000,0.000000,0.000000};

};

};

class TexGen1

{

uvSource="tex";

class uvTransform

{

aside[]={10.000000,0.000000,0.000000};

up[]={0.000000,10.000000,0.000000};

dir[]={0.000000,0.000000,10.000000};

pos[]={0.000000,0.000000,0.000000};

};

};

class TexGen2

{

uvSource="tex";

class uvTransform

{

aside[]={10.000000,0.000000,0.000000};

up[]={0.000000,10.000000,0.000000};

dir[]={0.000000,0.000000,10.000000};

pos[]={0.000000,0.000000,0.000000};

};

};

class Stage2

{

texture="CEEB\REZINA2007\data\pisekplaz_detail_co.paa";

texGen=0;

};

class Stage3

{

texture="CEEB\REZINA2007\data\pisekplaz_detail_nohq.paa";

texGen=1;

};

class Stage4

{

texture="CEEB\REZINA2007\data\pisekplaz_detail_co.paa";

texGen=2;

};

which uses a detail rvmat such as this, for each terrain type :

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

ambient[] = {0.9,0.9,0.9,1};

diffuse[] = {0.9,0.9,0.9,1};

forcedDiffuse[] = {0.02,0.02,0.02,1};

specular[] = {0.0,0.0,0.0,0};

specularPower = 1; // specular interpolator must be enabled

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

PixelShaderID = "NormalMapDiffuse";

VertexShaderID = "NormalMapDiffuseAlpha";

class Stage1

{ // normal map

texture="CEEB\REZINA2007\data\pisekplaz_detail_nohq.paa";

uvSource="tex";

class uvTransform

{

aside[] = {10,0,0};

up[] = {0,10,0};

dir[] = {0,0,10};

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

};

};

class Stage2

{

texture="CEEB\REZINA2007\data\pisekplaz_detail_co.paa";

uvSource="tex";

class uvTransform

{

aside[] = {10,0,0};

up[] = {0,10,0};

dir[] = {0,0,10};

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

};

};

try applying uvSource="worldPos"; to an object. I have no idea if it is likely to work. ArmA uses a fair amount of light source dependant shading upon the terrain, replicating this exactly may be hard

Share this post


Link to post
Share on other sites

Did you also include the terrain nohq (normal mapping) file in your addon? Because the object surface looks kinda flat coloured compared to terrain. A lacking normal map could explain that.

The bottom line is, if you absolutely cannot get the object textures and materials behave the same way as terrain ones do, aim for effect: adjust colors or material properties until the object blends into the background. Check how it looks under different lighting conditions too.

Also, when viewed at longer ranges it might not blend that well anyway, because at longer distances the satellite image is used instead... but that might not be such a big deal.

Share this post


Link to post
Share on other sites

Ok,

uvSource="worldPos" crashes buldozer, i guess this is a terrain only source.

The object does look flat, its because it is! There will be various parts of clutter added to it and it will be shaped once i can get the the textures matching.

So far i have been unable to do this, any more suggestions? Can i override the terrain class (if there is one!wink_o.gif and use its members to replicate the texture??

Share this post


Link to post
Share on other sites
The object does look flat, its because it is! There will be various parts of clutter added to it and it will be shaped once i can get the the textures matching.

No, I meant that the surface texture/material looks flat. The object as such looks fine.

What I mean is that, while I could be wrong, it looks as if there was no normal mapping (the odd blue files with "nohq" in the name) or it wasn't working. The ground textures have normal maps, and if your object doesn't use them, then the object will have a different shade of colour because it reflects light "flatly".

Also make sure that you have correct paths inside the RVMAT.

One thing I'm not quite sure is how do the _MCO files work.

Share this post


Link to post
Share on other sites

Yes, i thought the same ! I have used o2 to add the rvmat and all paths to the nohq, co and mco files are correct, and i am using the default travajih_detail.paa files that came with the BIsamplemap, i may just have to live with it for now crazy_o.gif

Share this post


Link to post
Share on other sites

jez you may need to configue the trench as a class "house" and utilize "roadway" and "paths" components within the p3d if you haven't already done so.

also there are interesting "geometry" component named properties for different shadow use such as "prefer explicit" or "prefer shadowvolume" alot of this kind of work is trial and error.alot of your problems working with objects in the map can be mlods dont work so well as odol,ie as mlod my beach obstacles were stuck half way in the ground but as odol sat correctly on the surface and you should binarise the model with a simple config.usually this fixes shadow problems and the official bis binarize tool leaves a text file revealing any problems with the model itself.as for the mismatch i would suggest use the terrain texture but make your own and keep it with the model in its own data folder effectively severing its link with the terrain.this gives you control over the contrast and lightness of the object ie: trench to settle it better,add some grass sandbags etc.

quick edit: jez you say you use the travahaji.paa which came with the samplemap,that grass texture is smaller in size and different darkness and contrast to the sarahni trava,just a thought does the map you have use the same texture as the trenches? because the bis "trava.paa" is way darker something to check out maybe

Share this post


Link to post
Share on other sites

So far the problem exists when are close to the trench:

p><p><a  href=http://img297.imageshack.us/img297....MG]

I have varied the named properties in the geometry lod but so far no joy. I have renamed the travijah.paa so i can use it seperately with a seperate rvmat (got some weird results there i can tell you, everything from bright red to black!!http://forums.bistudio.com/oldsmileys/wink_o.gif' alt='wink_o.gif'>

I will carry on with the trial and error for now.

Are there any good shadow volume tutorials out there?

One thing i did try which was quite interesting was to colour the trench the same as the colour used in the mask_lco and layers config then import the sattellite and mask again, for a split second the trench was textured the same as the terrain before buldozer crashed..hmm interesting whistle.gif

Share this post


Link to post
Share on other sites

Actually it looks ok jez,maybe some bushes,stones rubble etc at the base might suffice.but i did think maybe the model is not "sealed" if not try making the model whole with a bottom,then,or if you already done that hit "w" on the shadow lod.

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  

×