Is there a way to have no blending.
For example you have a group of shapes overlapping each other and you set a transparent colour
and they all become transparent (so they look like one single object)
If you look at that there are 4 circles and 5 rectangles, but they overlap so you can see the seperate objects.
I want them to look like one object.
No blend mode.
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
- Robin
- The Omniscient
- Posts: 6506
- Joined: Fri Feb 20, 2009 4:29 pm
- Location: The Netherlands
- Contact:
Re: No blend mode.
I think you could try drawing the background first, next the shapes with 100% alpha, and then the background again with a lower alpha. I have no idea whether this actually works.
Help us help you: attach a .love.
Re: No blend mode.
You want the union of the two shapes to act as one transparent object?
EDIT: Rephrased.
EDIT: Rephrased.
Re: No blend mode.
I wonder if this is possible with glBlendFunc at all. Hmm, I don't think it can be combined with normal blending (transparency).
Might need to implement render targets for this.
Might need to implement render targets for this.

Re: No blend mode.
Well I don't really know how blending works.
But I assume it takes each pixel of an object and does some math between the values.
Can't you just say

But I assume it takes each pixel of an object and does some math between the values.
Can't you just say
Code: Select all
if object1Color == object2Color then
finalColor = object1Color
end

- Robin
- The Omniscient
- Posts: 6506
- Joined: Fri Feb 20, 2009 4:29 pm
- Location: The Netherlands
- Contact:
Re: No blend mode.
If you're interested: my hack works. I've added a small example.
- Attachments
-
noblend.love
- (383 Bytes) Downloaded 341 times
Help us help you: attach a .love.
Re: No blend mode.
Nice!
EDIT: lol, looking at your code it never occured to me you only needed to draw 2 rectangles for a rounded box
i've been drawing 5
EDIT: lol, looking at your code it never occured to me you only needed to draw 2 rectangles for a rounded box

- Robin
- The Omniscient
- Posts: 6506
- Joined: Fri Feb 20, 2009 4:29 pm
- Location: The Netherlands
- Contact:
Re: No blend mode.
ljdp wrote:(...) you only needed to draw 2 rectangles for a rounded boxi've been drawing 5

The bad news is: my hack is a bit limited. It's hard to have objects of different transparencies (you could of course add layer on top of layer, but then you can't choose the drawing order yourself), and a completely opaque shape is always on the foreground. Unless you make it part of the background, in which case you have to draw everything at least twice.
I think the best solution would be to allow drawing to off-screen buffers, and blitting them later, with optional transparency.
Help us help you: attach a .love.
Re: No blend mode.
This is one of the things i miss most with love, its just so darn useful for so many thingsRobin wrote: I think the best solution would be to allow drawing to off-screen buffers, and blitting them later, with optional transparency.
Who is online
Users browsing this forum: Ahrefs [Bot], Bing [Bot] and 4 guests