Spellcaster Studios

Make it happen…

Particle bugs…

Not much time for game development today… Since my professional life is a bit undecided at the moment, I’m taking some time to work on a portfolio and my CV, and see what’s out there…

Anyway, I did some work on a weird bug that I noticed on the Mac build (although it’s present on all builds):

screen665

The most attentive amongst you will notice that the particles are running behind the player, instead of the right position (in front of him)…

My first thought was a problem on the new inverse-Z pass, but the particles don’t use it, and the player won’t fail the Z test there (the particles don’t write to the Z-buffer)…

Then I thought it may be a problem with sorting (since the particles don’t get drawn on the Z-buffer, the player was being drawn afterwards and messing up the render)… Disabling the alpha pass from the player, solved the issue, but that’s no solution… So it looks like sorting, even if it didn’t make sense looking at the code, so time to fire up the debugger and confirm if my theory about the ordering…

And… I was wrong… The object is sent to the scene graph earlier, as I saw, but it gets queued on the blitter, which means that it actually gets drawn at the end!

Simple solution, force a flush that forces the pipeline to flush after a change of “type” of rendering (mesh to blit, or vice-versa), but only for the alpha-pass. It was on my list to alpha-sort things anyway, so that flags can be used for that as well…

screen666

And there, problem solved! Smile

Now listening to “The Battle” by “Allen/Lande”

Link of the Day: I love the visuals on this demo:

Comment