1 attribute mediump vec2 aPosition;
2 uniform mediump mat4 uMvpMatrix; // DALi shader builtin
3 uniform mediump vec3 uSize; // DALi shader builtin
5 varying mediump vec2 vTexCoord;
6 varying mediump vec2 vRayCastCoord;
9 mediump vec4 vertexPosition = vec4(aPosition, 0.0, 1.0);
10 vertexPosition.xyz *= uSize;
12 // In this ray march example we supply the fragment shader with 0..1 UV texture co-ordinates
13 // incase someone wants to extend the code and add texture mapping to it.
14 // DALi geometry typically ranges from -0.5 to 0.5, hence the +0.5 to make it 0..1
16 vTexCoord = aPosition + vec2(0.5);
19 // Our UV texture co-ordinates for the quad geometry should now range from 0..1
30 // We're going to use the UV co-ordinates as our virtual screen / plane of projection on to our
33 // We first modify the range to be from -1,-1 to 1,1 with 0,0 in the centre. Then
34 // pass this as a varying value to the fragment shader.
44 // |_______|______|(1,1)
48 vRayCastCoord = (2.0 * vTexCoord ) - 1.0 ;
50 gl_Position = uMvpMatrix * vertexPosition;