zdepth / gl shaders / transparency issues

Hi,

here is my question in two words :
how to apply a depth of field filter effect that work fine with transparent materials ?

here is the director cut version of this question :
I use 2d filters based on the depth information, retrieved from

texture2D(bgl_DepthTexture,gl_TexCoord[0].xy).x

On a lot of objects in the game, I applied custom gl shaders that give the ability to define material properties in game. Among theses properties one can define the transparency.

my issue is that I’m unable to keep the right zdepth information when using these shaders : bgl_DepthTexture gives no information at all, whatever the .a value of the mat was, about the ‘pixel zdepth’ and returns the next zdepth of the opaque object in the background.

two exceptions I know, where the material zdepth is still available :
mat defined as alphaclip + transparency enabled
mat defined as opaque + transparency disabled (obviously)

but I can’t use alphaclip in my case (several layers of objects) I need something like
opaque + transp enabled or
alphablend + transp disabled
add mode also work… (as alphablend to my point of view, is there a description somewhere, I didn’t found the particularity of it)
again, these modes work as I use GL shaders, not blender materials.

zdepth inverse or zdepth offset options don’t seem to do anything (and what about the ‘scanline only’ notice ? I don’t understand)

I was thinking to different tricks to make it works, but well…
. tweak the bgl_DepthTexture value by near pixel color comparison (same or near color = same depth and other depth tests before)
. find the right blender mat configuration (something like ‘ok do the job about transparency in bgl_RenderedTexture, but don’t change anything about the zdepth values in bgl’)

thanks for any feedback / pointers / tricks, jerome

is it possible to give to a 2Dfilter a texture to work with, like one can do with material shader with setSampler()… ?
is there other input about textures than bgl_RenderedTexture and bgl_DepthTexture ?

is it possible to give to a 2Dfilter a texture to work with, like one can do with material shader with setSampler()… ?

No not in the official build. But I know that some body has made a patch for that more then a year ago.

is there other input about textures than bgl_RenderedTexture and bgl_DepthTexture ?

bgl_LuminanceTexture