sparklemotion icon indicating copy to clipboard operation
sparklemotion copied to clipboard

GLSL error: Use of undeclared identifier 'beatWarpiness'

Open xian opened this issue 3 years ago • 0 comments

2021-05-29 00:21:53.040 [Pinky Main] INFO  ModelRenderEngine - Compiling Brightness on PixelArrayDevice
2021-05-29 00:21:53.046 [Pinky Main] ERROR PatchResolver - Error preparing program
baaahs.gl.glsl.CompilationException: GLSL compilation error: ERROR: 0:7: Use of undeclared identifier 'beatWarpiness'

        at baaahs.gl.glsl.CompiledShader$validate$1.invoke(CompiledShader.kt:36)
        at baaahs.gl.glsl.CompiledShader$validate$1.invoke(CompiledShader.kt:9)
        at baaahs.gl.LwjglGlManager$LwjglGlContext.runInContext(LwjglGlManager.kt:36)
        at baaahs.gl.glsl.CompiledShader.validate(CompiledShader.kt:33)
        at baaahs.gl.GlContext$compile$1.invoke(GlContext.kt:65)
        at baaahs.gl.GlContext$compile$1.invoke(GlContext.kt:11)
        at baaahs.gl.LwjglGlManager$LwjglGlContext.runInContext(LwjglGlManager.kt:36)
        at baaahs.gl.GlContext.compile(GlContext.kt:53)
        at baaahs.gl.glsl.GlslProgramImpl.<init>(GlslProgram.kt:48)
        at baaahs.gl.render.RenderEngine.compile(RenderEngine.kt:26)
        at baaahs.gl.render.ModelRenderEngine.compile(ModelRenderEngine.kt:77)
        at baaahs.gl.render.RenderManager.compile(RenderManager.kt:37)
        at baaahs.gl.patch.PatchResolver.buildProgram(PatchResolver.kt:31)
        at baaahs.gl.patch.BasePatchResolver.createRenderPlan(PatchResolver.kt:89)
        at baaahs.show.live.ActivePatchSet.createRenderPlan(OpenShow.kt:136)
        at baaahs.fixtures.FixtureManager$maybeUpdateRenderPlans$elapsedMs$1.invoke(FixtureManager.kt:100)
        at baaahs.fixtures.FixtureManager$maybeUpdateRenderPlans$elapsedMs$1.invoke(FixtureManager.kt:11)
        at baaahs.UtilKt.timeSync(util.kt:72)
        at baaahs.UtilKt.timeSync(util.kt:69)
        at baaahs.fixtures.FixtureManager.maybeUpdateRenderPlans(FixtureManager.kt:99)
        at baaahs.ShowRunner.housekeeping(ShowRunner.kt:53)
        at baaahs.StageManager.housekeeping(StageManager.kt:182)
        at baaahs.StageManager.renderAndSendNextFrame(StageManager.kt:171)
        at baaahs.StageManager.renderAndSendNextFrame$default(StageManager.kt:167)
        at baaahs.Pinky$run$elapsedMs$1.invokeSuspend(Pinky.kt:143)
        at baaahs.Pinky$run$elapsedMs$1.invoke(Pinky.kt)
        at baaahs.UtilKt.time(util.kt:65)
        at baaahs.UtilKt.time(util.kt:62)
        at baaahs.Pinky.run(Pinky.kt:141)
        at baaahs.Pinky$run$1.invokeSuspend(Pinky.kt)
        at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
        at kotlinx.coroutines.DispatchedTaskKt.resume(DispatchedTask.kt:227)
        at kotlinx.coroutines.DispatchedTaskKt.dispatch(DispatchedTask.kt:166)
        at kotlinx.coroutines.CancellableContinuationImpl.dispatchResume(CancellableContinuationImpl.kt:362)
        at kotlinx.coroutines.CancellableContinuationImpl.resumeImpl(CancellableContinuationImpl.kt:396)
        at kotlinx.coroutines.CancellableContinuationImpl.resumeImpl$default(CancellableContinuationImpl.kt:388)
        at kotlinx.coroutines.CancellableContinuationImpl.resumeUndispatched(CancellableContinuationImpl.kt:484)
        at kotlinx.coroutines.ResumeUndispatchedRunnable.run(Executors.kt:161)
        at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
        at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
        at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630)
        at java.base/java.lang.Thread.run(Thread.java:832)
2021-05-29 00:21:53.047 [Pinky Main] INFO  ShowRunner - #version 330 core
#ifdef GL_ES
precision mediump float;
#endif

// SparkleMotion-generated GLSL

layout(location = 0) out vec4 sm_result;

struct ModelInfo {
    vec3 center;
    vec3 extents;
};

// Data source: BeatLink
uniform float in_beatLink;

// Data source: Beat Warp Slider
uniform float in_beatWarpSlider;

// Data source: Brightness Slider
uniform float in_brightnessSlider;

// Data source: Model Info
uniform ModelInfo in_modelInfo;

// Data source: Pixel Location
uniform sampler2D ds_pixelLocation_texture;
vec3 ds_pixelLocation_getPixelCoords(vec2 rasterCoord) {
    return texelFetch(ds_pixelLocation_texture, ivec2(rasterCoord.xy), 0).xyz;
}
vec3 in_pixelLocation;

// Data source: Resolution
uniform vec2 in_resolution;

// Data source: Saturation Slider
uniform float in_saturationSlider;

// Data source: Size Slider
uniform float in_sizeSlider;

// Data source: Time
uniform float in_time;

// Shader: Flat Projection; namespace: p0
// Flat Projection

vec2 p0_flatProjectioni_result = vec2(0.);

#line 11
const float p0_flatProjection_PI = 3.141592654;

#line 15
vec2 p0_flatProjection_main(vec3 pixelLocation) {
    vec3 pixelOffset = (pixelLocation - in_modelInfo.center) / in_modelInfo.extents + .5;
    return vec2(1.-pixelOffset.x, pixelOffset.y);
    // vec3 normalDelta = normalize(pixelOffset);
    // float theta = atan(abs(normalDelta.z), normalDelta.x); // theta in range [-π,π]
    // if (theta < 0.0) theta += (2.0f * PI);                 // theta in range [0,2π)
    // float u = theta / (2.0f * PI);                         // u in range [0,1)
    // float v = (pixelOffset.y + modelInfo.extents.y / 2.0f) / modelInfo.extents.y;
    // return vec2(u, v);
}

// Shader: New Shader; namespace: p1
// New Shader

float p1_newShaderi_result = 0.;

#line 6
float p1_newShader_main(float inTime, float beat) {
    return inTime + beat * beatWarpiness;
}

// Shader: Scale; namespace: p2
// Scale

vec2 p2_scalei_result = vec2(0.);

#line 5
vec2 p2_scale_main(vec2 uvIn) {
  return (uvIn - .5) / in_sizeSlider + .5;
}

// Shader: Bandlimited Synthesis 1 ; namespace: p3
// Bandlimited Synthesis 1 

vec4 p3_bandlimitedSynthesis1_fragColor = vec4(0., 0., 0., 1.);

#line 37
bool  p3_bandlimitedSynthesis1_mode;

#line 29
vec3 p3_bandlimitedSynthesis1_fcos( in vec3 x )
{
    vec3 w = fwidth(x);
    return cos(x) * sin(0.5*w)/(0.5*w);       // exact
    // return cos(x) * smoothstep(6.2832,0.0,w); // approx
}

#line 38
vec3  p3_bandlimitedSynthesis1_mcos( vec3 x){return p3_bandlimitedSynthesis1_mode?cos(x):p3_bandlimitedSynthesis1_fcos(x);}

#line 42
vec3 p3_bandlimitedSynthesis1_getColor( in float t )
{
    vec3 col = vec3(0.6,0.5,0.4);
    col += 0.14*p3_bandlimitedSynthesis1_mcos(6.2832*t*  1.0+vec3(0.0,0.5,0.6));
    col += 0.13*p3_bandlimitedSynthesis1_mcos(6.2832*t*  3.1+vec3(0.5,0.6,1.0));
    col += 0.12*p3_bandlimitedSynthesis1_mcos(6.2832*t*  5.1+vec3(0.1,0.7,1.1));
    col += 0.11*p3_bandlimitedSynthesis1_mcos(6.2832*t*  9.1+vec3(0.1,0.5,1.2));
    col += 0.10*p3_bandlimitedSynthesis1_mcos(6.2832*t* 17.1+vec3(0.0,0.3,0.9));
    col += 0.09*p3_bandlimitedSynthesis1_mcos(6.2832*t* 31.1+vec3(0.1,0.5,1.3));
    col += 0.08*p3_bandlimitedSynthesis1_mcos(6.2832*t* 65.1+vec3(0.1,0.5,1.3));
    col += 0.07*p3_bandlimitedSynthesis1_mcos(6.2832*t*131.1+vec3(0.3,0.2,0.8));
    return col;
}

#line 56
void p3_bandlimitedSynthesis1_mainImage(out vec4 fragColor, in vec2 fragCoord )
{
    // coordiantes
        vec2 q = (2.0*(fragCoord + vec2(1.75, .0))-in_resolution.xy)/in_resolution.y;

    // separation
    float th =  1.8*sin(p1_newShaderi_result);
    p3_bandlimitedSynthesis1_mode = (q.x<th);
    
    // deformation
    vec2 p = 2.0*q/dot(q,q);

    // animation
    p.xy += 0.05*p1_newShaderi_result;

    // texture
    vec3 col = min(p3_bandlimitedSynthesis1_getColor(p.x),p3_bandlimitedSynthesis1_getColor(p.y));

    // vignetting
    col *= 1.5 - 0.2*length(q);
    
    // separation
    col *= smoothstep(0.005,0.010,abs(q.x-th));
    
    // palette
    if( q.y<-0.9 ) col = p3_bandlimitedSynthesis1_getColor( fragCoord.x/in_resolution.x );

    fragColor = vec4( col, 1.0 );
}

void p3_bandlimitedSynthesis1i_init() {    
#line 37
  p3_bandlimitedSynthesis1_mode = false;;
}

// Shader: Saturation; namespace: p4
// Saturation

vec4 p4_saturationi_result = vec4(0., 0., 0., 1.);

#line 4
vec3 p4_saturation_rgb2hsv(vec3 c)
{
    vec4 K = vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0);
    vec4 p = mix(vec4(c.bg, K.wz), vec4(c.gb, K.xy), step(c.b, c.g));
    vec4 q = mix(vec4(p.xyw, c.r), vec4(c.r, p.yzx), step(p.x, c.r));

    float d = q.x - min(q.w, q.y);
    float e = 1.0e-10;
    return vec3(abs(q.z + (q.w - q.y) / (6.0 * d + e)), d / (q.x + e), q.x);
}

#line 17
vec3 p4_saturation_hsv2rgb(vec3 c)
{
    vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);
    vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);
    return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);
}

#line 26
vec4 p4_saturation_main(vec4 inColor) {
    if (in_saturationSlider == 1.) return inColor;

    vec4 clampedColor = clamp(inColor, 0., 1.);
    vec3 hsv = p4_saturation_rgb2hsv(clampedColor.rgb);
    hsv.y *= in_saturationSlider;
    return vec4(p4_saturation_hsv2rgb(hsv), clampedColor.a);
}

// Shader: Brightness; namespace: p5
// Brightness

vec4 p5_brightnessi_result = vec4(0., 0., 0., 1.);

#line 5
vec4 p5_brightness_main(vec4 inColor) {
    vec4 clampedColor = clamp(inColor, 0., 1.);
    return vec4(clampedColor.rgb * in_brightnessSlider, clampedColor.a);
}


#line 10001
void main() {
    // Init Bandlimited Synthesis 1 .
    p3_bandlimitedSynthesis1i_init();

    // Invoke Pixel Location
    in_pixelLocation = ds_pixelLocation_getPixelCoords(gl_FragCoord.xy);

    // Invoke Flat Projection
    p0_flatProjectioni_result = p0_flatProjection_main(in_pixelLocation);

    // Invoke New Shader
    p1_newShaderi_result = p1_newShader_main(in_time, in_beatLink);

    // Invoke Scale
    p2_scalei_result = p2_scale_main(p0_flatProjectioni_result);

    // Invoke Bandlimited Synthesis 1 
    p3_bandlimitedSynthesis1_mainImage(p3_bandlimitedSynthesis1_fragColor, p2_scalei_result);

    // Invoke Saturation
    p4_saturationi_result = p4_saturation_main(p3_bandlimitedSynthesis1_fragColor);

    // Invoke Brightness
    p5_brightnessi_result = p5_brightness_main(p4_saturationi_result);

    sm_result = p5_brightnessi_result;
}

2021-05-29 00:21:53.048 [Pinky Main] DEBUG ShowOpener - Opening show error

xian avatar Jun 01 '21 20:06 xian