Jump to content
Sign in to follow this  
opteryx

LOD Blending on Vegetation?

Recommended Posts

I've looked at the MLOD samples and replicated all their properties on my own models, but I don't have the smooth transition between res LODs like on the BIS vegetation, how do I do this?

Share this post


Link to post
Share on other sites

It's done via rvmat afaik. These entries seems to be important:

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

VertexShaderID = "NormalMapSpecularThrough";

Share this post


Link to post
Share on other sites
...smooth transition between res LODs like on the BIS vegetation...

What do you mean exactly... a little more detail or pictures of issues you are having would help...

Share this post


Link to post
Share on other sites
...smooth transition between res LODs like on the BIS vegetation...

What do you mean exactly... a little more detail or pictures of issues you are having would help...

Well a picture wouldn't be able to explain it, when you move closer or further from for example a tree, you will observe that the switch between resolution LODs isn't instant, then kind of blend together. I can't explain it better than that, you can observe it in ingame when you move closer or further from vegetation models. I think this was introduced in the 1.05 patch

Quote[/b] ]LOD blending on vegetation for smoother visual transition

but I don't recall the transition between LODs on vegetation being instant before that, so I 'm not a 100% if this is what the changelog is referring to.

Share this post


Link to post
Share on other sites

So you are getting 'lod popping' then...

What are your no of faces, what material settings etc. in say the first lod and same details for the second lod for instance?

Are you using the old technique of having the first lod detailed and the remaining view lod's with a tiny bit of geometry and intersecting polygon planes that have an alpha image placed on them... lessen's the load during lod transition...

If you are finding it's quite severe then perhaps your materials are not quite optimal and the engine is struggling... dunno... have another thorough check of the material setups on your plants/trees.

Maybe pm Berghoff his trees seem to work quite well... maybe he'll give you some pointers...

Share this post


Link to post
Share on other sites

I tried applying an rvmat, but really I have no idea what I'm doing here... Maybe I would save my self a lot of trouble explaining my self by letting people look at it instead.

Download

The model casts very dark shadows on it self with the rvmat applied and I still don't know how to get the smooth LOD transitions.

Share this post


Link to post
Share on other sites

Is there a specific reason you went for 0.0, 0.3, 0.7, 2.0, 2.3 ?

perhaps rearrange to 0.5, 1.0, 2.0, 3.0 etc.

and, perhaps replace some of the geom. in the 2nd lod with poly-planes...

For the palm fronds use a _ca.tga main texture and use the pixel & vertex shaders T_D mentioned above... as per a typical BIS palm tree .rvmat...

Note the '_non' texture in the material... a normal map with 'noise' in the alpha channel. This texture along with the pix & vert shaders are meant to reduce the 'popping'...

eg.

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">ambient[]={1.000000,1.000000,1.000000,1.000000};

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

forcedDiffuse[]={0.300000,0.300000,0.300000,0.500000};

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

specular[]={0.040000,0.040000,0.040000,1.000000};

specularPower=16.000000;

PixelShaderID="NormalMapSpecularThrough";

VertexShaderID="NormalMapSpecularThroughNoFade";

class Stage1

{

texture="ca\plants\data\palma_list_01_non.paa";

uvSource="tex";

class uvTransform

{

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

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

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

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

};

};

class Stage2

{

texture="#(ai,32,32,1)treeCrown(0.3)";

uvSource="none";

};

class Stage3

{

texture="#(ai,32,32,1)treeCrownAmb(0.3)";

uvSource="none";

};

Oh, also... because of you res lod values you might be finding that in game is jumping lods and or trying very had to accomodate your lods and struggling... either way will produce the pop-effect.

Share this post


Link to post
Share on other sites

Thank you for your help Synide, I pretty much got it as I wanted it now.

Is there a specific reason you went for 0.0, 0.3, 0.7, 2.0, 2.3 ?

Yes, I figured maybe smaller intervals would give better performance(does it?).

But now I've got a new problem, when using stencil shadows(?) the Shadow volume isn't working correctly. I can't see anything different in the model properties compared to the BI sample. Anyone have an idea on this? Another rvmat related thing?

Download

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  

×