Raymarching Plugin keeps lagging..

FFGL, OSC, GLSL. If you like abbreviations, this is the forum for you
Post Reply
julzzzz
Met Resolume in a bar the other day
Posts: 3
Joined: Wed Apr 29, 2020 15:57

Raymarching Plugin keeps lagging..

Post by julzzzz »

Hey everybody,
I have been struggling with this problem for quite some time now. also asked around to people from the developing community but no luck or solution yet. So i thought I would give it a try here.

I have been building a few concept pluggins for resolume using raymarching. But every time i open up the layer where my plugin is loaded to tweak a parameter, the effect it starts lagging really bad...
The strange thing is that when i automate a value on the timeline and then click on another layer so that the parameters are not visible anymore, then it starts running at a smooth and steady fps.
The same thing happens when i want to link a FFT to a parameter of the shader.
So I only experience the lag when i manually move the slider of the plugin I made.
Could it be that resolume recompiles my shader every time I manually change a value?
This shadertoy link is one my shaders that I ported to resolume where this lag occurs:
https://www.shadertoy.com/view/wlGSzm

When i compile really simple code moving the slider doesn't seem to cause any lag. So I assumed that the ray-marching shaders would just be to complex computationally for resolume to handle. But I find that hard to believe since like I said before the moment that I hide the tweakable parameters from sight even a complex ray marching shader starts running at a smooth FPS, even if i automated tons of the parameters with in in resolume.

I hope somebody on this forum can help me out on this one! I really want to release some really cool plugins to the community but this intense lag problem makes them virtually useless in a live setting atm..

If i just compile a really simple code like posted below, every thing seems to work just fine. But when i replace this code with something more complex similar to the code in the shadertoy link i posted the lag starts occurring.. :
//-------------------------------------------------begin code

// Created by Julian on 15/12/2019.
#include "shader.h"

static PluginInstance y = Source::CreatePlugin<Shade>({"APed","ShaderT2"} );
static const std::string fShader0 = R"(

void main()
{
fragColor = vec4(red, 0. , 0. ,1.0);
}
)";

Shade::Shade()
{
SetFragmentShader(fShader0);
AddParam(Param::Create(“red", .9));
}
Shade::~Shade()

{
}
//-------------------------------------------------end code

I was really hoping anybody here can help me a bit further on this problem, that would be awesome :D

Post Reply