From 3876f19d6a385001a4238ec27bcf3d7643dd190f Mon Sep 17 00:00:00 2001 From: raysan5 Date: Tue, 12 Jul 2016 01:54:47 +0200 Subject: [PATCH] Corrected some issues on OpenGL ES --- examples/Makefile | 5 +++-- examples/models_obj_loading.c | 2 +- examples/resources/shaders/glsl100/grayscale.fs | 4 ++-- examples/resources/shaders/glsl100/swirl.fs | 8 ++++---- examples/resources/shaders/glsl330/swirl.fs | 6 +++--- 5 files changed, 13 insertions(+), 12 deletions(-) diff --git a/examples/Makefile b/examples/Makefile index 711f03a70..d20e229b7 100644 --- a/examples/Makefile +++ b/examples/Makefile @@ -120,8 +120,9 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP) # libraries for Debian GNU/Linux desktop compiling # requires the following packages: # libglfw3-dev libopenal-dev libegl1-mesa-dev - LIBS = -lraylib -lglfw3 -lGL -lopenal -lm -pthread -ldl -lX11 \ - -lXrandr -lXinerama -lXi -lXxf86vm -lXcursor + LIBS = -lraylib -lglfw3 -lGL -lopenal -lm -pthread -ldl + # on XWindow could require also below libraries, just uncomment + #LIBS += -lX11 -lXrandr -lXinerama -lXi -lXxf86vm -lXcursor else ifeq ($(PLATFORM_OS),OSX) # libraries for OS X 10.9 desktop compiling diff --git a/examples/models_obj_loading.c b/examples/models_obj_loading.c index a6969f705..50d42d2e2 100644 --- a/examples/models_obj_loading.c +++ b/examples/models_obj_loading.c @@ -49,7 +49,7 @@ int main() DrawModel(dwarf, position, 2.0f, WHITE); // Draw 3d model with texture - DrawGrid(10, 1.0f); // Draw a grid + DrawGrid(10, 1.0f); // Draw a grid DrawGizmo(position); // Draw gizmo diff --git a/examples/resources/shaders/glsl100/grayscale.fs b/examples/resources/shaders/glsl100/grayscale.fs index cf8574881..15174ea57 100644 --- a/examples/resources/shaders/glsl100/grayscale.fs +++ b/examples/resources/shaders/glsl100/grayscale.fs @@ -8,14 +8,14 @@ varying vec4 fragColor; // Input uniform values uniform sampler2D texture0; -uniform vec4 fragTintColor; +uniform vec4 colDiffuse; // NOTE: Add here your custom variables void main() { // Texel color fetching from texture sampler - vec4 texelColor = texture2D(texture0, fragTexCoord)*fragTintColor*fragColor; + vec4 texelColor = texture2D(texture0, fragTexCoord)*colDiffuse*fragColor; // Convert texel color to grayscale using NTSC conversion weights float gray = dot(texelColor.rgb, vec3(0.299, 0.587, 0.114)); diff --git a/examples/resources/shaders/glsl100/swirl.fs b/examples/resources/shaders/glsl100/swirl.fs index 0d6d24f26..ca7668b29 100644 --- a/examples/resources/shaders/glsl100/swirl.fs +++ b/examples/resources/shaders/glsl100/swirl.fs @@ -8,7 +8,7 @@ varying vec4 fragColor; // Input uniform values uniform sampler2D texture0; -uniform vec4 fragTintColor; +uniform vec4 colDiffuse; // NOTE: Add here your custom variables @@ -18,7 +18,7 @@ const float renderHeight = 480.0; // Use uniforms instead... float radius = 250.0; float angle = 0.8; -uniform vec2 center = vec2(200.0, 200.0); +uniform vec2 center; void main() { @@ -39,7 +39,7 @@ void main() } tc += center; - vec3 color = texture2D(texture0, tc/texSize).rgb; + vec4 color = texture2D(texture0, tc/texSize)*colDiffuse*fragColor;; - gl_FragColor = vec4(color, 1.0);; + gl_FragColor = vec4(color.rgb, 1.0);; } \ No newline at end of file diff --git a/examples/resources/shaders/glsl330/swirl.fs b/examples/resources/shaders/glsl330/swirl.fs index 80c16cc9e..5d238ac93 100644 --- a/examples/resources/shaders/glsl330/swirl.fs +++ b/examples/resources/shaders/glsl330/swirl.fs @@ -6,7 +6,7 @@ in vec4 fragColor; // Input uniform values uniform sampler2D texture0; -uniform vec4 fragTintColor; +uniform vec4 colDiffuse; // Output fragment color out vec4 finalColor; @@ -40,7 +40,7 @@ void main() } tc += center; - vec3 color = texture(texture0, tc/texSize).rgb; + vec4 color = texture2D(texture0, tc/texSize)*colDiffuse*fragColor;; - finalColor = vec4(color, 1.0);; + finalColor = vec4(color.rgb, 1.0);; } \ No newline at end of file