FlowCanvas Forums › Support › [FR] OnRenderImage node?
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:
It would be great if this could be incorporated directly into FC!
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! π
Join us on Discord: https://discord.gg/97q2Rjh
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!
Thanks a lot for your kind and positive feedback! π
Join us on Discord: https://discord.gg/97q2Rjh
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?
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 π
Join us on Discord: https://discord.gg/97q2Rjh
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
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?
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 π
Join us on Discord: https://discord.gg/97q2Rjh
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
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?
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.
Join us on Discord: https://discord.gg/97q2Rjh
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.
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)?
Ah yes, sorry. You are right π Forget about the switch node in between in this case.
Join us on Discord: https://discord.gg/97q2Rjh
Ah yes, sorry. You are right Forget about the switch node in between in this case.
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?).
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.
Join us on Discord: https://discord.gg/97q2Rjh