Three JS Map Material causes WebGL Warning

后端 未结 2 1250
心在旅途
心在旅途 2020-12-17 01:47

I\'m trying to define a material to meshes I loaded in from OBJLoader through the following wrapper function:

function applyTexture(src){
    var texture = n         


        
相关标签:
2条回答
  • 2020-12-17 02:06

    With WebGLRenderer, you can't switch from a material without a texture, to a material with a texture, after the mesh has been rendered once. This is because, without an initial texture, the geometry will not have the necessary baked-in WebGL UV buffers.

    A work-around is to begin with a material having a simple white texture.

    UPDATE: Alternatively, you can begin with a textureless material, and then set the following flags when a texture is added:

    material.needsUpdate = true;
    geometry.buffersNeedUpdate = true;
    geometry.uvsNeedUpdate = true;
    

    three.js r.58

    0 讨论(0)
  • 2020-12-17 02:11

    I also got this error while loading a scene from blender. For me the problem was fixed when unwrapping the uv's for each mesh i want to have a texture on.

    0 讨论(0)
提交回复
热议问题