I’ve to do some intensive computations in some vertices of some shapes but I just need to get the results back to an array to avoid recalculations and the attributes of these vertices remain constants, I mean, I just will read their positions, normals, etc, but I’ll not change any of these values.
The question is can I use GLSL to realize the calculations and get back the results to an array?
Enable Transform Feedback, disable the rasterizer and catch the vertex/geometry shader outputs into the destination VBO(s).
I haven’t use VBO yet so I don’t know if it’s suitable for what I want.
In fact the result I want to get back from the GLSL vertex shader is the distance from each vertex of my shapes (mostly rectangles or any planar spline) to one point (out of the plane).
Can I use VBO’s to store all the distances returned by the vertex shader?
In fact the result I want to get back from the GLSL vertex shader is the distance from each vertex of my shapes (mostly rectangles or any planar spline) to one point (out of the plane).
If that’s all you’re interested in, you can just compute it when rendering. This is not a slow calculation for a GPU.