experience with mtl_terraintex on model

Posted By: JoGa

experience with mtl_terraintex on model - 04/23/12 10:02

Hi

Does anybody have experience with the shader "terraintex.fx" on models?
It works on terrain well, but if you create a surface in a model-editor(blender) and add in MED the Textures, it is not affected of the variable "detail_size" as the terrains.

(rightclick to enlarge)
here you can see the terrain and the model and the different:

Posted By: HeelX

Re: experience with mtl_terraintex on model - 04/23/12 13:24

It seems to me that detail_size is no regular shader variable, which is especially passed only for terrains. I also wonder why it is marked as favored shader for multitextured terrain, because it still uses FFP stuff and might be slower due to FFP emulation on graphic cards nowadays. If you use terraintex3.fx instead, you can use skill42, 43, 44 to scale the textures for the R, G and B channel arbitrarily (different scales allowed).
Posted By: JoGa

[solved] Re: experience with mtl_terraintex on model - 04/23/12 16:38

thanks for your help!

I had a look in the manual and because there was written "Outdated. Use fx_terraintex for new projects." at terraintex3, I used fx_terraintex and took no notice about the terraintex3.
But your tip is working, i use terraintex3 now, thank!
Posted By: HeelX

[solved] Re: experience with mtl_terraintex on model - 04/23/12 17:14

Are you using all textures, though (base + 3 (R,G,B) + 1 shadow mask) ? If not, you might get additional speedup if you remove the overhead calculations.
Posted By: JoGa

[~solved] Re: experience with mtl_terraintex on model - 04/26/12 16:32

thanks for the hint, but i need all 3 textures (grass, mud, stone).
in the *.fx-file, there is wrote: "Red/green for blending, blue for shadow".
But ingame my first texture is where the blue is on my first skin, not the shadows. That confuses me - do you know a little example-map, where this shader is shown? Or do the skins have to be a special file-type? (i have tga, 24bit) :-/
Posted By: HeelX

[~solved] Re: experience with mtl_terraintex on model - 04/26/12 20:30

Eh, what?

The first texture is the base texture, the second texture is blended over by the red channel and then the third image is blended over by the green channel. The result is then multiplied with the value in the blue channel.

You can either swap channels to adjust it, or you just change the .r, .g and .b parts in the shader code.
Posted By: JoGa

Re: [~solved] Re: experience with mtl_terraintex on model - 04/27/12 05:23

okay thanks - i found my mistake.
I chanced in my image-manipulation-program the opacity of the layers to "addition". Otherwise the layer above overwrites the r-g-b-values of the one beneath *facepalm*
I made a image, if someone have the same problem:

Now it works, thanks HeelX!


left side without additon. The red color has blue=0 and on the blue layer, blue is reset to 0 -> dark.
With addition the effect is avoided, as you can see on the right side, where I hided the red-channel.
© 2024 lite-C Forums