If possible, I propose we add a love.graphics.alpha() function to the transformation stack. Why? Well basically, here's how it would work.
It would apply an overall transparency to everything being drawn during the transformation stack instead of using the alpha argument on setColor. The problem with setColor is that it applies it to every draw operation separately so overlapping objects become obviously overlapped and may break the illusion to the player. love.graphics.alpha would apply the transparency to everything being drawn overall.
In the below example:
Top: Drawing everything with normal 100% opacity (255 alpha)
Middle: Setting 60% opacity to all objects separately (153 alpha) - Notice the photo showing through the text and polygon
Bottom: Setting 60% opacity to the transform stack while everything is drawn at 100% opacity using love.graphics.alpha() - Notice there is no peek through from objects drawn behind other objects
Basically it would be the same outcome as drawing everything to a canvas then drawing the canvas with a partial transparency. The problem is not everyone can use canvas.
I'm wondering if this would even be possible. I mean we can translate and rotate and scale, but not change alpha? Is this a limitation? Would it just not be possible without canvases anyway?
Proposal: love.graphics.alpha()
Re: Proposal: love.graphics.alpha()
The pentagon, the image, and the glyphs of the text are all separate drawing operations. They even get split up into smaller pieces so they're all triangles. Each triangle gets rasterized and then blended with the framebuffer (what you see on screen, more or less). Unless I'm missing some test or blend mode combination in OpenGL, your proposal requires that it remembers where something already has been drawn. This is kind of possible already with stencils, but it's necessary to redraw them for every shape which is mighty slow. I guess the depth buffer could be of help here, but if it is ever exposed in LÖVE, I think it's going to be in a more generalized way.
Shallow indentations.
- Jasoco
- Inner party member
- Posts: 3727
- Joined: Mon Jun 22, 2009 9:35 am
- Location: Pennsylvania, USA
- Contact:
Re: Proposal: love.graphics.alpha()
Seems Canvases would be the best way to do it right now. Shame they don't work everywhere.
- slime
- Solid Snayke
- Posts: 3170
- Joined: Mon Aug 23, 2010 6:45 am
- Location: Nova Scotia, Canada
- Contact:
Re: Proposal: love.graphics.alpha()
The people who own computers which can't use framebuffers/canvases usually don't expect to be able to play recent games with said computers.Jasoco wrote:Seems Canvases would be the best way to do it right now. Shame they don't work everywhere.
- Jasoco
- Inner party member
- Posts: 3727
- Joined: Mon Jun 22, 2009 9:35 am
- Location: Pennsylvania, USA
- Contact:
Re: Proposal: love.graphics.alpha()
A lot of brand new machines can't support Canvas and a lot of really old ones can. It's not a new vs. old thing. It's a driver thing.slime wrote:The people who own computers which can't use framebuffers/canvases usually don't expect to be able to play recent games with said computers.Jasoco wrote:Seems Canvases would be the best way to do it right now. Shame they don't work everywhere.
- slime
- Solid Snayke
- Posts: 3170
- Joined: Mon Aug 23, 2010 6:45 am
- Location: Nova Scotia, Canada
- Contact:
Re: Proposal: love.graphics.alpha()
It's a matter of hardware and drivers. A few intel integrated GMA cards, while being "recent" (aka 5+ years old), just aren't designed for modern OpenGL use, and can't create canvases. You can't take a TNT2 and slap some new drivers on it and expect it to gain (hardware-accelerated) canvas support.Jasoco wrote:A lot of brand new machines can't support Canvas and a lot of really old ones can. It's not a new vs. old thing. It's a driver thing.slime wrote:The people who own computers which can't use framebuffers/canvases usually don't expect to be able to play recent games with said computers.Jasoco wrote:Seems Canvases would be the best way to do it right now. Shame they don't work everywhere.
As far as I know, all GPUs from ATI/AMD/nvidia made in the past ~9 years support* canvases (provided they have non-ancient drivers), and all intel integrated chips aside from a couple GMA models do as well.
*There is an oversight in 0.8.0 which prevents canvases from working with certain older systems, but this is fixed for 0.9.0.
Re: Proposal: love.graphics.alpha()
Those with the crappy GMA chips don't usually expect to play many new games anyway, to be honest.
- Jasoco
- Inner party member
- Posts: 3727
- Joined: Mon Jun 22, 2009 9:35 am
- Location: Pennsylvania, USA
- Contact:
Re: Proposal: love.graphics.alpha()
My computer, even my last one, both have "crappy GMA" video chips and they do Canvases and PixelEffects fine. And support images upwards of 2048x2048 and larger, including canvases.Kyle wrote:Those with the crappy GMA chips don't usually expect to play many new games anyway, to be honest.
Unless a HD3000 and HD4000 isn't crappy.
Re: Proposal: love.graphics.alpha()
I can't imagine anyone who doesn't have at least general knowledge of OpenGL implementation (in other words, "most people") thinking any 2D game is a "new game" in the sense of being even slightly demanding of hardware.Kyle wrote:Those with the crappy GMA chips don't usually expect to play many new games anyway, to be honest.
Nope, those aren't the "GMA" series accelerators that are in question.Jasoco wrote:Unless a HD3000 and HD4000 isn't crappy.
- slime
- Solid Snayke
- Posts: 3170
- Joined: Mon Aug 23, 2010 6:45 am
- Location: Nova Scotia, Canada
- Contact:
Re: Proposal: love.graphics.alpha()
Intel's latest HD 2000/3000/4000 GPUs are quite good, considering what they are. They are also not GMA's.Jasoco wrote:My computer, even my last one, both have "crappy GMA" video chips and they do Canvases and PixelEffects fine. And support images upwards of 2048x2048 and larger, including canvases.Kyle wrote:Those with the crappy GMA chips don't usually expect to play many new games anyway, to be honest.
Unless a HD3000 and HD4000 isn't crappy.
Most people who have computers with the sort of chip that can't do post-millenium techniques will likely not play any downloadable game at all that has any sort of minimum requirements listed.Clouds wrote:I can't imagine anyone who doesn't have at least general knowledge of OpenGL implementation (in other words, "most people") thinking any 2D game is a "new game" in the sense of being even slightly demanding of hardware.Kyle wrote:Those with the crappy GMA chips don't usually expect to play many new games anyway, to be honest.
For example, all games created with Microsoft XNA will not work with an Intel GMA 950. Terraria was made with XNA. You do not have to support every system under the sun to meet people's expectations.
I should also mention that canvases, like images, use an opengl texture under the hood. But unlike images, canvases do not auto-pad the texture to power-of-two dimensions on systems that don't support npot textures, so your system may be experiencing PO2 syndrome if you get an error making a canvas.
Who is online
Users browsing this forum: Ahrefs [Bot], Amazon [Bot], varpeti and 4 guests