From d87d873fcd2e26c866a3c2a60533bf1723e9032f Mon Sep 17 00:00:00 2001 From: Evgeni Popov Date: Sat, 17 Sep 2022 12:30:13 +0200 Subject: [PATCH] Fix geometry buffer renderer in WebGPU --- .../dev/core/src/Shaders/geometry.fragment.fx | 28 +++++++++++++------ 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/packages/dev/core/src/Shaders/geometry.fragment.fx b/packages/dev/core/src/Shaders/geometry.fragment.fx index 58418e70955..aa702976dbd 100644 --- a/packages/dev/core/src/Shaders/geometry.fragment.fx +++ b/packages/dev/core/src/Shaders/geometry.fragment.fx @@ -34,14 +34,26 @@ uniform vec2 vTangentSpaceParams; #endif #if defined(REFLECTIVITY) -varying vec2 vReflectivityUV; -varying vec2 vAlbedoUV; -uniform sampler2D reflectivitySampler; -uniform sampler2D albedoSampler; -uniform vec3 reflectivityColor; -uniform vec3 albedoColor; -uniform float metallic; -uniform float glossiness; + #if defined(ORMTEXTURE) || defined(SPECULARGLOSSINESSTEXTURE) || defined(REFLECTIVITYTEXTURE) + uniform sampler2D reflectivitySampler; + varying vec2 vReflectivityUV; + #endif + #ifdef ALBEDOTEXTURE + varying vec2 vAlbedoUV; + uniform sampler2D albedoSampler; + #endif + #ifdef REFLECTIVITYCOLOR + uniform vec3 reflectivityColor; + #endif + #ifdef ALBEDOCOLOR + uniform vec3 albedoColor; + #endif + #ifdef METALLIC + uniform float metallic; + #endif + #ifdef ROUGHNESS + uniform float glossiness; + #endif #endif #ifdef ALPHATEST