I have been working on the challenges provided in the WebGL introductory book by Oreilly.
Encountered a runtime error with the following code snippet. After searching online, it seems like I am the only one facing this issue. Could you please assist me in finding out what's wrong?
var specularMap= THREE.ImageUtils.loadTexture("WebGLBook/images/earth_specular_2048.jpg");
var shader = THREE.ShaderUtils.lib[ "normal" ]; <-- encountering error
var uniforms = THREE.UniformsUtils.clone(shader.uniforms);
uniforms['tNormal'].texture = normalMap;
uniforms['tDiffuse'].texture = surfaceMap;
The mentioned lines are resulting in the following error message:
Uncaught TypeError: Cannot read property 'lib' of undefined solar-system-spec-map.html:60
Earth.createGlobe solar-system-spec-map.html:60
Earth.init solar-system-spec-map.html:51
EarthApp.init solar-system-spec-map.html:33
(anonymous function) solar-system-spec-map.html:93
deferred.resolveWith jquery-1.6.4.js:1016
jQuery.extend.ready jquery-1.6.4.js:437
DOMContentLoaded
This situation is peculiar as there is no mention of "ShaderUtils" in the official THREE.js documentation...
Please advise on what might be causing this confusion!