[Solved] How to make an interpolated Triangle w/ vertex & pixel shaders?
Posted: Sun Jan 22, 2023 7:40 pm
I've been trying to make one of those interpolated triangles that has 3 main colors at the vertices of a triangle: Red, Green and Blue. However, I have absolutely no idea how to implement this in Love2D with GLSL. I'm trying to follow a tutorial that is focused on OpenGL and GLSL and all of those other libraries and they go from Vertex Shader to Fragment Shader and that somehow interpolates some color. However, since I can't use the "in" and "out" keywords, I really just don't know how to make this. The code also uses gl_VertexID which doesn't seem to work either. Next to that, when I try to make an int value, it asks for it to be a "flat in" if I put it under: "#ifdef PIXEL", but when I add it infront of my constructor I get "Unexpected Identifier" with "flat in int MyInteger;". Everything is just a mess and it's only getting worse! Help is very much appreciated. Since I'm new to using shaders and love2d I might have made a dumb mistake. I don't know if I'm allowed to link the tutorial so I didn't include the link. I believe there was another post with the same topic, but there was not a solution for it and maybe there is one now. I'm trying to make a 3D renderer btw. So I first transform my triangles using the vertex shader, but then I want to add those interpolated colors, just like the tutorial.