2
0
linbingquan 6 жил өмнө
parent
commit
99a213e2b6

+ 11 - 2
src/materials/ShaderMaterial.js

@@ -31,8 +31,17 @@ function ShaderMaterial( parameters ) {
 	this.defines = {};
 	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;