- <Shader>
- <Uniforms>
- <Uniform type="mat4" name="modelViewMatrix"/>
- </Uniforms>
- <Vertex>
- <Attributes>
- <Attribute type="vec3" name="position" binding="Position"/>
- <Attribute type="vec3" name="normal" binding="Normals"/>
- <!--<Attribute type="vec4" name="color" binding="Color"/>-->
- </Attributes>
- <Code><![CDATA[
- attribute vec3 position;
- attribute vec3 normal;
- varying vec4 colorVarying;
- uniform mat4 modelViewMatrix;
- void main()
- {
- gl_Position = modelViewMatrix * vec4(position.xyz, 1.0);
- float z = gl_Position.z / 100.0;
- colorVarying = vec4(z, z, z, 1.0) ;
- }
- ]]></Code>
- </Vertex>
- <Pixel>
- <Code><![CDATA[
- varying lowp vec4 colorVarying;
- void main()
- {
- gl_FragColor = colorVarying;
- }
- ]]></Code>
- </Pixel>
- </Shader>