No more setColorMode? >:(

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
Kyle
Party member
Posts: 146
Joined: Sat Mar 16, 2013 9:46 pm

No more setColorMode? >:(

Post by Kyle »

Is there any replacement for this? I can't find one. I really don't want to have to use shaders for something this trivial.
User avatar
slime
Solid Snayke
Posts: 3132
Joined: Mon Aug 23, 2010 6:45 am
Location: Nova Scotia, Canada
Contact:

Re: No more setColorMode? >:(

Post by slime »

love.graphics.setColor(255, 255, 255) achieves the same result as love.graphics.setColorMode("replace"), and "modulate" is the default anyway, so 2/3 of the possible ColorModes are redundant.
On top of that, they didn't even work at all when a shader was active (since shaders completely supersede their functionality) - and they would have to be emulated using shaders anyway on OpenGL ES and modern OpenGL 3+, since they aren't supported with fixed-functionality in the more modern APIs.

The "combine" ColorMode was fairly arbitrary. But it's easy to reproduce it in a pixel shader.

Code: Select all

vec4 effect(vec4 vcolor, Image texture, vec2 texcoord, vec2 pixcoord)
{
    vec4 texcolor = Texel(texture, texcoord);
    return vec4(texcolor.rgb + vcolor.rgb - vec3(0.5), texcolor.a);
}
Last edited by slime on Mon Dec 16, 2013 6:41 am, edited 1 time in total.
Kyle
Party member
Posts: 146
Joined: Sat Mar 16, 2013 9:46 pm

Re: No more setColorMode? >:(

Post by Kyle »

Hmm. I need to multiply, actually.
User avatar
bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

Re: No more setColorMode? >:(

Post by bartbes »

That was/is a blend mode.
Post Reply

Who is online

Users browsing this forum: No registered users and 163 guests