Browse Source

Default shader code for ShaderMaterial.

Mr.doob 11 years ago
parent
commit
b1ffd7f468
1 changed files with 2 additions and 2 deletions
  1. 2 2
      src/materials/ShaderMaterial.js

+ 2 - 2
src/materials/ShaderMaterial.js

@@ -33,8 +33,8 @@ THREE.ShaderMaterial = function ( parameters ) {
 
 	THREE.Material.call( this );
 
-	this.fragmentShader = 'void main() {}';
-	this.vertexShader = 'void main() {}';
+	this.fragmentShader = 'void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}';
+	this.vertexShader = 'void main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}';
 	this.uniforms = {};
 	this.defines = {};
 	this.attributes = null;