field lookup on GPU ??
I’m preparing a new project and when surveying the options I was wondering if such a thing as field lookup is possible on the GPU.
I was imagining some kind of agents based model where agents can be gently pushed by a field that they are helping to shape. For this to work on the GPU I’d need some way that the output of a fragment shader can be input to a vertex shader, ideally in the form of texture values at vertex locations.
Am I imagining a holy grail here ? I suppose this is not possible because I’d imagine it would have been all over the place ?
there is this thread discussing particle systems inside shaders:
For what you want to do I would rather use java or c. Do you want to apply any specific algorithm to the model?
what you need is probably not what I imagine, but on the modern nvidia/ati graphic cards it’s totally possible to sample a texture within a vertex shader.
It works the same way it works in fragment shader – vec4 c = texture2DRect(tex0, texcoord0).
let me know if you need more info!
I would declare textures on the vertex shader in the case of a displacement map(correct me if I am wrong please!) but I am not sure if that is the best way to get an agent based model.
Otherwise, using texturing within the vertex shader is called ‘Vertex Texture Fetch’