Video as background eats CPU (obviously)
-
@hisefilo said in Video as background eats CPU (obviously):
Maybe a gif? it reduces size 10x
It will still be full bitmap when loaded into RAM though, no?
-
@d-healey Yes, but only 60mb for this quality
-
@hisefilo I think you’d probably be much better off using Lottie or OpenGL!
Not that this would be without issues, but more performant!
-
@UrsBollhalder That would be great! Any quick tip on how to add a video or frames within ScriptShader?
Just found this snippet but I guess will be a long way to figure it out.
const var Panel1 = Content.getComponent("Panel1"); const var shader = Content.createShader("shader"); //shader.setBlendFunc(true, shader.GL_SRC_ALPHA , shader.GL_ONE); Panel1.setPaintRoutine(function(g) { g.applyShader(shader, [0, 0, this.getWidth(), this.getHeight()]); }); const var Knob1 = Content.getComponent("Knob1"); inline function onKnob1Control(component, value) { shader.setUniformData("myValue", value); shader. }; Content.getComponent("Knob1").setControlCallback(onKnob1Control);
-
@hisefilo I was thinking more along the lines of creating that sort of landscape and fog with shader code all along, instead of using mentioned video. I'm not 100% sure, but I don't think that'd be even possible.
Doing shader code is not for the faint of heart in my experience... But there are many talented people out there:
Maybe you can find something landscape-like on shadertoy and then you can contact the creator to discuss possible licensing...
-
@UrsBollhalder Yes! that's a good idea. Will see if I can find something!
Thanks bro -
Actually the problem with most "landscapy" shaders on shadertoy is that they use some kind of textures, which isn't supported in HISE yet (you can only load fragment shaders in HISE which don't have the ability to load textures).
-
@Christoph-Hart Ohhh. I see.
Then... what if I do some kind of layered transparent pngs? and move them onNoteOn or whatever? (timers will kill cpu)This are 8 layers (moons, terrain, etc)
-
Yes that might sound like the best solution - and shuffling around 8 images at 25fps shouldn't kill the CPU.
-
@hisefilo - you could try independently scaling the layers - the "disney" technique...
-
@Lindon LOL true. HISE becomes a 2D animation framework
-
-
@Christoph-Hart LOL
-
@Christoph-Hart Haha, just wait...
-
Silly question. Anyone knows how to do a function that ramps from zero to 1 value in "x" time (without a timer callback)?, then to return to zero in "x" time ? like an attack and release but not for audio but UI ?? (yes I am trying to move objects like in a timeline)
-
@hisefilo What is going to be changing the value if not a timer?
-
@d-healey I was thinking in getSystemTime and parsing milliseconds. But maybe will use CPU as the timer callback
-
@hisefilo
getSystemTime
is a function that will give you the current time, it's not a callback. Why not give up on your crazy dreams of putting videos in audio plugins :p -
@d-healey never! LOL. I'm also thinking into a VR add-on to allow users to play VSTs in Metaverse
-
@hisefilo I wouldn't back that horse.