Page 2 of 2

Re: light_world.lua incorrect lighting direction

Posted: Thu Oct 27, 2016 8:48 pm
by 0x29a
I'll try it tomorrow again and I'll report back if that was the case

Re: light_world.lua incorrect lighting direction

Posted: Thu Oct 27, 2016 8:52 pm
by pgimeno
0x29a wrote:Do you happen to know how to do it? I'd be forever in your debt.
Just use your default window resolution to do this:

Code: Select all

vec4 effect(vec4 color, Image texture, vec2 texture_coords, vec2 pixel_coords) {
  pixel_coords.y = 600.0 - pixel_coords.y;    // <-- Insert this, changing 600.0 to your default height
  float dist = ...
(Edited to make it 600.0 instead of 799.0)

Re: light_world.lua incorrect lighting direction

Posted: Thu Oct 27, 2016 8:55 pm
by 0x29a
Hi,
actually I tried it out right now. As it turns out, Slime was right!

Code: Select all

 vec3 normal = normalize(vec3(normalColor.r,invert_normal ? 1 - normalColor.g :  normalColor.g, normalColor.b) * 2.0 - 1.0);

swapped with

Code: Select all

 vec3 normal = normalize(vec3(normalColor.r,invert_normal ? normalColor.g :  1 - normalColor.g, normalColor.b) * 2.0 - 1.0);
gets the job done!

Thank you both for your enormous help!

Have a good one