openframeworks / openframeworks/openFrameworks

ofGLProgrammableRenderer would not update a ofShader's normalMatrix unless an ofMaterial is bound.

Open
#3,696 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug core prelim-analysis section-3D
Dominant language
C++
Stars
10.4k
Forks
2.6k
Avg merge
1d 21h
Merged PRs (30d)
9

Description

This leads to ofRotate, ofTranslate, ofMultMat etc not updating the normalMatrix.
Moving the responsibility of the normalMatrix from ofMaterial and into ofGLProgrammableRenderer::uploadCurrentMatrix() fixes this.
The uniform lookup is cached in ofShader so it will be silently ignored if the shader does not define that uniform.

https://github.com/andreasmuller/openFrameworks/commit/12d512c4919cad114ebaa6f77b7a7f1b8485381f

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 with ofGLProgrammableRenderer::uploadCurrentMatrix() and inspect how ofMaterial currently handles the normalMatrix and how ofShader caches uniform lookups. Compare the referenced commit, then verify that matrix operations update the normalMatrix without an ofMaterial and that shaders without this uniform are silently ignored.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
computer-graphics
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.