[Sidefx-houdini-list] HDK : fastest way to update lots of points ?

Vincent Houzé vince.houze at gmail.com
Tue Apr 26 19:29:59 EDT 2011


Hi,

I'm making a particles system plugin with cuda.
Example vids : http://www.vimeo.com/22916953

As long as everything stays on the GPU, it's really fast as expected,
but copying the points positions to Houdini points slow things quite a
bit. Right now I'm doing

cu::cudaMemcpy( particlesSystem->host_pos, particlesSystem->dev_pos,
	particlesSystem->nParts*sizeof(cu::float3), cu::cudaMemcpyDeviceToHost );

GEO_Point* ppt;
int i = 0;
UT_Vector4		p;

FOR_ALL_GPOINTS(gdp, ppt) {
ppt->getPos() =
UT_Vector4(particlesSystem->host_pos[i*3],particlesSystem->host_pos[i*3+1],
particlesSystem->host_pos[i*3+2], 1);
i++;
}

and the for loop is taking a lot of time for a few millions particles.

In the help, for attributes, there is mention of:

set<T>(const GB_AttributeRef &h, const T *array, int count)
Set an array of data all at once
Examples:
        float   life[2];
        ppt->set<float>(life_id, life, 2);

but I couldn't find anything similar for points positions.

Thanks a lot for any help,
Vincent



More information about the Sidefx-houdini-list mailing list