Outlines and zorder

Blitz3D Forums/Blitz3D Programming/Outlines and zorder

Picklesworth(Posted 2006) [#1]
I'm working on adding mesh outlines to my game.

Originally, I was doing a multirender approach which was almost working solidly, but every technique with a sensible number of passes had a glitch, such as the fills being visible through other objects. It looks fixable, but I'd rather not. The multirender approach also gives me potential for problems when Blitz automatically masks anything that's completely black when using DrawImage.

I later realized that my polygon counts are going to be tiny, so I can easily get away with a scaled and flipped ghost mesh to do the outlines with. (Also doable, since the only high poly objects in the scene will not have outlines).

The next problem is that there are two potentially slow functions that would need to be called every frame, and I need to either avoid using them or make them faster.

The z-order stuff to avoid smashing between the outline and whatever it's sitting on top of looks extremely slow on paper. I have the program going through every visual object with an outline, and if the regular mesh is fully visible (boards act as occluders) it will change the outline mesh's z-order to be drawn last, on top of everything else.
Another problem also arises from that technique, which is that without another addition, the outlines will still have problems when a board is blocking the view partially from above.

My method here seems possible, but also feels like it's going to be painful.

Is there a way to tell Blitz, if it encounters z fighting between meshes, that a particular one takes precedence?



Currently, it looks like this:



octothorpe(Posted 2006) [#2]
Could you simply move your objects up a little bit so their outline meshes are further from the board? The player won't be able to get down on their hands and knees and use a microscope to prove that everything in your world is levitating by a centimeter. Worst case scenario he might be able to see a line of pixels under all your objects when standing at the perfect height on a ramp.


Picklesworth(Posted 2006) [#3]
I could do that, but I have an insane fear of arbitrary numbers :)

It is a good fallback plan, though.


octothorpe(Posted 2006) [#4]
As all good programmers should! :)