浏览代码

add glsl comment tag

linbingquan 6 年之前
父节点
当前提交
99a213e2b6
共有 1 个文件被更改,包括 11 次插入2 次删除
  1. 11 2
      src/materials/ShaderMaterial.js

+ 11 - 2
src/materials/ShaderMaterial.js

@@ -31,8 +31,17 @@ function ShaderMaterial( parameters ) {
 	this.defines = {};
 	this.defines = {};
 	this.uniforms = {};
 	this.uniforms = {};
 
 
-	this.vertexShader = 'void main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}';
-	this.fragmentShader = 'void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}';
+	this.vertexShader = /* glsl */ `
+	void main() {
+		gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
+	}
+	`;
+
+	this.fragmentShader = /* glsl */ `
+	void main() {
+		gl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );
+	}
+	`;
 
 
 	this.linewidth = 1;
 	this.linewidth = 1;