u/ProgrammingQuestio

▲ 2 r/opengl

Multiple passes with different shaders? How to insert a new "step" after all frag shaders?

Sorry if the title is confusing. Hopefully I can explain it better:

Let's say you have a project that already has numerous shaders and things being done. You want to add color correction via a frag shader. You could go in and add the color correction frag shader logic to each and every existing frag shader. But that's a lot of effort and adds much complexity to all shaders. Is there a way to do multiple passes? So do everything as it's currently being done, but then also pass what's being rendered through this new shader, the color correction shader, before being displayed on the screen?

reddit.com
u/ProgrammingQuestio — 5 days ago

Multiple passes with different shaders? How to insert a new "step" after all frag shaders?

Sorry if the title is confusing. Hopefully I can explain it better:

Let's say you have a project that already has numerous shaders and things being done. You want to add color correction via a frag shader. You could go in and add the color correction frag shader logic to each and every existing frag shader. But that's a lot of effort and adds much complexity to all shaders. Is there a way to do multiple passes? So do everything as it's currently being done, but then also pass what's being rendered through this new shader, the color correction shader, before being displayed on the screen?

reddit.com
u/ProgrammingQuestio — 5 days ago

Why might highp float precision cause texture coord issues on embedded?

I just debugged an issue where textures would be shown correctly on my PC, but when running the same stuff on an embedded GPU, the tex coords seemed to not work. It would essentially grab the tex color in the first position? Eg. if I made the entire image red, but made the first pixel yellow, the entire quad would show up as yellow.

I realized that one change I had made since it last worked correctly on the embedded gpu was that I added precision highp float; to the frag shader. Once i changed that to mediump, the issue was resolved.

Any ideas as to why? I guess highp isn't supported or something? But why would that cause this sort of result?

reddit.com
u/ProgrammingQuestio — 2 months ago