Three.js ColladaLoader的bumpScale/权重?调整凹凸贴图强度的方法 [英] Three.js ColladaLoader bumpScale/weighting? Way to adjust bump map intensity

查看:195
本文介绍了Three.js ColladaLoader的bumpScale/权重?调整凹凸贴图强度的方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在当前的ColladaLoader.js中,我看不到任何读取或应用Collada标准的权重"值(0.0-1.0)的值,该值指示Three.js Phong材质中的碰撞强度或"bumpScale".我注意到,当我从Blender导出我的collada时,它会立即在three.js中拾取凹凸材料(这非常简单-是!),但是我的材质始终会得到默认值为1.0的夸张的凹凸比例.它给材料带来了夸张的颠簸感.

In the current ColladaLoader.js I don't see anything that reads or applies the Collada standard's "weighting" value (0.0-1.0) that indicates bump intensity or "bumpScale" in Three.js Phong material. I noticed that when I export my collada from Blender it picks up the bump materials instantly in three.js (which is amazingly simple - YAY!) but my materials always get an exaggerated bumpScale of default 1.0. It gives the materials an exaggerated bumpiness.

我设法编辑了ColladaLoader并尝试了理想值(0.05),但是想知道我是否丢失了某些东西或做错了吗?还有其他人尝试吗?请注意,我对json导出的运气还不太好,所以我现在仍然坚持使用Collada.

I managed to edit my ColladaLoader a bit and try out my ideal value (0.05) but wonder if I'm missing something or doing this wrong? Anybody else try this? Note that I've not had good luck with json exports so I'm sticking with Collada for now.

谢谢

推荐答案

您可以在Collada回调中设置自定义属性.使用这样的模式:

You can set custom properties in the Collada callback. Use a pattern like this one:

loader.load( 'collada.dae', function ( collada ) {

        var dae = collada.scene;

        dae.traverse( function( child ) {

            if( child instanceof THREE.Mesh ) {

                child.material.bumpScale = value;

            }

        } );

        scene.add( dae );

} );

three.js r.71

three.js r.71

这篇关于Three.js ColladaLoader的bumpScale/权重?调整凹凸贴图强度的方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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