X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=blobdiff_plain;f=source%2Feffects%2Fsky.cpp;h=fcb465b8bb71960fc480086ff263baeb73119fd7;hp=d9c95b3bd79839fed84d1ad3f06235a4f5ac626e;hb=adc26a2e141a2853b6c5025130c46a46cece4b84;hpb=e6e6f0fe81a2f92985e65ae0de708974194d81a3 diff --git a/source/effects/sky.cpp b/source/effects/sky.cpp index d9c95b3b..fcb465b8 100644 --- a/source/effects/sky.cpp +++ b/source/effects/sky.cpp @@ -1,6 +1,6 @@ #include #include -#include "light.h" +#include "directionallight.h" #include "mesh.h" #include "renderer.h" #include "resources.h" @@ -12,7 +12,7 @@ using namespace std; namespace Msp { namespace GL { -Sky::Sky(Renderable &r, Light &s): +Sky::Sky(Renderable &r, DirectionalLight &s): Effect(r), sun(s), transmittance_lookup(128, 64, (COLOR_ATTACHMENT,RGB16F)), @@ -97,8 +97,8 @@ void Sky::setup_frame(Renderer &renderer) rendered = true; shdata.uniform("light_color", sun.get_color()); - shdata.uniform("light_dir", sun.get_position().slice<3>(0)); - sun.set_transmittance(get_transmittance(normalize(sun.get_position().slice<3>(0)))); + shdata.uniform("light_dir", -sun.get_direction()); + sun.set_transmittance(get_transmittance(-sun.get_direction())); Renderer::Push push(renderer);