From 8885325524c69336baf572d005806808439c1545 Mon Sep 17 00:00:00 2001 From: r-lyeh Date: Sat, 14 Nov 2015 18:50:07 +0100 Subject: [PATCH] Fix sample --- LTBL2/source/main.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/LTBL2/source/main.cpp b/LTBL2/source/main.cpp index 8d48fc9..c938881 100644 --- a/LTBL2/source/main.cpp +++ b/LTBL2/source/main.cpp @@ -33,7 +33,11 @@ int main() { unshadowShader.loadFromFile("resources/unshadowShader.vert", "resources/unshadowShader.frag"); - ls.create(ltbl::rectFromBounds(sf::Vector2f(-1000.0f, -1000.0f), sf::Vector2f(1000.0f, 1000.0f)), window.getSize(), penumbraTexture, unshadowShader); + sf::Shader lightOverShapeShader; + + lightOverShapeShader.loadFromFile("resources/lightOverShapeShader.vert", "resources/lightOverShapeShader.frag"); + + ls.create(ltbl::rectFromBounds(sf::Vector2f(-1000.0f, -1000.0f), sf::Vector2f(1000.0f, 1000.0f)), window.getSize(), penumbraTexture, unshadowShader, lightOverShapeShader ); std::shared_ptr light = std::make_shared(); @@ -163,7 +167,7 @@ int main() { window.clear(sf::Color::White); - ls.render(view, unshadowShader); + ls.render(view, unshadowShader, lightOverShapeShader); sf::Sprite sprite; sprite.setTexture(ls.getLightingTexture());