FunkinCrew / Funkin

A rhythm game made with HaxeFlixel
https://www.newgrounds.com/portal/view/770371
Other
2.88k stars 2.26k forks source link

[CRASH] Shader error makes Freeplay inaccessible #2220

Closed Johferson closed 3 months ago

Johferson commented 4 months ago

Please check for duplicates or similar issues, as well performing simple troubleshooting steps (such as clearing cookies, clearing AppData, trying another browser) before submitting an issue.

If you are playing the game in a browser, what site are you playing it from?

If you are playing the game in a browser, what browser are you using?

What version of the game are you using? Look in the bottom left corner of the main menu. (ex: 0.2.7, 0.2.1, shit like that)

0.3.0 PROTOTYPE

Have you identified any steps to reproduce the bug? If so, please describe them below in as much detail as possible. Use images if possible.

Please describe your issue. Provide extensive detail and images if possible.

Everytime I open Freeplay, it displays a long error that goes outside the screen (vertically) and crashes image

If you're game is FROZEN and you're playing a web version, press F12 to open up browser dev window, and go to console, and copy-paste whatever red error you're getting

SilverT4 commented 4 months ago

This may be an issue related to your computer's graphics drivers. Can you try checking for driver updates in Windows Update?

Also, if you press CTRL+C, you can copy that error message and paste it into Notepad. This works for many common error message boxes in Windows.

Johferson commented 4 months ago

This may be an issue related to your computer's graphics drivers. Can you try checking for driver updates in Windows Update?

It seems that it's more of an AMD issue than an installed driver issue. Idk really. Screenshot_2024-05-01-13-54-38-936_com twitter android-edit

Johferson commented 4 months ago

btw I forgot to put the full error message:


Error

[openfl.display.Shader] ERROR: Error compiling fragment shader Fragment shader failed to compile with the following errors: ERROR: 0:65: error(#132) Syntax error: "sample" parse error ERROR: error(#273) 1 compilation errors. No code generated

version 100

            #ifdef GL_ES
            #ifdef GL_FRAGMENT_PRECISION_HIGH
                precision highp float;
            #else
                precision mediump float;
            #endif
            #endif

    varying float openfl_Alphav;
    varying vec4 openfl_ColorMultiplierv;
    varying vec4 openfl_ColorOffsetv;
    varying vec2 openfl_TextureCoordv;

    uniform bool openfl_HasColorTransform;
    uniform vec2 openfl_TextureSize;
    uniform sampler2D bitmap;

    uniform bool hasTransform;
    uniform bool hasColorTransform;

    vec4 flixel_texture2D(sampler2D bitmap, vec2 coord)
    {
        vec4 color = texture2D(bitmap, coord);
        if (!hasTransform)
        {
            return color;
        }

        if (color.a == 0.0)
        {
            return vec4(0.0, 0.0, 0.0, 0.0);
        }

        if (!hasColorTransform)
        {
            return color * openfl_Alphav;
        }

        color = vec4(color.rgb / color.a, color.a);

        mat4 colorMultiplier = mat4(0);
        colorMultiplier[0][0] = openfl_ColorMultiplierv.x;
        colorMultiplier[1][1] = openfl_ColorMultiplierv.y;
        colorMultiplier[2][2] = openfl_ColorMultiplierv.z;
        colorMultiplier[3][3] = openfl_ColorMultiplierv.w;

        color = clamp(openfl_ColorOffsetv + (color * colorMultiplier), 0.0, 1.0);

        if (color.a > 0.0)
        {
            return vec4(color.rgb * color.a * openfl_Alphav, color.a * openfl_Alphav);
        }
        return vec4(0.0, 0.0, 0.0, 0.0);
    }

    uniform vec2 size;
    uniform vec4 color;

    void main()
    {
        vec4 sample = flixel_texture2D(bitmap, openfl_TextureCoordv);
        if (sample.a == 0.) {
            float w = size.x / openfl_TextureSize.x;
            float h = size.y / openfl_TextureSize.y;

            if (flixel_texture2D(bitmap, vec2(openfl_TextureCoordv.x + w, openfl_TextureCoordv.y)).a != 0.
            || flixel_texture2D(bitmap, vec2(openfl_TextureCoordv.x - w, openfl_TextureCoordv.y)).a != 0.
            || flixel_texture2D(bitmap, vec2(openfl_TextureCoordv.x, openfl_TextureCoordv.y + h)).a != 0.
            || flixel_texture2D(bitmap, vec2(openfl_TextureCoordv.x, openfl_TextureCoordv.y - h)).a != 0.)
                sample = color;
        }
        gl_FragColor = sample;
    }

OK

EliteMasterEric commented 4 months ago

I believe I have a fix for this issue incoming.

mariosbignuts commented 4 months ago

hell yeah tysm eric we love you

PixeltheProto commented 3 months ago

so how do i fix this issue since im having it

amyspark-ng commented 3 months ago

so how do i fix this issue since im having it

You'll have to wait for the update to come out

oddMLan commented 3 months ago

Fixed on v0.3.3

EliteMasterEric commented 3 months ago

This should be fixed in v0.3.3.