Canvas and shader!

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
User avatar
Mandarancio
Prole
Posts: 11
Joined: Mon Nov 03, 2008 5:08 pm
Location: Parma - Italy
Contact:

Canvas and shader!

Post by Mandarancio »

Hi to all!
I search a little bit on the forum but I don't find a solution so I ask here! My English is very bad! Sorry!
First of all is a lot of time that I don't use love and I never write shader..

I'm trying to learn it for make a bloom + blur effect for my futures game, so I start with some random effect to understand how it work.
I start making a random colour effect (https://bitbucket.org/vrld/love-glsl) and all was good, after I tried to apply a different colour to all the pixel starting with the previous colour (I'm not sure to explain me good),

Code: Select all

extern number time;
vec4 effect(vec4 color, Image texture, vec2 texture_coords, vec2 pixel_coords)
{	
	vec4 pixel=texture2D(texture,texture_coords);
	
	pixel.r+=sin(time);
	pixel.g+=cos(time);
	pixel.b+=-sin(time);

	return pixel;
}
But all was white, after a little bit I find that I have to use a canvas to have access at all the pixels, is right??
So I put a canvas, selected it during the draw function and after redraw on the display, but all the draw is in black and white! why? And the effect doesn't work at all! also the previous with the global colour, why?

Thanks a lot to all!
Attachments
LibreGOO.love
Game
(4.05 MiB) Downloaded 177 times
Arch Linux user..
..No Freedom without Sharing..
http://mandarancio.deviantart.com/
http://manda.netsons.org/
User avatar
alberto_lara
Party member
Posts: 372
Joined: Wed Oct 30, 2013 8:59 pm

Re: Canvas and shader!

Post by alberto_lara »

Hello!.. Just 8 years late but, did you solve this issue? :)
Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 75 guests