Content

Post new topic Reply to topic

Triplanar texture mapping.

Author Message
N-J ZEQ2 Legend View user's profile Send private message

Reply with quote Thursday, January 28, 2010

In order to solve Dave's UV mapping problem on mainly big maps like the desert which have a lot of texture stretching issues (due to lazy people in the past Razz) I present here a method that solves a big portion of that problem using shaders.

The method is called Triplanar texture mapping. The basic concept behind it is very simple.

In a standard planar texture map the texture is mapped in one direction on the the model. The problem is when this model curves around it will cause texture stretching on the sides.



The simple solution for this is triplanar texturing. One projects a texture from all 3 sides, front, side and above. And uses the normals of the model to figure out which texture has the most contribution to that vertex.



The normal of the vertex is used as a weight so to speak to blend between the 3 textures.

Below you can see this blending going on:



Each color represents a texture and how much of it is applied to that vertex. In normal use the green and red colors would be the same texture where as the blue one would be a surface or grass texture:




Once there's support for glsl, this would be a simple solution to a very daunting task Razz.

Malek View user's profile Send private message

Reply with quote Thursday, January 28, 2010

don't know about the legendary N-J , WHo is him !??!?!?!?!?!?!?!?!!!?!

TRL View user's profile Send private message

Reply with quote Thursday, January 28, 2010

Very interesting. So basically the maps aren't uvw mapped right?

N-J ZEQ2 Legend View user's profile Send private message

Reply with quote Thursday, January 28, 2010

TRL wrote : Very interesting. So basically the maps aren't uvw mapped right?



That's correct.

Buksna Blaizing View user's profile Send private message

Reply with quote Thursday, January 28, 2010

Malek wrote : don't know about the legendary N-J , WHo is him !??!?!?!?!?!?!?!?!!!?!



ZEQ2 Legend Laughing

Ameon View user's profile Send private message

Reply with quote Thursday, January 28, 2010

well. I've found a thie method at mapping models in netradiant as a trick. it also controls mapping triplaner. Razz

Zeth The Admin View user's profile Send private message

Reply with quote Thursday, January 28, 2010

Very interesting. So basically the maps aren't uvw mapped right?


When you're dealing with HUNDREDS of hand-crafted, non-duplicate meshes, it becomes very time-consuming to manually UV each of them in a way that allows a single set of textures to be used.

Agree with the concept, Najib. At first glance I'd thought you were mincing terms with splat mapping approaches, but after a second look I realized you were only using normal data for blending in a continuous manner.

I'd say that this would be a pretty dynamic approach on almost ANY object that relied on tiling textures over a discrete UVW map. As such it could have a lot of practical use in some of our 'other' projects.

Pretty smart stuff. Smile

Post new topic Reply to topic

Actions

Online [ 0 / 6108]