Although the Love.graphics.setColorMode had cancel from 0.90

General discussion about LÖVE, Lua, game development, puns, and unicorns.
Post Reply
poorenglish
Prole
Posts: 47
Joined: Thu Sep 24, 2009 1:49 pm

Although the Love.graphics.setColorMode had cancel from 0.90

Post by poorenglish » Wed Jan 01, 2014 12:52 pm

Although the Love.graphics.setColorMode had cancel from 0.90,which function is replace this?

User avatar
slime
Solid Snayke
Posts: 2899
Joined: Mon Aug 23, 2010 6:45 am
Location: Nova Scotia, Canada
Contact:

Re: Although the Love.graphics.setColorMode had cancel from

Post by slime » Wed Jan 01, 2014 2:09 pm

The "modulate" ColorMode was the default in 0.8.0, and its functionality (multiplying the current color with the texture) is still the default in 0.9.0.
The effects of the "replace" ColorMode can be duplicated by calling love.graphics.setColor(255, 255, 255).

The "combine" ColorMode can be duplicated via a pixel shader. The shader code would look something like this:

Code: Select all

shader = love.graphics.newShader[[
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);
}
]]

poorenglish
Prole
Posts: 47
Joined: Thu Sep 24, 2009 1:49 pm

Re: Although the Love.graphics.setColorMode had cancel from

Post by poorenglish » Thu Jan 02, 2014 12:44 pm

OK,thank you.
It seem be complex

User avatar
SiENcE
Party member
Posts: 791
Joined: Thu Jul 24, 2008 2:25 pm
Location: Berlin/Germany
Contact:

Re: Although the Love.graphics.setColorMode had cancel from

Post by SiENcE » Thu Jan 02, 2014 5:52 pm

@slime: can you add this to the wiki. thx.

Post Reply

Who is online

Users browsing this forum: No registered users and 22 guests