Seems like a lot of work then if you need to use a depthbuffer rendertarget.
Maybe the DepthReadmode(ObjectiD,8) does work, but that doesn't help me with controlling middle depth objects (e.g. on top of everything except the object I set to 8).
OK, here's an explanation of what I'm trying to do.
I have created some spotlights using cones with lightmaps and they work really well.
I have a problem with the cones going through the floor so I thought about obscuring them with some planes. I have coloured one red for reference in the screen shots.
I figured I'd use the planes to selectively clip away the spurious parts of the cone that fall outside the arena. However, I can only seem to do this using SetObjectDepthRange(obj,0,0) because transparent objects still show on top if I use SetObjectDepthReadmode(obj,8)
I expect the pre-set rules for transparent objects supersede the "always on top" so it doesn't work without setting up depth tests for everything (e.g. the transparent light cone in front of this and behind that)
Anyway, you can see from the screens that it works using depthrange but under some conditions, the spotlight can overlap the red plane and I cannot force it on top because of using the SetObjectDepthRange(obj,0,0) seems to take ultimate top depth (near and near). If I use SetObjectDepthRange(obj,0,0.2) for the blocker and SetObjectDepthRange(obj,0,0.1) for the light it "should" work?
^^ I just tried this while I thought about it and it works
However, I'm not using DepthReadmode at all now, so it seems a bit hacky still. My guess with these settings then is that the blocker is hard-coded at a depth of 20% of the total camera depth range and the spotlight object is hard-coded at a depth of 10% of the total camera depth range?
Does depthrange map to camera range? Currently my camera range is near 1 >> far 6000.