/Camera Shaders? Or Fullscreen Shaders

About Monkey 2 Forums Monkey 2 Programming Help /Camera Shaders? Or Fullscreen Shaders

This topic contains 6 replies, has 2 voices, and was last updated by  scurty 1 year, 4 months ago.

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #12902

    scurty
    Participant

    Having difficulty trying to apply a shader to the entire Camera View port or entire Canvas.
    For example rendering a Radial Blur or Bloom to encompass everything on screen or “within camera bounds.”

    Any suggestions?

    EDIT: I see PostEffect in Mojo3D but not in Mojo2D. xD

    #13124

    Ethernaut
    Participant

    This doesn’t directly answer your question, but may help:
    https://github.com/DoctorWhoof/Mojo-Shader-Tests

    To do what you want, just create an image canvas with the associated shader, then draw to that canvas, flush it and draw that image into the “main” canvas.

    If I have time later I can make a little example.
    Cheers!

    #13128

    scurty
    Participant

    Yeah I was looking at your examples yesterday. I think I can try something, but I’m sure one more example won’t hurt. Learning lots from these thank you!

    #13133

    Ethernaut
    Participant

    Updated!
    The shader is kinda heavy, though. May not run at 60fps at high resolutions. Dialing the blur samples down speeds things up.

    https://github.com/DoctorWhoof/Mojo-Shader-Tests

    #13146

    scurty
    Participant

    Yo, that’s really beautiful. Genius. What resources did you find to learn how to write these? I’m interested in getting down the basics.

    #13151

    Ethernaut
    Participant

    The GL shading language itself is not that hard, you can learn most of what you need by reading this and doing the exercises directly in the web page: https://thebookofshaders.com

    The difficult part for me was understanding how it connects to Monkey2 and Mojo, and it took a lot of trial an error. That’s why I put together those examples, so that people trying the same would find it easier.

    However, those are all 2D. I still haven’t successfully made a 3D material with its own shader, although I haven’t tried recently.

    #13165

    scurty
    Participant

    Thanks so much. 😉

Viewing 7 posts - 1 through 7 (of 7 total)

You must be logged in to reply to this topic.