Funkin icon indicating copy to clipboard operation
Funkin copied to clipboard

[CRASH] Shader error makes Freeplay inaccessible

Open Johferson opened this issue 2 months ago • 8 comments

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?

  • [ ] Google Chrome (or chomium based like Brave, vivaldi, MS Edge)
  • [ ] Firefox
  • [ ] Safari

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

Johferson avatar May 01 '24 04:05 Johferson

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.

SilverT4 avatar May 01 '24 05:05 SilverT4

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 avatar May 01 '24 05:05 Johferson

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

Johferson avatar May 01 '24 12:05 Johferson

I believe I have a fix for this issue incoming.

EliteMasterEric avatar May 08 '24 02:05 EliteMasterEric

hell yeah tysm eric we love you

mariosbignuts avatar May 08 '24 04:05 mariosbignuts

so how do i fix this issue since im having it

PixeltheProto avatar May 09 '24 20:05 PixeltheProto

so how do i fix this issue since im having it

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

amyspark-ng avatar May 11 '24 01:05 amyspark-ng

Fixed on v0.3.3

oddMLan avatar May 15 '24 07:05 oddMLan