I’m working on a little patch that uses quads with textures on them in a 3d envirnoment, kinda 2.5 d.
Problem I’m having is that quad at the back sometimes appear over stuff at the front, this is made worse by some of the quads moving from the front to the back. Is there any way to override the Priority settings so the illusion of depth is maintained?
Im actually recreating a project that I originally did in after fx, and took hours to edit and render, so far its almost there and in real time, which is amazing!
My ultimate patch would have the flat textures casting shadows on to a ground plane as well, but Im not sure this would be possible! Ive seen (toms was it?) patch for shadows but havent tried that yet in this context.
Am I chasing an impossible feature or is this possible?
Thanks guys, every time I build something new I’m suprised!
Depth bufferings checked already but havent tried Cull yet.
Im using quads at the moment because i want flat cut models, dont know how I’d go about making them in a 3d Package, Id use a quad and alpha texture it there as well! Any suggestions for making flat cutout models easily gratefully recieved!
Alpha channels and depth buffering dont go well together. Make sure to draw all objects with alpha textures after everything else (this last sentence exactly describes the problem). change the drawing order of the nodes with the priority pins of the objects.
DirectX includes a little hack which is exposed with the AlphaTest (EX9 RenderState)node. This allows you to switch off writing to the depth buffer when the alpha of the object is below a given value. You will see a nonantialiased border around your alpha channel, but its better than nothing.
The help patch might explain this a little better.
Ok, I think I get that.
The problem was only happening when I was use multiple quads, I did try spreading the priority pin but got the feeling that priority isnt spreadable, is that the case?
Shame, it looked great but for the depth problem!
i got the feeling that priority isnt spreadable, is that the case?
exactly. we feared a huge performance drop when we needed to implement that.
anyway while you can not change the drawing order of your slices, you could swap the meaning of the slices at runtime. All slices are drawn in the order of the slice indes. So to reorder you can add some GetSlices in front of your Quads. just equip all texture, transform and color pins with a GetSlice and make sure the objects which are more in the back are drawn at the lower slice indices.