Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

earth-shader.js - Does not render ShaderMaterial() #4

Open
FullstackJack opened this issue Dec 18, 2012 · 1 comment
Open

earth-shader.js - Does not render ShaderMaterial() #4

FullstackJack opened this issue Dec 18, 2012 · 1 comment

Comments

@FullstackJack
Copy link

After updating my Sim.js with the objectIntersects() method call, I was able to get earth-lit.js to work, however, the next example, earth-shader.js, does not render properly. Using the custom ShaderMaterial(), it only renders the clouds. When I switch that chunk of code for a MeshPhongMaterial() as coded in earth-lit.js, I'm able to render the earth surface, of course without specularity and bump map. Something is wrong with the ShaderMaterial() setup.
earth-shader js_clouds

@jlehto
Copy link

jlehto commented Jan 16, 2013

The book's code works if you use the older Three.js in the libs folder.
Starting from r50 upwards, it's much simpler, just set the maps as properties of MeshPhongMaterial, like this:
var material = new THREE.MeshPhongMaterial({
map: earthSurfaceMap,
normalMap: earthNormalMap,
specularMap: earthSpecularMap});
that's it, no need of uniforms or computeTangents().

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants