Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 11 Apr 2012
Offline Last Active Apr 11 2012 05:41 AM

Topics I've Started

Trying to generate data in a vbo using CUDA.. Help please

11 April 2012 - 05:31 AM


I'd like to ask.. Im trying to build a cuda-gl code that replicates the data present in the vbo and perturbs it by a little bit (just to see if this is working). The end goal is to tessellate uniformly using cuda-gl.
I have a vbo which is twice the size of the mesh currently. I'm spawning numFaces*3 cuda threads (one for each vertex) and would like each thread to copy the data present in the vertex corresponding to the x = blockID.x*blockDim.x + threadID.x into x+mesh_size and add a little offset to the x coordinate. the kernel looks like this:

__global__ void kernel(float3* pos, float3* norm, unsigned int mesh_size, float time)
	unsigned int x = blockIdx.x*blockDim.x + threadIdx.x;					
		pos[x+mesh_size].x += cosf(time);										  

The kernel has as input, two vbos, one for positions, one for normals.

The problem is that, if the above code works, i should ideally see two objects, one static and one moving, but I only seem to be able to see the first half of the vbo, ie. a single copy of the mesh.

Any help would be greatly appreciated as we're working on a deadline by our professor.