From 33d14c3832b21b252d94718ee8a9ed6c50bab385 Mon Sep 17 00:00:00 2001 From: devdad Date: Tue, 19 Nov 2024 17:53:31 +0100 Subject: [PATCH] Update shader_basic_pbr example to work on web changed to GLSL_VERSION 100 update glsl100 shader set float precision to highp removed keyword in change for loop tu use constant value gives an error --- .../shaders/resources/shaders/glsl100/pbr.fs | 16 ++++++++-------- examples/shaders/shaders_basic_pbr.c | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/examples/shaders/resources/shaders/glsl100/pbr.fs b/examples/shaders/resources/shaders/glsl100/pbr.fs index 1ada83317..27d496968 100644 --- a/examples/shaders/resources/shaders/glsl100/pbr.fs +++ b/examples/shaders/resources/shaders/glsl100/pbr.fs @@ -1,6 +1,6 @@ #version 100 -precision mediump float; +precision highp float; #define MAX_LIGHTS 4 #define LIGHT_DIRECTIONAL 0 @@ -17,12 +17,12 @@ struct Light { }; // Input vertex attributes (from vertex shader) -varying in vec3 fragPosition; -varying in vec2 fragTexCoord; -varying in vec4 fragColor; -varying in vec3 fragNormal; -varying in vec4 shadowPos; -varying in mat3 TBN; +varying vec3 fragPosition; +varying vec2 fragTexCoord; +varying vec4 fragColor; +varying vec3 fragNormal; +varying vec4 shadowPos; +varying mat3 TBN; // Input uniform values @@ -113,7 +113,7 @@ vec3 pbr(){ vec3 baseRefl = mix(vec3(0.04),albedo.rgb,metallic); vec3 Lo = vec3(0.0); // acumulate lighting lum - for(int i=0;i // Required for: NULL