Shader should alter incoming data rather than generate it. Specifically with löve2d, fragment shader is definitely the wrong place to generate render data. It may be good for some sort of demoscene though, where doing such things is the whole point. But this is not what you do in games.'m not really sure what you mean by this
Pixel Effect
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Re: Pixel Effect
- slime
- Solid Snayke
- Posts: 3166
- Joined: Mon Aug 23, 2010 6:45 am
- Location: Nova Scotia, Canada
- Contact:
Re: Pixel Effect
But why? As I said earlier, all a pixel shader does in the first place is generate a color (or a few colors, if you have multiple render targets) based on some code and inputs. You're 'generating data' regardless of what you do.raidho36 wrote:Shader should alter incoming data rather than generate it. Specifically with löve2d, fragment shader is definitely the wrong place to generate render data. It may be good for some sort of demoscene though, where doing such things is the whole point. But this is not what you do in games.'m not really sure what you mean by this
Now, if you have a very complex / arithmetic-heavy shader you'll likely run into performance problems, and in that case it would be beneficial to move things into textures or uniforms so you can be less ALU-bound, but that's not really related to what you're outputting from the shader.
Re: Pixel Effect
I propose that doing it by default is the right thing to do.
Re: Pixel Effect
How can i know if the shade code is 1.0, 2.0 or 3.0?
Love recognize if the shader is above the requested version?
Love recognize if the shader is above the requested version?
Re: Pixel Effect
Love2D is currently stuck with glsl 1.2 (that's OpenGL 2.1). You can recompile it to support other versions.
Glsl 1.2 isn't much but you should be ok with it for starters.
Glsl 1.2 isn't much but you should be ok with it for starters.
- slime
- Solid Snayke
- Posts: 3166
- Joined: Mon Aug 23, 2010 6:45 am
- Location: Nova Scotia, Canada
- Contact:
Re: Pixel Effect
Well, there are only a few things in pixel shaders you can do in later versions that you can't do with GLSL 1.20 - and many of them also require additional CPU-side OpenGL code.RedHot wrote:Love2D is currently stuck with glsl 1.2 (that's OpenGL 2.1). You can recompile it to support other versions.
Glsl 1.2 isn't much but you should be ok with it for starters.
You can overwrite the love.graphics._effectCodeToGLSL function (love.graphics._shaderCodeToGLSL in 0.9.0) in Lua to use a later version, but I don't recommend it. You can also use GLSL extensions such as EXT_gpu_shader4 to enable some additional functionality on systems which support it, but you really need to know what you're doing for that.
Who is online
Users browsing this forum: Bing [Bot], Google [Bot] and 3 guests