Arbitrary scissor shapes?

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
User avatar
genericdave
Citizen
Posts: 53
Joined: Tue Dec 15, 2009 9:08 am

Arbitrary scissor shapes?

Post by genericdave » Sun Apr 03, 2011 7:04 am

Alright, I know full well that löve only supports rectangular scissor buffers. What I'm wondering if there's any other way I could get an irregular viewport-like shape drawn to the screen. Could I, for example, draw to a framebuffer and then create an arbitrary shape that could clear part of that buffer and then flip that onto the screen buffer? Somehow, I get the feeling this is going to require me making a request on the issue tracker. Just wanted to check here first. Maybe I'm missing something.

I'm trying to emulate this kind of awesometastic splitscreening.

User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: Arbitrary scissor shapes?

Post by Robin » Sun Apr 03, 2011 7:57 am

mapPixel could work, but that would be horribly, horribly slow.
Help us help you: attach a .love.

User avatar
genericdave
Citizen
Posts: 53
Joined: Tue Dec 15, 2009 9:08 am

Re: Arbitrary scissor shapes?

Post by genericdave » Sun Apr 03, 2011 8:56 am

Robin wrote:that would be horribly, horribly slow.
Yeah, that's basically what has me stumped here. Accessing image data directly is expensive. I don't think a reasonable implementation of this is possible with löve currently. I'm a bit surprised to find that Opengl restricts its scissors and viewports to rectangles as well. Looks like I would need some sort of clipping mask in order to achieve this.

User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: Arbitrary scissor shapes?

Post by Robin » Sun Apr 03, 2011 9:00 am

genericdave wrote:Looks like I would need some sort of clipping mask in order to achieve this.
Think so, yeah. But it seems so unlovely to me.
Help us help you: attach a .love.

User avatar
genericdave
Citizen
Posts: 53
Joined: Tue Dec 15, 2009 9:08 am

Re: Arbitrary scissor shapes?

Post by genericdave » Sun Apr 03, 2011 9:04 am

Clipping masks in general are unlovely? Or are you talking about specifically as a solution to this?

User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: Arbitrary scissor shapes?

Post by Robin » Sun Apr 03, 2011 9:14 am

In general. Too low-level.
Help us help you: attach a .love.

User avatar
genericdave
Citizen
Posts: 53
Joined: Tue Dec 15, 2009 9:08 am

Re: Arbitrary scissor shapes?

Post by genericdave » Sun Apr 03, 2011 10:06 am

Hmm, looks like löve might eventually be able to do this with simple blending modes. Like this. I could be dead wrong, however.

User avatar
TechnoCat
Inner party member
Posts: 1611
Joined: Thu Jul 30, 2009 12:31 am
Location: Denver, CO
Contact:

Re: Arbitrary scissor shapes?

Post by TechnoCat » Sun Apr 03, 2011 4:30 pm

Does love.graphics.rotate not affect scissor?.

UPDATE: My gosh, it doesn't!

User avatar
miko
Party member
Posts: 409
Joined: Fri Nov 26, 2010 2:25 pm
Location: PL

Re: Arbitrary scissor shapes?

Post by miko » Sun Apr 03, 2011 8:18 pm

Robin wrote:mapPixel could work, but that would be horribly, horribly slow.
How about ImageData:paste()? You could only split it horizontally or vertically, but still should be faster.
My lovely code lives at GitHub: http://github.com/miko/Love2d-samples

User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: Arbitrary scissor shapes?

Post by Robin » Sun Apr 03, 2011 8:29 pm

How would that be an improvement over using scissor?
Help us help you: attach a .love.

Post Reply

Who is online

Users browsing this forum: No registered users and 7 guests