[FR] OnRenderImage node?

Forums πŸ’¬ FlowCanvas βš™οΈ Support [FR] OnRenderImage node?

Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • #12425
    elvisish
    Participant

      I’ve been using an awesome node extension a super helpful discord user made for me (I’ve attached it) that allows you to perform image operations via flowcanvas. I needed to blit a shader to the screen, and thanks to this listener and node, I was able to add aΒ water effect directly to the camera:

      [attachment file=”unknown (6).png”]

      [attachment file=”unknown (7).png”]

      It would be great if this could be incorporated directly into FC!

      #12438
      Gavalakis
      Keymaster

        Hello there,

        Sure thing :). I’ve just implemented that into FC and will be there in the next version. I have also attached the changes for you here.

        The new node “OnRenderImage” can be found under “Events/Object/Rendering”.

        Let me know if that works for you.

        Cheers! πŸ™‚

        #12437
        elvisish
        Participant

          Thank you SO much, so happy to see it in the latest version and sorry for the delay, once again I’ve been itching to try it out but wanted to really give it a good looking at! Really, REALLY appreciate all of the feature requests, it’s such a pleasure to work with FC and it just keeps getting better and better!

          #12436
          Gavalakis
          Keymaster

            Thanks a lot for your kind and positive feedback! πŸ™‚

            #12435
            elvisish
            Participant

              It’s really awesome to have the ability to blit shaders to the screen, I love it! With the script @net8floz made for me on the discord, if I wanted to disable OnRenderImage calls (for performance reasons, or to stop using a shader on-screen) I’d just disable the OnRenderImageListener.cs script like this:

              However, with the new OnRenderImage event, if it is in a graph, it is always being called I believe? The method I’m using currently to disable an effect is this:

              This just passes it straight through, but it’s still technically a blit call, and if I just remove anything from the OnRenderImage event, the screen stops rendering anything. If I manually disable the Event Router, it works again, so I imagine the event router always calls OnRenderImage if the OnRenderImage event node is present in the graph. Is there another way of manually disabling and enabling the OnRenderImage call, for performance reasons?

              #12434
              Gavalakis
              Keymaster

                Hey,

                You can select the connection and deactivate it in its inspector (there is a transparent field named “Active” which is true by default of course). Let me know if that works for you πŸ™‚

                #12433
                elvisish
                Participant

                  [quote quote=2827]Hey, You can select the connection and deactivate it in its inspector (there is a transparent field named β€œActive” which is true by default of course). Let me know if that works for you πŸ™‚ [/quote]

                  Ahh sorry, I meant at runtime! If I need to stop blitting entirely (say, for an underwater effect) can the whole blit be deactivated easily?

                  #12432
                  Gavalakis
                  Keymaster

                    Ah. Hmm you could simply add a Switch Condition node before the Blit node, and have it check some boolean variable for example, which you could change in runtime in any way you’d like to πŸ™‚

                    #12431
                    elvisish
                    Participant

                      [quote quote=2831]Ah. Hmm you could simply add a Switch Condition node before the Blit node, and have it check some boolean variable for example, which you could change in runtime in any way you’d like to πŸ™‚ [/quote]
                      Yep, I would definitely do it with a switch, and just plug it in like this if I didn’t want to blit:

                      My main question was how to totally disable the blitting event without having to blit *something*, which this method currently is. If I disable the OnListener script at runtime:

                      …it totally stops an On Image Render call, but by having the built-in On Image Render event in a graph, the call is always made, and I have to send a blank blit pass, as demonstrated above. Is there anyway of totally disabling the OnRenderImage event at runtime if necessary, to save on performance and not have to do a straight blit pass?

                      #12430
                      Gavalakis
                      Keymaster

                        You should nnot really worry about disabling the event node. The event itself does not really consume any resources if it does not actually do anything : -). What consume resources here is mostly the Graphics.Blit call rather than the event itself. Thus simply having a switch node in between is a good way to do what you want. You can also disable the component if you want to use the other implementation.

                        #12429
                        elvisish
                        Participant

                          [quote quote=2834]You should nnot really worry about disabling the event node. The event itself does not really consume any resources if it does not actually do anything : -). What consume resources here is mostly the Graphics.Blit call rather than the event itself. Thus simply having a switch node in between is a good way to do what you want. You can also disable the component if you want to use the other implementation. [/quote]
                          So, the switch node would go in-between the OnRenderImage event and the blit, and it should blit to nothing? If I do that, the screen just freezes frame as the OnImageRender event is still calling for OnImageRender. How should I best arrange the switch node so that it stops making the call (so it doesn’t freeze the screen buffer)?

                          #12428
                          Gavalakis
                          Keymaster

                            Ah yes, sorry. You are right πŸ™‚ Forget about the switch node in between in this case.

                            #12427
                            elvisish
                            Participant

                              [quote quote=2841]Ah yes, sorry. You are right πŸ™‚ Forget about the switch node in between in this case. [/quote]
                              Haha, super sorry to keep annoying you with this question! SO, to clarify, blitting directly through is the best way of doing it, seeing as there’s no way to disable the blit if the OnImageRender node is present? I wonder if events could be disabled at runtime so as not to keep processing them unless necessary? Unless disabling a sub-graph could work in a situation like this (I’m not sure, I haven’t sue sub-graphs and I don’t know if disabling a subgraph would disable the event call?).

                              #12426
                              Gavalakis
                              Keymaster

                                Hello again,

                                Unfortunately there is no way to disable an event node altogether in runtime, however disabling subgraph will also disable all events within it, yes. So this can be a solution in regards to what you are trying to achieve in this case.

                              Viewing 14 posts - 1 through 14 (of 14 total)
                              • You must be logged in to reply to this topic.