Scaling UV Coordinates

uv-mapping
#1

In another thread here I was introduced to the concept of combining multiple textures and re-sampling that same texture at different uv coordinates to get the desired result.

This works pretty well (except for repeating so far, but that’s a separate issue).

I have this working on planar geometry and thought about using this technique on my many models that use diffuse, normal and specular maps.

Example (added complexity of texture blending):
https://jsfiddle.net/titansoftime/3das607j/

I have this working but it kind of was a pain to scale the model uv’s when doing more complex geometry. I tired doing it programmatically, but ultimately had to go into blender and scale the uv’s there and also transform them as well. In blender I just scale the x and y coordinates by 0.5 and then translate the uvs to the bottom left corner of the uv editor.

On planar geometry simply multiplying each uv by 0.5 in javascript was sufficient, however this does not work for character models for example.

I’d like to know how to do this in three.js so I do not have to re-export hundred of models. Not to mention in some cases this technique is undesired, so I would have to have both a uv scaled glb and the original for different situations.

Anyone know how to do this?

1 Like

#2

Well… nevermind =]

Apparently multiplying the uvs by 0.5 actually works just fine. I must have messed something else up at the time.

0 Likes

#3

It looks good!

1 Like