openframeworks / openframeworks/openFrameworks
Raspberry Pi / ofGraphics and ofFbo not drawing in conjunction with ofShader
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 10.4k
- Forks
- 2.6k
- Avg merge
- 1d 21h
- Merged PRs (30d)
- 9
Description
This is basically what's being discussed here:
https://forum.openframeworks.cc/t/app-for-raspberry-pi-integrating-shaders-and-ofgraphics-objects/28848/7
I've nailed it down to the "%extensions%\n" lines in ofGLProgammableRenderer.cpp (line 1860 and line 1867). It's fairly evident that those lines are causing problems as ofShader reports,
[ error ] ofShader: checkProgramLinkStatus(): program failed to link
[ error ] ofShader: ofShader: program reports:
ERROR:LEX/PARSE-1 (vertex shader, line 1) Syntax error
glGetError 0x502
Simply commenting out the lines make everything work fine, but looking at the error in more detail it seems like ofStringReplace which is supposed to replace that line with "" from line 2293 is not replacing that line but rather sending %extensions% in the header part of the shader.
Fix option 1: just taking out the %extensions% from the rPi shaders header, but that might lead to problems later if we have to define certain extensions at some point.
Fix option 2: look into why ofStringReplace is not doing it's job on the rPi.
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 with ofGLProgammableRenderer.cpp around lines 1860, 1867, and 2293, then trace how the %extensions% placeholder is handled for Raspberry Pi shaders. Reproduce the shader link error and verify that the placeholder is removed before linking and that ofGraphics, ofFbo, and ofShader draw together without the reported failure.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp, raspberry-pi
- Domain
- computer-graphics, embedded-iot
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100