Commercial Territory (http://blog.csdn.net/omni360/)
This article follows "Attribution-non-commercial use-consistent" authoring public agreement
Reprint Please keep this sentence: Business Domain-this blog focuses on Agile development and mobile and IoT device research: Data visualization, Golang, HTML5, WEBGL, three. JS, Otherwise, from this blog article refused to reprint or reprint, thank you for your cooperation.
I was just beginning to learn, a lot of things are definitely wrong and please forgive me.
The following code is a comment for the materials/rawshadermaterial.js file in the three.js source file.
More updates in: Https://github.com/omni360/three.js.sourcecode
/** * @author mrdoob/http://mrdoob.com/*//*///rawshadermaterial method creates a material type for a custom shader based on the parameter parameters, such that the material object allows the user to expand the material type, With infinite possibilities. This class works like shadermaterial///, except that custom uniforms and attribute properties are not automatically appended to the GLSL shader code. The format of the///parameters parameter is seen above. The function of the Shadermaterial object is implemented by defining the function prototype object constructed. Most attribute methods inherit from the base class of the material shadermaterial.//////example:///var material = new three. Rawshadermaterial ({///uniforms: {///time:{type: "F", value:new three. Vector2 ()}///},///vertexshader:document.getelementbyid (' VertexShader '). Textcontent,///fragmentshader: document.getElementById (' Fragmentshader '). textcontent///});///*////<summary>rawshadermaterial</ Summary>///<param name = "Parameters" type= "String" >string type JSON format material property parameter </param>///<returns type = "Rawshadermaterial" > returns rawshadermaterial to create a material type </returns>three for the custom shader. rawshadermaterial = function (parameters) {three. Shadermaterial.call (this, parameters);//Call method of the Shadermaterial object is called, the method that originally belongs to Shadermaterial is given to the current object shadermaterial to use .};/ *********************************The following is the method property definition for the Rawshadermaterial object, inherited from the shadermaterial******************************* /three. Rawshadermaterial.prototype = Object.create (three. Shadermaterial.prototype);/*clone method///clone Method Clone Rawshadermaterial object, *////<summary>clone</summary>// /<param name = "Material" type= "rawshadermaterial" >rawshadermaterial object, optional. </param>///<returns type = "Rawshadermaterial" > returns the cloned Rawshadermaterial object </returns>three. RawShaderMaterial.prototype.clone = function () {//The following is a copy of the properties of the material, var material = new three. Rawshadermaterial (); Three. ShaderMaterial.prototype.clone.call (this, material); return material;//returns the cloned Rawshadermaterial object};
Commercial Territory (http://blog.csdn.net/omni360/)
This article follows "Attribution-non-commercial use-consistent" authoring public agreement
Reprint Please keep this sentence: Business Domain-this blog focuses on Agile development and mobile and IoT device research: Data visualization, Golang, HTML5, WEBGL, three. JS, Otherwise, from this blog article refused to reprint or reprint, thank you for your cooperation.
The following code is a comment for the materials/rawshadermaterial.js file in the three.js source file.
More updates in: Https://github.com/omni360/three.js.sourcecode
Three.js Source Note (58) Material/rawshadermaterial.js