一个three.js材质可以为凹凸贴图和纹理贴图分别设置重复值吗? [英] Can a three.js material have separate repeat values for a bump map and a texture map?

查看:2717
本文介绍了一个three.js材质可以为凹凸贴图和纹理贴图分别设置重复值吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试通过应用不太频繁重复的凹凸贴图来分解纹理中的重复。不幸的是,它似乎采用了'landTexture'的重复值(64),而不是我设置为(1)的值。

I'm trying to break up the repetition in my texture by applying a bump map which repeats much less frequently. Unfortunately, it seems to take on the repeat value of 'landTexture' below (64), instead of the value I set it to (1).

landTexture.wrapS = landTexture.wrapT = THREE.RepeatWrapping;
landTexture.repeat.set(64, 64);
bumpTexture.wrapS = bumpTexture.wrapT = THREE.RepeatWrapping;
bumpTexture.repeat.set(1, 1);
var m = new THREE.MeshPhongMaterial({map:landTexture, 
                                     ambient: 0x552811, 
                                     specular: 0x333333, 
                                     shininess: 25, 
                                     bumpMap: bumpTexture, 
                                     bumpScale: 1, 
                                     metal: false });

如果我注释掉 map:landTexture ,然后凹凸贴图比例是1.我能以某种方式混合这两个重复值吗?

If I comment out map:landTexture, then the bump map scale is 1. Can I mix these two repeat values somehow?

推荐答案

否。偏移和重复值默认为其中之一:

No. The offset and repeat values default to one of them:

// uv repeat and offset setting priorities
//  1. color map
//  2. specular map
//  3. displacement map
//  4. normal map
//  5. bump map
//  5. roughness map
//  5. metalness map
//  6. alpha map
//  7. emissive map

在您的情况下,这将是 landTexture 设置。

In your case, that would be the landTexture settings.

解决方法是修改纹理,或创建自定义 ShaderMaterial

The workaround is to modify your textures, or create a custom ShaderMaterial.

编辑:例外是光照贴图和环境遮挡贴图,每个使用第二组UV。这允许其他纹理比light / AO贴图具有更高的细节。

The exception is light map and ambient occlusion map, which each use the second set of UVs. This allows the other textures to be of higher detail than the light/AO map.

three.js r.84

three.js r.84

这篇关于一个three.js材质可以为凹凸贴图和纹理贴图分别设置重复值吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆