summaryrefslogtreecommitdiffhomepage
path: root/examples/shaders/shaders_fog.c
diff options
context:
space:
mode:
authorRay <[email protected]>2020-03-02 13:27:54 +0100
committerRay <[email protected]>2020-03-02 13:27:54 +0100
commit485787059a00e54287f465464ce6e430fe9488c6 (patch)
treeb21425bbdd37196c3237cd7fe832d1994b634b7e /examples/shaders/shaders_fog.c
parent08615d3247c46aebd21ad8a9efc2c158c1b4b922 (diff)
downloadraylib-485787059a00e54287f465464ce6e430fe9488c6.tar.gz
raylib-485787059a00e54287f465464ce6e430fe9488c6.zip
Review shader exaples to work on web (GLSL 100)
Diffstat (limited to 'examples/shaders/shaders_fog.c')
-rw-r--r--examples/shaders/shaders_fog.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/examples/shaders/shaders_fog.c b/examples/shaders/shaders_fog.c
index e8f2691d..53fd9407 100644
--- a/examples/shaders/shaders_fog.c
+++ b/examples/shaders/shaders_fog.c
@@ -32,6 +32,12 @@
#define RLIGHTS_IMPLEMENTATION
#include "rlights.h"
+#if defined(PLATFORM_DESKTOP)
+ #define GLSL_VERSION 330
+#else // PLATFORM_RPI, PLATFORM_ANDROID, PLATFORM_WEB
+ #define GLSL_VERSION 100
+#endif
+
int main(void)
{
// Initialization
@@ -61,7 +67,8 @@ int main(void)
modelC.materials[0].maps[MAP_DIFFUSE].texture = texture;
// Load shader and set up some uniforms
- Shader shader = LoadShader("resources/shaders/glsl330/fog.vs", "resources/shaders/glsl330/fog.fs");
+ Shader shader = LoadShader(FormatText("resources/shaders/glsl%i/base_lighting.vs", GLSL_VERSION),
+ FormatText("resources/shaders/glsl%i/fog.fs", GLSL_VERSION));
shader.locs[LOC_MATRIX_MODEL] = GetShaderLocation(shader, "matModel");
shader.locs[LOC_VECTOR_VIEW] = GetShaderLocation(shader, "viewPos");