I am currently writing a compute shader, and I need to store arbitrary data to a buffer. The idea is to perform a massive agent simulation on the GPU. Each agent is pretty simple : position + angle.
However it does not seem possible (yet ?) to store arbitrary data to a buffer in TD.
As such, I decided to try using color buffers to store my data. However it seems that all my float values are being clamp between 0 and 1, which is sensible for colors but not quite what I want.
Here is a small snippet of the glsl part of my code which stores the simulation output :
vec4 data_out;
data_out.w = 0.0; // No need for w
data_out.z = agent.angle;
data_out.xy = new_pos;
imageStore(sTDComputeOutputs[0], ivec2(gl_GlobalInvocationID.xy), TDOutputSwizzle(data_out));
Finally, is anyone aware of where I could find the documentation of functions such as imageStore
, texelFetch
, etc. ? The wiki is not quite I would call a developer documentation…