
const char* vs_2d = "#version 330 core\n"
                    "layout (location = 0) in vec3 aPos;\n"
                    "layout (location = 1) in vec3 aColor;\n"
                    "layout (location = 2) in vec2 aTexCoord;\n"
                    "out vec2 TexCoord;\n"
                    "void main()\n"
                    "{\n"
                    "   gl_Position = vec4(aPos.x, aPos.y, aPos.z, 1.0);\n"
                    "   TexCoord = aTexCoord;\n"
                    "}\0";
const char* fs_2d = "#version 330 core\n"
                    "in vec2 TexCoord;\n"
                    "uniform sampler2D ourTexture;\n"
                    "layout (location = 0) out vec4 FragColor;\n"

                    "void main()\n"
                    "{\n"
                    "   FragColor = texture(ourTexture, TexCoord);\n"
                    "   FragColor.a = 1.0;\n"
                    "}\n\0";

const char* fs_2d_trans = "#version 330 core\n"
                          "in vec2 TexCoord;\n"
                          "uniform sampler2D ourTexture;\n"
                          "layout (location = 0) out vec4 FragColor;\n"

                          "void main()\n"
                          "{\n"
                          "   FragColor = texture(ourTexture, TexCoord);\n"
                          "   FragColor.a = 1.0;\n"
                          "   if (FragColor.r == 0 && FragColor.g == 0 && FragColor.b == 0) {\n"
                          "     discard;\n"
                          "   }\n"
                          "}\n\0";

// const char* vs_3d = "#version 330 core\n"
//                     "layout (location = 0) in vec3 aPos;\n"
//                     "layout (location = 1) in vec3 aNormal;\n"
//                     "\n"
//                     "out vec3 Normal;\n"
//                     "\n"
//                     "uniform mat4 model;\n"
//                     "uniform mat4 view;\n"
//                     "uniform mat4 projection;\n"
//                     "void main()\n"
//                     "{\n"
//                     "   Normal = aNormal;\n"
//                     "   gl_Position = projection * view * model * vec4(aPos,1);\n"
//                     "}\0";

// const char* fs_3d = "#version 330 core\n"
//                     "in vec3 Normal;\n"
//                     "\n"
//                     "out vec4 FragColor;\n"
//                     "\n"
//                     "uniform vec3 lightPos;\n"
//                     "uniform vec3 lightColor;\n"
//                     "uniform vec3 objectColor;\n"
//                     "void main()\n"
//                     "{\n"
//                     "    vec3 normal2 = normalize(Normal);\n"
//                     "    float light = dot(normal2, normalize(lightPos));\n"
//                     "    FragColor = vec4(1,1,1,1);\n"
//                     "    FragColor.rgb *= light;\n"
//                     "}\n\0";

const char* vs_3d = "#version 330 core\n"
                    "layout (location = 0) in vec3 aPos;\n"
                    "layout (location = 1) in vec3 aNormal;\n"
                    "\n"
                    "out vec3 FragPos;\n"
                    "out vec3 Normal;\n"
                    "\n"
                    "uniform mat4 model;\n"
                    "uniform mat4 view;\n"
                    "uniform mat4 projection;\n"
                    "void main()\n"
                    "{\n"
                    "   FragPos = vec3(model * vec4(aPos, 1.0));\n"
                    "   Normal = aNormal;\n"
                    "   gl_Position = projection * view * vec4(FragPos, 1.0);\n"
                    "}\0";

const char* fs_3d = "#version 330 core\n"
                    "in vec3 Normal;\n"
                    "in vec3 FragPos;\n"
                    "\n"
                    "out vec4 FragColor;\n"
                    "\n"
                    "uniform vec3 lightPos;\n"
                    "uniform vec3 lightColor;\n"
                    "uniform vec3 objectColor;\n"
                    "void main()\n"
                    "{\n"
                    "    // ambient\n"
                    "    float ambientStrength = 0.6;\n"
                    "    vec3 ambient = ambientStrength * lightColor;\n"
                    "    // diffuse \n"
                    "    vec3 norm = normalize(Normal);\n"
                    "    vec3 lightDir = normalize(lightPos - FragPos);\n"
                    "    float diff = max(dot(norm, lightDir), 0.0);\n"
                    "    vec3 diffuse = diff * lightColor;\n"
                    "    vec3 result = (ambient + diffuse) * objectColor;\n"
                    "    FragColor = vec4(result, 1.0);\n"
                    "}\n\0";
