Hi, guys!!
I can't understand pixel effect!! How does it work? How do I code it?!?!? Can someone give me some tips?!
Thanks!!
Pixel Effect
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Pixel Effect
Code games. You'll have fun!
- Robin
- The Omniscient
- Posts: 6506
- Joined: Fri Feb 20, 2009 4:29 pm
- Location: The Netherlands
- Contact:
Re: Pixel Effect
You'll find many examples in the Share a Shader thread. I recommend starting at the end of the thread, rather than at the beginning, because it might be that not all of them work with the current version of LÖVE. (It's been alive for two years, which is pretty long for a thread.)
You can run them, see what they do (if you don't see anything, just try the next one), and then look at the code, try to understand them. If that doesn't help, there are probably enough people here who know some tutorial or manual or something.
You can run them, see what they do (if you don't see anything, just try the next one), and then look at the code, try to understand them. If that doesn't help, there are probably enough people here who know some tutorial or manual or something.
Help us help you: attach a .love.
- bartbes
- Sex machine
- Posts: 4946
- Joined: Fri Aug 29, 2008 10:35 am
- Location: The Netherlands
- Contact:
Re: Pixel Effect
PixelEffects were only added in 0.8.0 .Robin wrote:because it might be that not all of them work with the current version of LÖVE.
- Robin
- The Omniscient
- Posts: 6506
- Joined: Fri Feb 20, 2009 4:29 pm
- Location: The Netherlands
- Contact:
Re: Pixel Effect
Oh, right. I was confused because the thread started before 0.8.0 was released (and people where already enthusiastically writing shaders).bartbes wrote:PixelEffects were only added in 0.8.0 .
So I guess it doesn't matter much then, if the only problem is going to be that some of them will error (for pushing 'q' rather than 'quit') when you press escape.
Help us help you: attach a .love.
Re: Pixel Effect
Here's some links that may have some information on shaders for you.
First a couple pages from the wiki:
https://www.love2d.org/wiki/love.graphi ... ixelEffect
https://www.love2d.org/wiki/love.graphi ... ixelEffect (this one contains a simple example)
And here's the reference for GLSL, Which is the language that you write shaders with, With a few changes explained in one of the links above.
http://www.opengl.org/sdk/docs/manglsl/
But in my opinion the best place to learn is the share a shader thread, Tons of examples there.
First a couple pages from the wiki:
https://www.love2d.org/wiki/love.graphi ... ixelEffect
https://www.love2d.org/wiki/love.graphi ... ixelEffect (this one contains a simple example)
And here's the reference for GLSL, Which is the language that you write shaders with, With a few changes explained in one of the links above.
http://www.opengl.org/sdk/docs/manglsl/
But in my opinion the best place to learn is the share a shader thread, Tons of examples there.
Re: Pixel Effect
Ah!
The black art of GLSL!
Learn by fiddling with other people's Shaders - really a painful way to learn something.
Just look at what I had to do through just to be able to control the background and foreground colors.
The black art of GLSL!
Learn by fiddling with other people's Shaders - really a painful way to learn something.
Just look at what I had to do through just to be able to control the background and foreground colors.
- Attachments
-
- rect.love
- colored rounded rectangle
- (1.36 KiB) Downloaded 167 times
Re: Pixel Effect
You shouldn't render with shaders, it breaks GPU rendering pipeline and results in ineffective rendering, from all perspectives.
You only should use them to alter the picture, like you can apply a bump map to the sprite, or a parallax map which gives some degree of 3d effect out of plain 2d sprite. Blur and complex color effects also goes here, anything such. If you feel you need to change sprite pixel color via some function, you use shaders.
You only should use them to alter the picture, like you can apply a bump map to the sprite, or a parallax map which gives some degree of 3d effect out of plain 2d sprite. Blur and complex color effects also goes here, anything such. If you feel you need to change sprite pixel color via some function, you use shaders.
Re: Pixel Effect
How does it break anything?it breaks GPU rendering pipeline and results in ineffective rendering, from all perspectives.
From all perspectives, using a shader use a GPU. From all perspectives, a GPU is fast.(Ok, drawing directly the rectangle is also done with the GPU.)
I mean, I made a mandelbrot fractal viewer with a shader. While it's slow, It would be even slower if I did with any other method.(Except magic, of course.)
http://hastebin.com/xihobuxogo.lua (The goal was to have the smallest file possible while still being understandable.)
- slime
- Solid Snayke
- Posts: 3166
- Joined: Mon Aug 23, 2010 6:45 am
- Location: Nova Scotia, Canada
- Contact:
Re: Pixel Effect
I'm not really sure what you mean by this - all pixel shaders do is tell the GPU what color the resulting fragment should be, based on some input data. There's no real distinction between "altering the picture" and "rendering with shaders", as far as the GPU is concerned. It just runs the shader code and uses the result.raidho36 wrote:You shouldn't render with shaders, it breaks GPU rendering pipeline and results in ineffective rendering, from all perspectives.
You only should use them to alter the picture, like you can apply a bump map to the sprite, or a parallax map which gives some degree of 3d effect out of plain 2d sprite. Blur and complex color effects also goes here, anything such. If you feel you need to change sprite pixel color via some function, you use shaders.
Here's a simplified diagram of the old (pre-tessellation shader) GPU pipeline. The extremely old fixed-functionality pipeline is usually reproduced by the driver creating its own shaders.
Who is online
Users browsing this forum: Ahrefs [Bot], Google [Bot] and 7 guests