Hopefully this is the right place for me to post this topic..
I can't get any custom 2d filter scripts to work in the blender game engine and it's driving me crazy. I need a toon outline filter for the game I'm working on. The uploader of this filter says it works fine on his windows machine.
I don't know if there could be a problem with the code as I don't know python, but the script is as follows and I've been told there is nothing wrong with it:
I would like to ask someone with a little knowledge of blender (you'll have to set up a tiny bit of game logic) who maybe has access to a PC and a Mac to try this filter and tell me if it is working on OS X or not.
I get no outline when I play the game engine.
I can't get any custom 2d filter scripts to work in the blender game engine and it's driving me crazy. I need a toon outline filter for the game I'm working on. The uploader of this filter says it works fine on his windows machine.
I don't know if there could be a problem with the code as I don't know python, but the script is as follows and I've been told there is nothing wrong with it:
Code:
uniform sampler2D bgl_RenderedTexture;
uniform sampler2D bgl_DepthTexture;
void main()
{
float depth = texture2D( bgl_DepthTexture, gl_TexCoord[0].xy).r;
float depth2 = texture2D( bgl_DepthTexture, gl_TexCoord[0].xy + vec2(0,0.002)).r;
float depth3 = texture2D( bgl_DepthTexture, gl_TexCoord[0].xy + vec2(0.002,0)).r;
float fac = abs(depth-depth2) + abs(depth-depth3);
float intensity = 300;
vec4 sub = vec4(fac*intensity,fac*intensity,fac*intensity,0);
gl_FragColor = texture2D( bgl_RenderedTexture, gl_TexCoord[0].xy ) - sub;
}
I get no outline when I play the game engine.