Fixed ES shaders so they work with OpenGL ES 3.0

This commit is contained in:
Lukas Matena 2024-02-29 15:25:59 +01:00
parent 5669decd98
commit c652c1e1f4
3 changed files with 4 additions and 2 deletions

View File

@ -213,4 +213,4 @@ extern Color lerp(const Color& c1, const Color& c2, float t);
} // namespace libvgcode
#endif // VGCODE_TYPES_HPP
#endif // VGCODE_TYPES_HPP

View File

@ -45,4 +45,4 @@ private:
} // namespace libvgcode
#endif // VGCODE_OPENGLUTILS_HPP
#endif // VGCODE_OPENGLUTILS_HPP

View File

@ -12,6 +12,7 @@ namespace libvgcode {
static const char* Segments_Vertex_Shader_ES =
"#version 300 es\n"
"precision lowp usampler2D;\n"
"#define POINTY_CAPS\n"
"#define FIX_TWISTING\n"
"const vec3 light_top_dir = vec3(-0.4574957, 0.4574957, 0.7624929);\n"
@ -156,6 +157,7 @@ static const char* Segments_Fragment_Shader_ES =
static const char* Options_Vertex_Shader_ES =
"#version 300 es\n"
"precision lowp usampler2D;\n"
"const vec3 light_top_dir = vec3(-0.4574957, 0.4574957, 0.7624929);\n"
"const float light_top_diffuse = 0.6 * 0.8;\n"
"const float light_top_specular = 0.6 * 0.125;\n"