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
Post a Comment