baaahs / sparklemotion

Sparkle Motion
MIT License
40 stars 13 forks source link

:bug: Using `vec4 inColor` for color filtering doesn't use the upstream color for that pixel like this does: #444

Open xian opened 2 years ago

xian commented 2 years ago
// @param fragCoord uv-coordinate
// @return color
vec4 upstreamColor(vec2 fragCoord);
xian commented 2 years ago

Appears to be because the projection shader is being run after the paint shader:

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

    // Invoke Scale
    p0_scalei_result = p0_scale_main(p3_flatProjectioni_result);

    // Invoke Time Shift
    p1_timeShifti_result = p1_timeShift_main();

    // Invoke Acid at the Disco
    p2_acidAtTheDisco_mainImage(p2_acidAtTheDisco_fragColor, p0_scalei_result);

    // Invoke Flat Projection
    p3_flatProjectioni_result = p3_flatProjection_main(in_pixelLocation);

    // Invoke Sparklez™
    p5_sparklez_mainImage(p5_sparklez_fragColor, p0_scalei_result);

    // Invoke HSB
    p6_hsbi_result = p6_hsb_main(p5_sparklez_fragColor);

    sm_result = p6_hsbi_result;
}