VR: Added barrel-distortion geometry for landscape orientation 22/83222/2
authorTom Robinson <tom.robinson@samsung.com>
Tue, 9 Aug 2016 13:05:46 +0000 (14:05 +0100)
committerTom Robinson <tom.robinson@samsung.com>
Tue, 9 Aug 2016 13:06:47 +0000 (14:06 +0100)
Change-Id: I52a38ce3daca9d6e76edf3d8e0b35eda9dfca9f5

dali/internal/render/common/renderer-vr.h

index c64fd29..e82db6b 100644 (file)
@@ -6,6 +6,8 @@
 #include <stdlib.h>
 #include <vector>
 
+//#define DEBUG_USE_HORIZONTAL_GEOMETRY
+
 namespace
 {
 
@@ -465,19 +467,33 @@ inline void GenerateGridVertexBuffer( std::vector<float>& vertexBuffer )
   {
     float* co = &vertexBuffer[i];
     float* uv = &vertexBuffer[i+3];
+
+#ifdef DEBUG_USE_HORIZONTAL_GEOMETRY
+    co[0] *= 0.5f;
+    co[0] -= 0.5f;
+    uv[0] *= 0.5f;
+#else
     co[1] -= 1.0f;
     co[1] *= 0.5f;
     uv[1] *= 0.5f;
+#endif
   }
 
   for( size_t i = N; i < N*2; i += 5 )
   {
     float* co = &vertexBuffer[i];
     float* uv = &vertexBuffer[i+3];
+
+#ifdef DEBUG_USE_HORIZONTAL_GEOMETRY
+    co[0] *= 0.5f;
+    co[0] += 0.5f;
+    uv[0] *= 0.5f;
+#else
     co[1] += 1.0f;
     co[1] *= 0.5f;
     uv[1] += 1.0f;
     uv[1] *= 0.5f;
+#endif
   }
 
   return;