Testing the new things in 0.9.0

General discussion about LÖVE, Lua, game development, puns, and unicorns.
User avatar
slime
Solid Snayke
Posts: 3163
Joined: Mon Aug 23, 2010 6:45 am
Location: Nova Scotia, Canada
Contact:

Re: Testing the new things in 0.9.0

Post by slime »

Santos wrote:I'm wondering, why do new Cursors have to be created from CursorTypes rather than passing the CursorType to setCursor, since only one style of Cursor can be made from each CursorType?
The external API LÖVE exposes mirrors the one it makes use of internally (which in turn mostly mirrors the OSX/Windows/X11/etc. APIs). I suppose it could lazy-load system cursors and cache them, but there isn't a really great reason to do that in my opinion.
Santos
Party member
Posts: 384
Joined: Sat Oct 22, 2011 7:37 am

Re: Testing the new things in 0.9.0

Post by Santos »

I'm wondering, what are use cases for color masks?

I assume the effects which could be achieved with it would be somewhat limited since there are only so many permutations of the four color components, and couldn't the same effects also be achieved using shaders?

Also, why is the color mask state reset after ever frame, like coordinate transformations?
User avatar
raidho36
Party member
Posts: 2063
Joined: Mon Jun 17, 2013 12:00 pm

Re: Testing the new things in 0.9.0

Post by raidho36 »

Color masks are just there, whether you can see use for them or not. They don't introduce extra overhead, so why don't have them. Someone might find a good use for them.

It does not necessairly have to. It's just after every love.draw ( ), love.graphics.present ( ) is called, which IIRC (could be wrong) also resets everything to configured identity. Internally on low level, this is not mandatory, but this is generally what you want one way or another.
User avatar
slime
Solid Snayke
Posts: 3163
Joined: Mon Aug 23, 2010 6:45 am
Location: Nova Scotia, Canada
Contact:

Re: Testing the new things in 0.9.0

Post by slime »

Santos wrote:I'm wondering, what are use cases for color masks?

I assume the effects which could be achieved with it would be somewhat limited since there are only so many permutations of the four color components, and couldn't the same effects also be achieved using shaders?
The color mask compliments shaders, without it every color component in the framebuffer is written to when you draw. It's usually used for pretty advanced techniques, like (re-)using different color components of a canvas for completely different things, or modifying the way things get blended into the active canvas.
You can also use it inside a stencil function to draw while you stencil (since all color components are normally disabled right before the stencil function is called.)
Santos wrote:Also, why is the color mask state reset after ever frame, like coordinate transformations?
It doesn't for me. Are you sure it does for you?
Raidho36 wrote:love.graphics.present ( ) is called, which IIRC (could be wrong) also resets everything to configured identity.
It doesn't - LÖVE resets the coordinate transformations every frame right before love.graphics.draw (when love.graphics.clear is called.)
jjmafiae
Party member
Posts: 1331
Joined: Tue Jul 24, 2012 8:22 am

Re: Testing the new things in 0.9.0

Post by jjmafiae »

will löve get microphone input?

i need it for my game called 9891 (9891)
for the multiplayer part in it.
User avatar
slime
Solid Snayke
Posts: 3163
Joined: Mon Aug 23, 2010 6:45 am
Location: Nova Scotia, Canada
Contact:

Re: Testing the new things in 0.9.0

Post by slime »

It'd be cool to eventually get microphone input support, but last I heard some implementations of the audio library LÖVE uses had a lot of issues with it.

https://bitbucket.org/rude/love/issue/1 ... hone-input
jjmafiae
Party member
Posts: 1331
Joined: Tue Jul 24, 2012 8:22 am

Re: Testing the new things in 0.9.0

Post by jjmafiae »

slime wrote:It'd be cool to eventually get microphone input support, but last I heard some implementations of the audio library LÖVE uses had a lot of issues with it.

https://bitbucket.org/rude/love/issue/1 ... hone-input
so will it never be added? :cry:
Santos
Party member
Posts: 384
Joined: Sat Oct 22, 2011 7:37 am

Re: Testing the new things in 0.9.0

Post by Santos »

Using Boolsheet's latest build, this affects the drawn image:

Code: Select all

function love.load()
	image = love.graphics.newImage('image.png')
end

function love.draw()
	love.graphics.setColorMask(false, true, false)
	love.graphics.draw(image)
end
and this does not:

Code: Select all

function love.load()
	image = love.graphics.newImage('image.png')
end

function love.draw()
	love.graphics.draw(image)
	love.graphics.setColorMask(false, true, false)
end
User avatar
raidho36
Party member
Posts: 2063
Joined: Mon Jun 17, 2013 12:00 pm

Re: Testing the new things in 0.9.0

Post by raidho36 »

Well duh, you're setting color mask after you completed the blitting.
User avatar
slime
Solid Snayke
Posts: 3163
Joined: Mon Aug 23, 2010 6:45 am
Location: Nova Scotia, Canada
Contact:

Re: Testing the new things in 0.9.0

Post by slime »

love.graphics.setColorMask affects love.graphics.clear as well (which is called right before love.draw).

Here's what's happening.

Run loop in the first example:

Code: Select all

1. clear r,g,b,a of screen
2. disable r,b channels for future draws/clears
3. draw image's g,a channels
4. present screen, only the g,a channels have anything in them
5. clear screen's g,a channels
6. draw image's g,a channels
7. present screen
repeat 5-7
Run loop in the second example:

Code: Select all

1. clear r,g,b,a of screen
2. draw image's r,g,b,a channels
3. disable r,b channels for future draws/clears
4. present screen
5. clear screen's g,a channels, leaving the previously drawn r,b of the image still there
6. draw image's g,a channels
7. present screen, including the "old" r,b of the image as well as the new g,a of the image
repeat 5-7
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Bing [Bot], Majestic-12 [Bot] and 2 guests