Page 2 of 2

Re: osgFX::Cartoon

Posted: 01 Jun 2019, 18:51
by AnyOldName3
There's not that much that could be done about particle outlines except either running the post-process before rendering particles (which would probably require a lot of reorganisation, so it's probably something that you'd only ever implement if you knew about it when you started writing the renderer) or disabling depth writes for the particles, which would cause issues when a particle covered somewhere a line would appear, as the line would be drawn over the top of it.

You don't really want to draw outlines if you've got anything at all that's alpha blended, so the 'proper' solution would be to recreate the particle effects so each pixel is either completely opaque or completely transparent, and then acept that they'll have ines drawn. I think this is what Borderlands does, for example.

Re: osgFX::Cartoon

Posted: 02 Jun 2019, 00:23
by Clement
MGE (or maybe Morrowind, I don't know the details) does not draw depth for semi transparent textures. I expect they are drawn in a separate pass anyway, since you cannot rely on depth test for those and you have to render them from back to front. Textures with completely opaque/transparent pixels (e.g. leaves) do draw depth properly though.

Lines are drawn on top of effects like fires or storm particles. SSAO has the same issue, but it is less obvious as it draws subtle blurry shadows instead of solid lines.

Re: osgFX::Cartoon

Posted: 02 Jun 2019, 02:32
by AnyOldName3
Usually with alpha blending, you draw your opaque stuff, then (in order of decreasing distance from the camera) you draw your translucent stuff with depth testing on (so you don't accidentally draw things in front of opaque objects which they're actually behind) but depth writes off (as you don't need the depth buffer as you've already manually sorted everything by depth. This would be consistent with what you've just described, and unless Scrawl decided to do something weird, it's probably what OpenMW is doing.

With alpha testing, a pixel is either there or it isn't, but when it is there, it's opaque and you can draw it just like any other opaque pixel, so no special handling is required and depth writes and testing stay on and objects get drawn in whatever order is easiest.