driver

09-16-2013, 08:53 PM

Hi

I have two questions.

1.When I use imageStore to write to a image3D

layout (binding=0) uniform image3D myVol;

imageStore(myVol,TexCoord,vec4(1,0,0,0));

Here vec3 TexCoord are just coordinates generated by me based on some condition like position in a volume and it is a vector tuple of floating values.

I get an error saying:

error C1115: unable to find compatible overloaded function "imageStore(struct image3D,vec3,vec4):

I noticed that the definition of imageStore goes:

void imageStore(gimage3D image, ivec3 P, gvec4 data);

Does ivec3 mean that the coordinates are integers only? And if so, can i never be able to fill in values at intermediate coordinates like (0.3,0.3,0.3)?

2.I go through a grid and generate some vertices. I compute the texccordinates of the vertices alongside with the logic:

texcoord.x = vertex position.x/ length of grid in x axis

texcoord.y = vertex position.y/ length of grid in y axis

texcoord.z = vertex position.z/ length of grid in z axis

Is there a better way to compute the texture coordinates than doing it manually?

I have two questions.

1.When I use imageStore to write to a image3D

layout (binding=0) uniform image3D myVol;

imageStore(myVol,TexCoord,vec4(1,0,0,0));

Here vec3 TexCoord are just coordinates generated by me based on some condition like position in a volume and it is a vector tuple of floating values.

I get an error saying:

error C1115: unable to find compatible overloaded function "imageStore(struct image3D,vec3,vec4):

I noticed that the definition of imageStore goes:

void imageStore(gimage3D image, ivec3 P, gvec4 data);

Does ivec3 mean that the coordinates are integers only? And if so, can i never be able to fill in values at intermediate coordinates like (0.3,0.3,0.3)?

2.I go through a grid and generate some vertices. I compute the texccordinates of the vertices alongside with the logic:

texcoord.x = vertex position.x/ length of grid in x axis

texcoord.y = vertex position.y/ length of grid in y axis

texcoord.z = vertex position.z/ length of grid in z axis

Is there a better way to compute the texture coordinates than doing it manually?