Add default vertex/fragment shader to OpenGL ES 3.0 based on the ones from OpenGL 3.3 (#4178)
Some checks are pending
Android / build (arm64) (push) Waiting to run
Android / build (x86_64) (push) Waiting to run
CMakeBuilds / Windows Build (push) Waiting to run
CMakeBuilds / Linux Build (push) Waiting to run
Linux / build (i386, i386, /user/bin, 32) (push) Waiting to run
Linux / build (x86_64, amd64, /user/bin, 64) (push) Waiting to run
Linux Examples / build (push) Waiting to run
macOS / build (push) Waiting to run
WebAssembly / build (push) Waiting to run
Windows / build (i686, pe-i386, 32, mingw-w64) (push) Waiting to run
Windows / build (x64, x64, 64, msvc16) (push) Waiting to run
Windows / build (x86, Win32, 32, msvc16) (push) Waiting to run
Windows / build (x86_64, pe-x86-64, 64, mingw-w64) (push) Waiting to run
Windows Examples / build (push) Waiting to run

This commit is contained in:
Lázaro Albuquerque 2024-07-23 15:10:23 -04:00 committed by GitHub
parent 30f9ca7eb6
commit bbcb0109e1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -4756,7 +4756,16 @@ static void rlLoadShaderDefault(void)
"out vec2 fragTexCoord; \n"
"out vec4 fragColor; \n"
#endif
#if defined(GRAPHICS_API_OPENGL_ES2)
#if defined(GRAPHICS_API_OPENGL_ES3)
"#version 300 es \n"
"precision mediump float; \n" // Precision required for OpenGL ES3 (WebGL 2) (on some browsers)
"in vec3 vertexPosition; \n"
"in vec2 vertexTexCoord; \n"
"in vec4 vertexColor; \n"
"out vec2 fragTexCoord; \n"
"out vec4 fragColor; \n"
#elif defined(GRAPHICS_API_OPENGL_ES2)
"#version 100 \n"
"precision mediump float; \n" // Precision required for OpenGL ES2 (WebGL) (on some browsers)
"attribute vec3 vertexPosition; \n"
@ -4765,6 +4774,7 @@ static void rlLoadShaderDefault(void)
"varying vec2 fragTexCoord; \n"
"varying vec4 fragColor; \n"
#endif
"uniform mat4 mvp; \n"
"void main() \n"
"{ \n"
@ -4799,7 +4809,21 @@ static void rlLoadShaderDefault(void)
" finalColor = texelColor*colDiffuse*fragColor; \n"
"} \n";
#endif
#if defined(GRAPHICS_API_OPENGL_ES2)
#if defined(GRAPHICS_API_OPENGL_ES3)
"#version 300 es \n"
"precision mediump float; \n" // Precision required for OpenGL ES3 (WebGL 2)
"in vec2 fragTexCoord; \n"
"in vec4 fragColor; \n"
"out vec4 finalColor; \n"
"uniform sampler2D texture0; \n"
"uniform vec4 colDiffuse; \n"
"void main() \n"
"{ \n"
" vec4 texelColor = texture(texture0, fragTexCoord); \n"
" finalColor = texelColor*colDiffuse*fragColor; \n"
"} \n";
#elif defined(GRAPHICS_API_OPENGL_ES2)
"#version 100 \n"
"precision mediump float; \n" // Precision required for OpenGL ES2 (WebGL)
"varying vec2 fragTexCoord; \n"