2D Filters: referencing textures?

Hey. Stupid question that I may have already gotten an answer for… Is it possible to use a texture image in one’s custom 2D filter script? I’d like to be able to use textures in my 2D filter, for broken glass, rain, etc. so it’d be quite useful if anyone knows how… Thanks!

If I recall correctly, there’s no built-in, normal way to do this in a 2D filter. As Kupoman mentioned in another thread, you can grab a Harmony build (from GraphicAll perhaps, or wherever else you can find it), since that allows you to pass in textures as uniform samplers. Alternatively, you might be able to do it with a GLSL 3D shader applied to a plane, and, again, pass textures in as uniform samplers.

Are you already passing in uniforms via python? You can pass in textures that way too using the following function:
http://www.blender.org/documentation/blender_python_api_2_65_3/bge.types.html#bge.types.BL_Shader.setSampler

As arguments it takes the name of the sampler uniform, and then an index that corresponds to the textures attached to that shader’s material. This should be the order they appear in the texture panel.

Hm. For now, I want to stay within standard Blender builds, so as to avoid issues with upgrading/support. Where might I find something on this second approach you speak of?

I see… Time to get to work. Thank you!