openframeworks / openframeworks/openFrameworks

simplify ofFbo::Settings

Open
#4,770 0 comments 4 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
10.4k
Forks
2.6k
Avg merge
1d 21h
Merged PRs (30d)
9

Description

Right now ofFbo Settings is really complex mostly cause it allows very different types of fbos and even with different syntaxes. For example to allocate an fbo for MRT you can do:

ofFbo::Settings settings;
settings.numColorBuffers = 3

or

ofFbo::Settings settings;
settings.colorFormats.push_back(GL_RGBA);
...

there's also parameters that are incompatible with each other, for example if you have depth stencil as texture you can't have multisampling.

All of this forces the allocate method have to check lots of different possibilities which makes it really brittle

There's probably a way to simplify this by creating different types of settings objects. We could have ofFbo::Settings for the basic parameters and everything that is not incompatible with each other and then something like ofFbo::MRTSettings to set MRT fbos or ofFbo::DepthAsTextureSettings which doesn't allow to set multisampling...

Not sure about what kind of settings makes sense to have but at least something very specialized for MRT would probably make sense.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading ofFbo::Settings and the allocate method, especially the MRT, depth-as-texture, and multisampling combinations described in the issue. Determine which settings are incompatible and whether separate settings types can express those constraints. Done would require an agreed design that simplifies allocation logic without removing needed FBO configurations.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
computer-graphics
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.