Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CRASH] Shader error makes Freeplay inaccessible #2220

Closed
2 of 8 tasks
Johferson opened this issue May 1, 2024 · 9 comments
Closed
2 of 8 tasks

[CRASH] Shader error makes Freeplay inaccessible #2220

Johferson opened this issue May 1, 2024 · 9 comments
Assignees
Labels
bug Something isn't working

Comments

@Johferson
Copy link

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 Johferson added the bug Something isn't working label May 1, 2024
@SilverT4
Copy link

SilverT4 commented May 1, 2024

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
Copy link
Author

Johferson commented May 1, 2024

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
Copy link
Author

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 EliteMasterEric changed the title Bug Report: Freeplay Error (It Crashes) [CRASH] Shader error makes Freeplay inaccessible May 8, 2024
@EliteMasterEric EliteMasterEric self-assigned this May 8, 2024
@EliteMasterEric
Copy link
Member

I believe I have a fix for this issue incoming.

@mariosbignuts
Copy link

hell yeah tysm eric we love you

@PixeltheProto
Copy link

so how do i fix this issue since im having it

@amyspark-ng
Copy link

so how do i fix this issue since im having it

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

@oddMLan
Copy link

oddMLan commented May 15, 2024

Fixed on v0.3.3

@EliteMasterEric
Copy link
Member

This should be fixed in v0.3.3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

7 participants