...unfortunately, it's not as easy as i thought it would be. If you enable transparency at least on the vase (which your example doesn't do, but your gl-hack does...so your hack is nothing else but a non-allowed version of obj.setTransparency(100)
, you have two problems: The alpha value gets written into the framebuffer, which results in the background being blended with it and the sorting of vase and shadow isn't correct, so that the shadow will be rendered in front of the vase in your example.
My idea was to create a shader that writes every pixel as opaque (i.e. alpha = 1.0). That's a neat idea, but it doesn't work because gl's blending process can't be controlled by the shader and happens after the shader's execution. Which means that an alpha of 1.0 results in a black square below the vase. So that's obviously not an option...
Enabling transparency and use the IRenderHook implementation makes the shadow look better as the alpha of the table (=1.0) will be written into the frame buffer and the shadow doesn't change this. But then, the vase also doesn't write it's alpha, which is fine as long the table is behind it. But at the top of the vase, it's before the background and with no alpha written at that point, the background blends over the vase...no option either.
The best solution to all this would be what i mentioned quite early in this thread: Separate the shadow from the vase. That way, the vase and table can be fully opaque and the only transparent object would be the shadow. That combined with the IRenderHook would prevent the shadow from battling with the background, the vase wouldn't blend with the background either and the sorting between vase and shadow would be fine too. Another solution would be to bake the shadow into the table's texture instead of the vase if that's feasible.
As long as you have a none-opaque frame buffer, i don't see any other solution than the two above.