I'm using OpenGL to display 3d model files such as stl and obj via Assimp.
I have a file containing a set of points and a corresponding value (not necessarily on the object) and I'd like to color each vertex of the shape based on where it lies in the range of all values.
My current plan is to open a .txt file from my .vert or .frag file and just color the vertices that way. However, it's not clear to me how the syntax of GLSL differs from that of C++. Can I use similar syntax to open the file and just use the values all via the .vert file? Is there another way to do it?
You cannot read data from file from OpenGL Shaders. What you can do is read the data in your cpp code and bind a data as attribute or uniform. If the data is very large, then you can send it as a texture.