Multi texturing/texture blending for models

Posted By: Turrican

Multi texturing/texture blending for models - 02/16/13 17:36

Hi,

I'm looking for a way to apply multiple tiling textures with adjustable scale/ratio to a normal model, which is going to be the base architecture for my level. I also want these textures to blend smoothly and on top of that, I want to apply a pre-baked lightmap later on.

I figured the best solution for my problem would be to use mtl_terraintex as material, even though I'm not using a terrain at all, as this FFP offers everything I want - but it sadly has absolutely no effect.

I've set up the skin textures as described in the manual and all I got was this:



Now, as I barely have any idea of shader programming, I would like to ask you to help me out. Any ideas (or even full code examples laugh ) appreciated!
Posted By: Uhrwerk

Re: Multi texturing/texture blending for models - 02/16/13 17:50

Originally Posted By: Turrican
I figured the best solution for my problem would be to use mtl_terraintex as material, even though I'm not using a terrain at all

Uhm ... what?

What did you do in order to achieve the screenshot?
Posted By: Superku

Re: Multi texturing/texture blending for models - 02/16/13 18:17

This should give you a good start:
http://www.opserver.de/ubb7/ubbthreads.php?ubb=showflat&Number=411997#Post411997
Posted By: Kartoffel

Re: Multi texturing/texture blending for models - 02/16/13 18:28

Just wanted to suggest triplanar texturemapping but Superku was faster grin

I guess using this is the best solution (if you are able to use shaders).
Posted By: Turrican

Re: Multi texturing/texture blending for models - 02/16/13 19:25

Quote:
Uhm ... what?

What did you do in order to achieve the screenshot?


I thought it was obvious, but perhaps I should go more into the details here. I created the model (1a) and unwrapped it afterwards (1b). Then, I painted the alpha mask for the second texture (2d) directly onto the model's surface.

I imported the model using MED and assigned the first texture (2a) with completely opaque alpha (2b, in a 32-bit TGA, if that matters) to skin1 and another texture (2c), that I wanted to blend over the first one, to skin2. The latter has the previously prepared alpha channel.

I saved all that stuff as MDL, loaded it up into WED, assigned mtl_terraintex as material, built the WMB, started my project and made the screenshot.

Now I guess you wanted to imply that I'm completely nuts, but let me explain my theory: when I have an HMP file, it still has the usual UV mapping as any other model. The textures assigned to its various skins are nothing more but images with visibility information for the UV coordinates. So I thought, what works for heightmaps should very well work for models, too (which prove wrong, as you can tell by my initial post).



Thanks @Superku and Kartoffel. This technique does indeed look very helpful. I'll have a look into that, though I doubt I'll be able to make use of it. I'll just post again as soon as I encounter problems.
Posted By: Uhrwerk

Re: Multi texturing/texture blending for models - 02/16/13 20:28

Originally Posted By: Turrican
Now I guess you wanted to imply that I'm completely nuts
No. I just wouldn't have come to that idea.
Originally Posted By: Turrican
when I have an HMP file, it still has the usual UV mapping as any other model.
Unfortunately this is not the case AFAIK. That's why mtl_terraintex3 won't work for models. But why did you use a model when you wanted a terrain in the first place?
Posted By: Kartoffel

Re: Multi texturing/texture blending for models - 02/16/13 20:38

The shader I once posted (the one Superku posted the link) is like a better version of a terrain-texturing shader.
It just doesn't support mutliple textures. (but this can be changed)
Posted By: Turrican

Re: Multi texturing/texture blending for models - 02/16/13 20:45

Quote:
No. I just wouldn't have come to that idea.

Okay, I think I got you wrong then. Nevermind! ^^

Quote:
Unfortunately this is not the case AFAIK. That's why mtl_terraintex3 won't work for models. But why did you use a model when you wanted a terrain in the first place?

I think you nailed the problem here. The reason why I'm using models instead of terrain is that I need very organic shapes for my level architecture. See, I'm working on a sidescroller (imagine something like The Cave), and working with terrains and blocks is sort of outta question, because I need to be very flexible and stuff.

Anyway, I got that shader Superku and Kartoffel were pointing me to working so far and I also somehow managed to implement three different textures for different slope angles. I think that will create roughly the same effect I was trying to achieve with the aforementioned method. Thanks! laugh
© 2024 lite-C Forums