Issue upgrading threejs with shaders

冷暖自知 提交于 2020-01-06 19:10:26

问题


I am working on a 3d dataviz. I need to show a world with data on it and I using the chrome experiments (chromeexperiments.com/globe) as a guide.

The issue is that this visualizations are made with Threejs r40 and it is hard to find docs about it so I tried to upgrade to r71.

I solved the compatibility issues rendering the world but cant make it show the atmosphere, in fact, when I try to show the atmosphere nothing is shown (is like the atmosphere is rendered black and it hides the world).

I think that the problem is the shader but I am not really sure.

Does anybody have a clue?

This is the code I am using:

gist.github.com/glena/0b2875044cd6c39ff150

Thanks

==========

Update:

if I remove the fragentShader, this is rendered as a red sphere but stills covers the world with a black background:

 var mesh = new THREE.Mesh(new THREE.SphereGeometry(100, 40, 30), 
        new THREE.ShaderMaterial({

          uniforms: uniforms,
          vertexShader: shader.vertexShader

        })
      );

回答1:


The issue (as said by @WestLangley) was

mesh.flipSided = true; ==> mesh.material.side = THREE.BackSide;


来源:https://stackoverflow.com/questions/30538512/issue-upgrading-threejs-with-shaders

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!