javascript - Three.js uniforms for shading -


hi trying seems simple shading threejs. using , running book o'reilly.

everything working fine, until tried this:

                var shader = three.shaderlib["normal"];             var uniforms = three.uniformsutils.clone(shader.uniforms);              uniforms["tnormal"].texture = normalmap;             uniforms["tdiffuse"].texture = surfacemap;             uniforms["tspecular"].texture = specularmap; 

this keeps throwing error:

typeerror: uniforms.normal undefined [break on error]

uniforms["normal"].texture = normalmap;

i have been looking around online while , not sure syntax needs change solve issue.

any appreciated.

i think should like:

uniforms["tnormal"] = {     texture: normalmap }; 

same tdiffuse, tspecular.


Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -