Jump to content

  • Log In with Google      Sign In   
  • Create Account


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


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
No replies to this topic

#1 kramer13   Members   -  Reputation: 100

Like
0Likes
Like

Posted 11 April 2012 - 05:31 AM

Hi

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;					
																			
	time=time;
	if(x<mesh_size)																
	{  
		pos[x+mesh_size]=pos[x];
		pos[x+mesh_size].x += cosf(time);										  
		norm[x+mesh_size]=norm[x];												
  
	}																		
}

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.

Sponsor:



Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS