Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - Sakarah

Pages: [1]
1
Feature requests / Max and Min blending mode
« on: March 07, 2021, 03:46:37 pm »
The enumeration sf::BlendMode::Equation contains only three constants. But as far as I know, OpenGL implementations that support Subtract also support Max and Min.
An old thread said that there were no use for Min and Max BlendMode equations. However, I strongly disagree with that statement as my current project rely on the Max blending mode.

Indeed, I want to make an 2D infiltration game, where some agents (say cameras) have a viewing score for each pixel in their range. When two or more of these cameras view the same zone, the viewing score of a pixel is the maximum score of each camera.
I want the player to visualize these viewing zones, and for that I plan to draw a viewing zone for each camera and rely on the blending mode to actually retain the maximum value.

Speaking about Min, if I hypothetically wanted to instead draw safeness of a given pixel I would like each camera to locally decrease safeness of its neighboring pixels, and remember the minimal safeness value instead of the maximum.

Obviously, I can fork SFML for my current project to fulfill my needs, but I really think that Max and Min blending modes can be useful for others, and their implementation in the library is trivial (around 15 LoC).

If I submit a pull request to add Min and Max blending mode, would you accept it ?

Pages: [1]
anything