Hello. First off, I am a shader ignoramus but on an old thread I found a pixel shader that seemed very short and simple and would blur a sprite, which was precisely what I needed.
However, once I attempted to run this in Studio, it crashed with the message: Pixel shader "shader/blue.ps" has varying "vec2 posVarying;" that does not exist in the vertext shader, etc.
I assumed this was due to incompatibility with AppGameKit studio, so I tried the same thing in AppGameKit classic. Sure enough, it worked!
Does anyone know what I would need to do to make this little shader compatible with Studio, or is it a lost cause? Thank you!
uniform sampler2D texture0;
varying vec2 posVarying;
varying vec2 uvVarying;
uniform vec2 agk_resolution;
float blurSizeH = 6.0 / agk_resolution.x;
float blurSizeV = 6.0 / agk_resolution.y;
void main()
{
vec4 sum = vec4(0.0);
for (float x = -4.0; x <= 4.0; x++)
for (float y = -4.0; y <= 4.0; y++)
sum += texture2D(texture0,vec2(uvVarying.x + x * blurSizeH, uvVarying.y + y * blurSizeV))/ 81.0;
gl_FragColor = sum;
}