Browse Source

Merge pull request #15688 from linbingquan/glsl-shader

Shader: glsl comment tag
Mr.doob 6 years ago
parent
commit
d5779c25f1
1 changed files with 11 additions and 2 deletions
  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;