Three.js Source Note (58) Material/rawshadermaterial.js

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.