Gamestudio Links
Zorro Links
Newest Posts
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (alibaba, vicknick), 1,492 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
experience with mtl_terraintex on model #399915
04/23/12 10:02
04/23/12 10:02
Joined: Dec 2003
Posts: 988
Germany, Magdeburg
JoGa Offline OP
User
JoGa  Offline OP
User

Joined: Dec 2003
Posts: 988
Germany, Magdeburg
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:


Re: experience with mtl_terraintex on model [Re: JoGa] #399925
04/23/12 13:24
04/23/12 13:24
Joined: Jul 2001
Posts: 6,904
H
HeelX Offline
Senior Expert
HeelX  Offline
Senior Expert
H

Joined: Jul 2001
Posts: 6,904
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).

Last edited by HeelX; 04/23/12 13:24.
[solved] Re: experience with mtl_terraintex on model [Re: HeelX] #399931
04/23/12 16:38
04/23/12 16:38
Joined: Dec 2003
Posts: 988
Germany, Magdeburg
JoGa Offline OP
User
JoGa  Offline OP
User

Joined: Dec 2003
Posts: 988
Germany, Magdeburg
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!

Last edited by JoGa; 04/23/12 16:38.
[solved] Re: experience with mtl_terraintex on model [Re: JoGa] #399933
04/23/12 17:14
04/23/12 17:14
Joined: Jul 2001
Posts: 6,904
H
HeelX Offline
Senior Expert
HeelX  Offline
Senior Expert
H

Joined: Jul 2001
Posts: 6,904
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.

Last edited by HeelX; 04/23/12 17:39.
[~solved] Re: experience with mtl_terraintex on model [Re: HeelX] #400172
04/26/12 16:32
04/26/12 16:32
Joined: Dec 2003
Posts: 988
Germany, Magdeburg
JoGa Offline OP
User
JoGa  Offline OP
User

Joined: Dec 2003
Posts: 988
Germany, Magdeburg
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) :-/

Last edited by JoGa; 04/26/12 17:13.
[~solved] Re: experience with mtl_terraintex on model [Re: JoGa] #400190
04/26/12 20:30
04/26/12 20:30
Joined: Jul 2001
Posts: 6,904
H
HeelX Offline
Senior Expert
HeelX  Offline
Senior Expert
H

Joined: Jul 2001
Posts: 6,904
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.

Re: [~solved] Re: experience with mtl_terraintex on model [Re: HeelX] #400202
04/27/12 05:23
04/27/12 05:23
Joined: Dec 2003
Posts: 988
Germany, Magdeburg
JoGa Offline OP
User
JoGa  Offline OP
User

Joined: Dec 2003
Posts: 988
Germany, Magdeburg
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.

Last edited by JoGa; 04/27/12 05:24.

Moderated by  Blink, Hummel, Superku 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1