Shader without OpenGL

Sry if i seem a little demanding lately. I just have ideas that I find good so I feel like sharing them :slight_smile:

that being said I just revisited an older idea I once had, which is that it would be cool to put a visual effect on the output of each paint routine, a shader. but i don’t wanna do it with OpenGL, because of the uncertainty wether or not it will still be supported by every platform in the future etc. So I looked at the callstack of JUCE’ paint call and found this particular section very interesting.


It seems to me like this is the exact moment where a shader could come into place. cause in that scope (1) the whole paint routine of one single frame is being executed onto a juce::Image called “offscreenImage” and then in step 2 offscreenImage is being painted onto the window with this platform-specific lowlevel-object called WindowsBitmapImage, which probably looks a bit different for macs and linus, but hopefully similiar.

my idea is: why not put a method in between those 2 sections that just passes offscreenImage to the top level juce::Component of the project with some new juce::Component-function called something like applyShader(juce::Image) or so?

i think that would be a good idea, cause if that new method is not being overriden it would just be the same as before and no performance-difference either, but if anyone wants to override it they could have a lot of fun with shaders

What exactly is the feature request here?

Maybe I’m misunderstanding, but if you want something done in each paint routine, why can’t you just put that logic in your paint function?

because i want to apply an effect on the image of the window. imagine for example you wanted to apply blur to the whole window. you’d need to consider neighboring pixels of an image for that. it’s different than just painting something onto an image

Can’t you do that with

myPluginEditor.getTopLevelComponent()->setComponentEffect()

?

3 Likes

yeah i think i can :smiley: sry didn#t see that. this post can be closed

1 Like