openframeworks / openframeworks/openFrameworks
simplify ofFbo::Settings
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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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