When using 3D OpenGL commands with LE, it works fine as long no post-processing effects are used.
When post-processing effects are used, then the occlusion culling breaks in the 3D OpenGL commands, and they all draw in front of all other objects.
To fix this problem, there should be an optional parameter to RenderFramework(), which tells it to render only geometry and lights, or only post-processing effects:
RenderFramework(1);
// 3D OpenGL commands go here
RenderFramework(2);
The default parameter would be 0, and do the same what RenderFramework() without parameters does now: it renders the geometry and lights, and then the post-processing effects.
With this finer granularity control, we can now place 3D OpenGL commands between RenderFramework(1); and RenderFramework(2); and they will be rendered correctly.