Here's the pixel shader code:
Code: Select all
vec4 effect( vec4 color, Image texture, vec2 texture_coords, vec2 screen_coords ){
vec4 pixel = Texel(texture, texture_coords );//This is the current pixel color
// This is for my development machine:
number bluefader = min(1,((love_ScreenSize.y - 0.15 * screen_coords.y)/love_ScreenSize.y));
// This is for the playing machine:
// number bluefader = min(1, 0.85 + (( 0.15 * screen_coords.y)/love_ScreenSize.y));
return pixel * color * bluefader;
}
I am using it for drawing a screen background into a canvas. On my development machine, I already noticed that top/bottom was flipped as I changed from rendering on the screen into the canvas, so the problem might also be a problem of the development machine...
- Did I do anything wrong?
- Is it somehow possible to detect at runtime where the origin is?
Idea It might be possible by making a temporary canvas, size 2x2 or so, draw a white rectangle on it with a test shader code and reading out the pixel values "by hand". But somehow, I feel like this can't be the right way to go...