I’m currently working with a very simple GLSL shader written for compatibility with HaxeFlixel that is meant to make an image scroll. It works fine for my computer, which uses an Nvidia graphics card. However, I’ve gotten reports from some people testing that their computers (which primarily run on AMD drivers) are getting crashes when trying to load the shader in game.
#pragma header
vec2 uv = openfl_TextureCoordv.xy;
vec2 fragCoord = openfl_TextureCoordv*openfl_TextureSize;
vec2 iResolution = openfl_TextureSize;
uniform float iTime;
uniform float xSpeed = 0.5;
uniform float ySpeed = 0;
uniform float timeMulti = 0.1;
#define time iTime
#define iChannel0 bitmap
#define texture flixel_texture2D
#define fragColor gl_FragColor
void main()
{
float time = iTime * timeMulti;
float xCoord = floor(fragCoord.x + time * xSpeed * iResolution.x);
float yCoord = floor(fragCoord.y + time * ySpeed * iResolution.y);
vec2 coord = vec2(xCoord, yCoord);
coord = mod(coord, iResolution.xy);
vec2 uv = coord/iResolution.xy;
vec4 color = texture(iChannel0, uv);
fragColor = color;
}
I’m not familiar at all with GLSL, so I’m kind of stuck on what could be causing issues with AMD drivers in particular.
Riley Reilly is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
1