summaryrefslogtreecommitdiff
path: root/src/opencl_mesh_kit.hpp
diff options
context:
space:
mode:
authorLudovic Pouzenc <ludovic@pouzenc.fr>2013-03-10 21:36:01 +0000
committerLudovic Pouzenc <ludovic@pouzenc.fr>2013-03-10 21:36:01 +0000
commitbec8869883710493ddf2fd88ae79c3befe41dc9b (patch)
tree44334361f538d0ed285a88bda5e1cc09e1bc4878 /src/opencl_mesh_kit.hpp
parent149388bfe5069aaefe7bbcd43cca59703e42531d (diff)
download2013-gpudataviz-bec8869883710493ddf2fd88ae79c3befe41dc9b.tar.gz
2013-gpudataviz-bec8869883710493ddf2fd88ae79c3befe41dc9b.tar.bz2
2013-gpudataviz-bec8869883710493ddf2fd88ae79c3befe41dc9b.zip
Debut implementation du refresh automatique (style game loop) si demandé (mouse1 down)
compil.sh : -lrt est nécessaire pour avoir des infos précises sur le timing (kernel exec time...) git-svn-id: file:///var/svn/2013-gpudataviz/trunk@22 371a6b4a-a258-45f8-9dcc-bdd82ce0ac9d
Diffstat (limited to 'src/opencl_mesh_kit.hpp')
-rw-r--r--src/opencl_mesh_kit.hpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/opencl_mesh_kit.hpp b/src/opencl_mesh_kit.hpp
index ee6bfa5..ac3cf46 100644
--- a/src/opencl_mesh_kit.hpp
+++ b/src/opencl_mesh_kit.hpp
@@ -56,13 +56,13 @@ const char kernel_src_zero_z[]=STRINGIFY(
/* calculate uv coordinates of the mesh point [0.0;1.0] */
float u = nx / (float) width;
float v = ny / (float) height;
- /* calculate centered coordinates [-0.5;0.5] */
- float x = (u*2-1)/2;
- float y = (v*2-1)/2;
- /* We only use normalized quaterinons here */
- float w = 1.0f;
+ /* calculate centered normalized coordinates [-1.0;1.0] */
+ float x = u*2.0-1.0;
+ float y = v*2.0-1.0;
/* Calculate the desirated value of the mesh point */
float z = 0.0f;
+ /* We only use normalized quaterinons here */
+ float w = 1.0f;
/* Write output vertex (centered) */
pos[ny*width+nx] = (float4)(x, y, z, w);
}