At first some facts to the last release:
- OpenGL driver requires pixel shader 1.1
- DirectX needs pixel shader 2.0 (the last DX SDK (June) I have does not allow me to use lower versions)
- the depth is saved as 16Bit grayscale PNG file (great compression, also used for animated depth/alpha in
MPEG's .mza channel)
- depth texture is passed as A1R5G5B5 texture to the shader
- every room has a different setting:
-- 1. room has two layers and two lights
-- 2. room has one layer and two lights
-- 3. (new) room has one layer and one light
The more layers the slower it becomes. If shadows are enabled it needs more time to calculate them when more lights are enabled.
Conclusion: the highest framerate can be reached in the 3rd room. So if you post the FPS please refer to the first room
There seems to be something wrong with the OpenGL driver/shader. Have you noticed a difference between DX an OGL driver? For me, I can't see the transparent sculpture when using OpenGL driver, though it does work fine with DX.
The shaders are currently not optmized. I tried to write precalculated depth values directly to the texture, but I had some wrong results with OpenGL (have't tried it with DX yet). So what I'm doing is calculating them within the shader which results in a framedrop of 200fps on my configuration compared to writing precalculated values. But I can reduce the 7 operations to 3 which should gain some more fps.
@sio2: your app did not worked properly for me but it was helpful. I could use some parts as base. Thanx.
@omaremad: I don't really understand how to do this with the alpha test but using the alpha channel for depth is a bad idea (although it might work). As you see I'm using 16Bit values for depth but irrlicht only provides textures with 8Bit alpha, which is not enough for a nice look. Besides I need the alpha channel. And initiating the depth buffer with a low poly model won't work. Take a look into the 2nd room. Also it's additional work to create these models. I'm using simple boxes for collision detection.
If someone's interested: I uploaded the new backgrounds to my site, the link is in my first post.