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:
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: