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 »

Although the Love.graphics.setColorMode had cancel from 0.90,which function is replace this?
User avatar
slime
Solid Snayke
Posts: 3166
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 »

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 »

OK,thank you.
It seem be complex
User avatar
SiENcE
Party member
Posts: 806
Joined: Thu Jul 24, 2008 2:25 pm
Location: Berlin/Germany
Contact:

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

Post by SiENcE »

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

Who is online

Users browsing this forum: No registered users and 11 guests