G
GenesisPig
Guest
Hello:
I'm trying to make a simple outline shader for sprites. However, when I compile, I get a strange error:
Fragment Shader: shd_outline at line 9 : ''
This is the "void main()" command that appears anytime you make a new shader. I noticed that the "main" is not highlighted red like it is expected to be. Furthermore, the main appears to be nonfunctional even when I create a new shader. These problems persist between different project files as well.
Has the main become obsolete or something? Does anyone know a workaround?
Heres my fragment shader code:
//
// Simple passthrough fragment shader
//
varying vec2 v_vTexcoord;
varying vec4 v_vColour;
uniform float pixelH;
uniform pixelW;
void main() // <- Where the error is
{
vec2 offsetx;
offsetx.x = pixelW;
vec2 offsety;
offset.y = pixelH;
float alpha = texture2D( gm_BaseTexture, v_vTexcoord ).a;
alpha += ceil(texture2D( gm_BaseTexture, v_vTexcoord + offsetx).a;
alpha += ceil(texture2D( gm_BaseTexture, v_vTexcoord - offsetx).a;
alpha += ceil(texture2D( gm_BaseTexture, v_vTexcoord + offsety).a;
alpha += ceil(texture2D( gm_BaseTexture, v_vTexcoord - offsety).a;
gl_FragColor = v_vColour * texture2D( gm_BaseTexture, v_vTexcoord );
gl_FragColor.a = alpha;
}
I'm trying to make a simple outline shader for sprites. However, when I compile, I get a strange error:
Fragment Shader: shd_outline at line 9 : ''
This is the "void main()" command that appears anytime you make a new shader. I noticed that the "main" is not highlighted red like it is expected to be. Furthermore, the main appears to be nonfunctional even when I create a new shader. These problems persist between different project files as well.
Has the main become obsolete or something? Does anyone know a workaround?
Heres my fragment shader code:
//
// Simple passthrough fragment shader
//
varying vec2 v_vTexcoord;
varying vec4 v_vColour;
uniform float pixelH;
uniform pixelW;
void main() // <- Where the error is
{
vec2 offsetx;
offsetx.x = pixelW;
vec2 offsety;
offset.y = pixelH;
float alpha = texture2D( gm_BaseTexture, v_vTexcoord ).a;
alpha += ceil(texture2D( gm_BaseTexture, v_vTexcoord + offsetx).a;
alpha += ceil(texture2D( gm_BaseTexture, v_vTexcoord - offsetx).a;
alpha += ceil(texture2D( gm_BaseTexture, v_vTexcoord + offsety).a;
alpha += ceil(texture2D( gm_BaseTexture, v_vTexcoord - offsety).a;
gl_FragColor = v_vColour * texture2D( gm_BaseTexture, v_vTexcoord );
gl_FragColor.a = alpha;
}