LÖVE 0.10.2 released

General discussion about LÖVE, Lua, game development, puns, and unicorns.
User avatar
D0NM
Party member
Posts: 164
Joined: Mon Feb 08, 2016 10:35 am
Location: Zabuyaki
Contact:

Re: LÖVE 0.10.2 released

Post by D0NM » Fri Nov 11, 2016 8:02 pm

slime wrote:Shader:sendColor and shader:send call the exact same internal base function. The only differences are that sendColor divides input values by 255 (to match GLSL's [0-1] range for colors) whereas Shader:send doesn't so you should give color values that are already within [0-1] rather than [0-255] if you use Shader:send, and sendColor performs gamma correction if applicable, whereas send does not.
thank you :nyu:
Our LÖVE Gamedev blog Zabuyaki (an open source retro beat 'em up game). Follow @Zabuyaki.
Twitter @FaMeSoft / GP32 Free Platformer: SUPER PLUSHA
:joker: LÖVE & Lua Video Lessons in Russian / Видео уроки по LÖVE и Lua :joker:

User avatar
D0NM
Party member
Posts: 164
Joined: Mon Feb 08, 2016 10:35 am
Location: Zabuyaki
Contact:

Re: LÖVE 0.10.2 regression shader:sendColor

Post by D0NM » Wed Nov 16, 2016 4:08 pm

Hi guys!
Just made a test to show 0.10.2 shader:sendColor regression.
(I've checked Love sources and found no suspicious changes so far...)
Hope it is easy to fix ^__^
Created an issue: https://bitbucket.org/rude/love/issues/ ... last-color

I wonder if sendFloat was affected, too.

main.lua

Code: Select all

--Love2d 0.10.2 sendColor bug:
-- the last color value in the table is missing

function love.load()
    myShader = [[
extern vec4 colors[3];
vec4 effect( vec4 color, Image texture, vec2 texture_coords, vec2 screen_coords ){
  	if(screen_coords.x < 300)
    		return colors[0];
  	else if(screen_coords.x > 600)
		return colors[2];
	return colors[1];
}
]]
    shader = love.graphics.newShader(myShader)
    shader:sendColor("colors", { 255, 0, 0, 255 }, { 0, 255, 0, 255 }, { 0, 0, 255, 255 })

    shader2 = love.graphics.newShader(myShader)
    shader2:sendColor("colors", { 255, 0, 0, 255 }, { 0, 255, 0, 255 }, { 0, 0, 255, 255 },
        { 1, 1, 1, 1 })
end

function love.draw()
    love.graphics.clear()
    love.graphics.print("Send 3 colors into the shader. Get the 3rd wrong", 10, 0)
    love.graphics.print("We send 4 colors as a workaround. It works", 10, 190)

    love.graphics.setShader(shader) --draw something here
    love.graphics.rectangle("fill", 10, 20, 780, 120)

    love.graphics.setShader(shader2) --draw something here
    love.graphics.rectangle("fill", 10, 210, 780, 120)
    love.graphics.setShader()

    love.graphics.print("No shader", 10, 390)
    love.graphics.rectangle("fill", 10, 410, 780, 120)
end
Love2d 0.10.1 -> everything is fine
Image


Love2d 0.10.2 -> the last sent color is lost
Image
Our LÖVE Gamedev blog Zabuyaki (an open source retro beat 'em up game). Follow @Zabuyaki.
Twitter @FaMeSoft / GP32 Free Platformer: SUPER PLUSHA
:joker: LÖVE & Lua Video Lessons in Russian / Видео уроки по LÖVE и Lua :joker:

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

Re: LÖVE 0.10.2 released

Post by slime » Wed Nov 16, 2016 9:15 pm

Thanks for the debugging! Unfortunately the issue affects any use of Shader:send with multiple arguments (for an array) – but at least it can easily be worked around by adding an extra dummy argument.

User avatar
D0NM
Party member
Posts: 164
Joined: Mon Feb 08, 2016 10:35 am
Location: Zabuyaki
Contact:

Re: LÖVE 0.10.2 released

Post by D0NM » Thu Nov 17, 2016 5:14 am

slime wrote:Thanks for the debugging! Unfortunately the issue affects any use of Shader:send with multiple arguments (for an array) – but at least it can easily be worked around by adding an extra dummy argument.
Thank you. Yeah, we've got to the workaround already.
Our LÖVE Gamedev blog Zabuyaki (an open source retro beat 'em up game). Follow @Zabuyaki.
Twitter @FaMeSoft / GP32 Free Platformer: SUPER PLUSHA
:joker: LÖVE & Lua Video Lessons in Russian / Видео уроки по LÖVE и Lua :joker:

zell2002
Citizen
Posts: 50
Joined: Sun Feb 23, 2014 9:22 pm

Re: LÖVE 0.10.2 released

Post by zell2002 » Sat Mar 25, 2017 8:29 pm

Hi :)
Just upgraded (on windows 7).

Running love2d from sublimetext2 doenst give me the console anymore.
If i drag n drop folder onto love.exe or lovec.exe I get it.

Setting lovec.exe in my sublime-build prints to sublime text's console window, but I personally dont like that.

Is there a setting i'm missing to get the console window back?

zell2002
Citizen
Posts: 50
Joined: Sun Feb 23, 2014 9:22 pm

Re: LÖVE 0.10.2 released

Post by zell2002 » Sun Mar 26, 2017 12:47 pm

Also it appears the sublime console is only printed to after Love.exe is closed

User avatar
Nixola
Inner party member
Posts: 1868
Joined: Tue Dec 06, 2011 7:11 pm
Location: Italy

Re: LÖVE 0.10.2 released

Post by Nixola » Sun Mar 26, 2017 1:50 pm

Put io.stdout:setvbuf("no") at the top of your main.lua file. I'm quite sure it's been covered plenty of times on the forum.
lf = love.filesystem
ls = love.sound
la = love.audio
lp = love.physics
lt = love.thread
li = love.image
lg = love.graphics

zell2002
Citizen
Posts: 50
Joined: Sun Feb 23, 2014 9:22 pm

Re: LÖVE 0.10.2 released

Post by zell2002 » Sun Mar 26, 2017 2:29 pm

Ah ok, that doe sound familiar cheers, but this helps only to print to sublime's console
I'm still curious how do I get back the separate console window?

pedrosgali
Citizen
Posts: 76
Joined: Wed Oct 15, 2014 5:00 pm
Location: Yorkshire, England

Re: LÖVE 0.10.2 released

Post by pedrosgali » Sun Mar 26, 2017 2:41 pm

Did you enable the console in config.lua?
Add t.console = true if not.

Code: Select all

if not wearTheseGlasses() then
  chewing_on_trashcan = true
end

zell2002
Citizen
Posts: 50
Joined: Sun Feb 23, 2014 9:22 pm

Re: LÖVE 0.10.2 released

Post by zell2002 » Sun Mar 26, 2017 2:44 pm

yeah, ive always had used this in previous Love versions, just 10.2 doesnt spawn the console window if I run from sublime. It does spawn if I drag my game folder onto love.exe

Post Reply

Who is online

Users browsing this forum: Codex, Fuzzlix and 3 guests