From 2fc5938a8713d712e5da1a450cc4de4197b34668 Mon Sep 17 00:00:00 2001 From: Anselme Date: Sat, 26 Aug 2017 12:22:13 +0200 Subject: [PATCH] fixed weird aura when view direction and surface normal are aligned --- src/light.cpp | 6 ++++++ src/light.h | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/light.cpp b/src/light.cpp index 510e74e..77453ac 100644 --- a/src/light.cpp +++ b/src/light.cpp @@ -31,6 +31,12 @@ const glm::mat4 Light::biasMatrix( Texture* AmbientLight::brdfLUT = nullptr; +void AmbientLight::setBrdfLut(Texture* texture) +{ + brdfLUT = texture; + brdfLUT->setWrap(GL_CLAMP_TO_EDGE); +} + void AmbientLight::bindAttributes(Shader *shader, Camera *camera) { int slot = PBRMaterial::NB_PBR_SLOTS; diff --git a/src/light.h b/src/light.h index 672ce7f..0b46be6 100644 --- a/src/light.h +++ b/src/light.h @@ -64,7 +64,7 @@ public: Texture* getAmbient() { return ambient; } void setReflect(Texture* texture) { reflect = texture; } Texture* getReflect() { return reflect; } - static void setBrdfLut(Texture* texture) { brdfLUT = texture; } + static void setBrdfLut(Texture* texture); }; class DirectionnalLight : public Light