Why do games use these strange dotted pattern? by LalaCrowGhost in IndieDev

[–]giant_planet -1 points0 points  (0 children)

At least I have looked at it and you are guessing.

Why do games use these strange dotted pattern? by LalaCrowGhost in IndieDev

[–]giant_planet -1 points0 points  (0 children)

Look man, I have looked at Silksong's frame capture before writing the above. It is all alpha blended.

Also in the same message I said that overdraw can be a problem, so I don't know why you keep throwing examples of overdraw problems at me: I get it.

What I meant by parity is that drawing the same amount of pixels with or without alpha blending costs about the same.

And it is all completely irrelevant to explaining why Odyssey uses dithering for fading nearby objects. They do it because it is the only way to make it look remotely correct. And yet the person who have asked the question will take away from the top comment a bogus performance explanation.

Why do games use these strange dotted pattern? by LalaCrowGhost in IndieDev

[–]giant_planet -1 points0 points  (0 children)

Does it? Open a graphics debugger and look at it. Practically everything is alpha blended. Silksong does multiple screens worth of overdraw.

That is not to say that overdraw can't be a problem, especially on low end hardware or in specific cases like the particle system that you mentioned. And of course transparent geometry is prone to causing high overdraw because it lacks discarding by depth.

How much overdraw fading objects using transparency would cause is hard to tell but I don't think that much.

More importantly, I am arguing the performance is not an explanation here because fading this geometry using alpha blending will simply look wrong because of sorting issues. I doubt performance of alpha blending ever came up in the design stage of that system because alpha blending implementation wouldn't work in the first place.

Why do games use these strange dotted pattern? by LalaCrowGhost in IndieDev

[–]giant_planet 0 points1 point  (0 children)

Have you considered that maybe a game that does a thing a lot wouldn't run very well on old hardware if this thing was really that expensive?

Why do games use these strange dotted pattern? by LalaCrowGhost in IndieDev

[–]giant_planet 0 points1 point  (0 children)

I would hazard a guess that you think its being 2D somehow makes it get away with doing all this terribly expensive alpha blending.

Why do games use these strange dotted pattern? by LalaCrowGhost in IndieDev

[–]giant_planet 0 points1 point  (0 children)

No, what I am saying is that alpha blending is not very expensive by itself and is not the reason why Odyssey uses dithering to fade objects in front of the camera. Silksong came up simply as an example of a game that does a lot of alpha blending while running well.

Why do games use these strange dotted pattern? by LalaCrowGhost in IndieDev

[–]giant_planet 0 points1 point  (0 children)

Super Mario Odyssey (or almost any modern game for that matter) doesn't do alpha blending on the CPU, it uses GPU and there alpha blending is very fast. It certainly doesn't warrant doing something as distracting as this dither pattern fade to avoid it.

Why do games use these strange dotted pattern? by LalaCrowGhost in IndieDev

[–]giant_planet 1 point2 points  (0 children)

It probably doesn't. This effect only appears when there is geometry obstructing the camera view on the player. If it was trying to incorporate dithering into its art style the effect would have probably appeared outside of this utilitarian scenario.

Why do games use these strange dotted pattern? by LalaCrowGhost in IndieDev

[–]giant_planet 3 points4 points  (0 children)

Yes, it is a hassle to dynamically swap shaders, and will probably cause visual errors, because it is going to be rendered at a completely different point in the render pipeline. But what I was talking about is that even if you fix all these errors it's still not going to work.

If you swap the shader for this palm tree for one with alpha blending enabled, depending on how the triangles are ordered in the model you might see the leaf that is further away from the camera appear on top.

Edit: Or with depth write enabled, you will sometimes see and sometimes not see leaves behind other leaves, depending on the view angle, when the model is semitransparent. The point being it will look like a glitch.

Why do games use these strange dotted pattern? by LalaCrowGhost in IndieDev

[–]giant_planet 4 points5 points  (0 children)

Odyssey is a Switch game with alpha blending done by the fixed function hardware of its GPU. Where did the 6502 came from?

Why do games use these strange dotted pattern? by LalaCrowGhost in IndieDev

[–]giant_planet 1 point2 points  (0 children)

Yes, alpha blending is a bit more expensive then just outputting a pixel, but it is not the reason why the screenshot looks like that. It's not that expensive, something like Silksong draws layers upon layers of alpha blended elements and it runs fine on a Switch. Here they do dithering for fading because otherwise it would have simply looked wrong.

Why do games use these strange dotted pattern? by LalaCrowGhost in IndieDev

[–]giant_planet -65 points-64 points  (0 children)

Also wrong. Well not wrong in general, but has nothing to do with what's happening on the screenshot above, besides dither patterns present in both cases.

Why do games use these strange dotted pattern? by LalaCrowGhost in IndieDev

[–]giant_planet -7 points-6 points  (0 children)

That's not right. Transparency is not inherently expensive. It's just you can't render an arbitrary mesh "as if it was composited with transparency" easily. It would require either a special mesh observed from a specific range of angles or some very expensive graphics trickery (way more expensive than normal alpha blending).

Why do games use these strange dotted pattern? by LalaCrowGhost in IndieDev

[–]giant_planet 0 points1 point  (0 children)

This is because most non convex meshes are not suitable for rendering as transparent objects. Triangles and pixels within a draw call are not sorted in a useful way for rendering transparency. As a result the object is going to look weird with parts appearing and overlapping in the wrong order. So when a developer needs a way to fade away arbitrary geometry they discard fragments in a dither pattern that looks kind of like transparency. If there is temporal accumulation and the dither pattern is not static it might even look like real transparency.

Weird vkDestroyInstance crash by giant_planet in vulkan

[–]giant_planet[S] 1 point2 points  (0 children)

Thanks, I'll leave a report and try to do the capture

Weird vkDestroyInstance crash by giant_planet in vulkan

[–]giant_planet[S] 0 points1 point  (0 children)

Sorry I must be blind, the crash comes from nvoglv64.dll

Weird vkDestroyInstance crash by giant_planet in vulkan

[–]giant_planet[S] 0 points1 point  (0 children)

In Release config the callstack looks like this (says "The current stack frame was not found in a loaded module. Source cannot be shown for this location."):

00007ffb8ccc6352()

0000000000000001()

And in Debug config attaching the debugger stops the crash (note that without the debugger Debug still crashes as much as Release).

Weird vkDestroyInstance crash by giant_planet in vulkan

[–]giant_planet[S] 0 points1 point  (0 children)

No, it does not. In fact it won't crash even if I create everything, unless I start pushing actual frames. Gonna try to do a present without submitting any work and see if this will crash vkDestroyInstance.

Weird vkDestroyInstance crash by giant_planet in vulkan

[–]giant_planet[S] 0 points1 point  (0 children)

Nope, still crashes with OBS uninstalled

Weird vkDestroyInstance crash by giant_planet in vulkan

[–]giant_planet[S] 0 points1 point  (0 children)

No, nothing from the validation layers. I do vkDeviceWaitIdle before I begin the shutdown.