美文网首页
37three.js 环境反射贴图

37three.js 环境反射贴图

作者: 狂暴机甲 | 来源:发表于2018-07-02 17:33 被阅读0次
    图片.png

    .envMap : TextureCube

    The environment map. Default is null. Note that in order for the material roughness property to correctly blur out the environment map, the shader must have access to mipmaps of the env texture. TextureCubes created with default settings are correctly configured; if adjusting texture parameters manually, ensure minFilter is set to one of the MipMap options, and that mip maps have not been otherwise forcibly disabled.
    一个简单的天空盒子。要配置好对于的全景图,我这里以为测试所以用的是同一张照片。
    可以将该纹理设置为scene的背景,这样可以方便观察效果。
    当用作其他模型的时候只需要设置envMap 就可以了。

    material.envMap = textureCube;

    //天空盒子
            function skyCube() {
                var r = "skybox/";
                var urls = [ r + "nx.jpg", r + "nx.jpg",
                    r + "nx.jpg", r + "nx.jpg",
                    r + "nx.jpg", r + "nx.jpg" ];
    
                textureCube = new THREE.CubeTextureLoader().load( urls );
                textureCube.format = THREE.RGBFormat;
                textureCube.mapping = THREE.CubeReflectionMapping;
                //scene.background = textureCube;
            }
    

    相关文章

      网友评论

          本文标题:37three.js 环境反射贴图

          本文链接:https://www.haomeiwen.com/subject/rmbluftx.html