[Solved] Is texture interpolation possible?

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
TechX12
Posts: 4
Joined: Tue Sep 20, 2011 10:02 am

[Solved] Is texture interpolation possible?

Post by TechX12 »

Is there a way to interpolate textures between vertices?

(I mean I have a scene node, and I have two textures. The scene node draws terrain. The vertices have red color where I want the first texture, and where my second texture's supposed to be, the vertices are blue. And when I draw a polygon between red and blue vertices, the polygon has interpolated colors. Is it possible to do something like that with textures?)
Last edited by TechX12 on Tue Aug 20, 2013 2:07 pm, edited 2 times in total.
mikkis
Posts: 64
Joined: Mon Jan 28, 2013 2:38 pm
Location: Fi

Re: Is texture interpolation possible?

Post by mikkis »

It should be possible with shaders, if model gets vertex color information too.

It might be easier using texture splatting, like
http://irrlicht.sourceforge.net/forum/v ... hp?t=26702
TechX12
Posts: 4
Joined: Tue Sep 20, 2011 10:02 am

Re: Is texture interpolation possible?

Post by TechX12 »

Thank you, but my problem is different. I want to make a very large noise terrain, where the texturing depends only on height information. The topic what you referred to says, texture splatting will require alpha maps which are textures. In fact I'm quite new to Irrlicht, and I don't have much knowledge on shaders too.
Last edited by TechX12 on Tue Aug 20, 2013 2:09 pm, edited 1 time in total.
TechX12
Posts: 4
Joined: Tue Sep 20, 2011 10:02 am

Re: Is texture interpolation possible?

Post by TechX12 »

Solved! :D
Yesterday I experimented with materials, and I found that a Solid2Layer type material's first texture will always have it's original alpha, but the second one will work as a TransparentVertexAlpha material's first texture, so it will use the vertices' alpha as opacity.

So, result with Solid2Layer (don't get confused, the alpha is randomly generated, and that hole is there on purpose too :)
Image

Then I simply draw the same model with a TransparentVertexAlpha material with different texture, and vertex alpha values. (well, not the best way, but it works :)
Image

Now it will need a little modification, and it will do what I need.
Post Reply