Oh you're kidding me, an inverted Vulkan viewport also inverts the triangle winding??

It makes sense, but how did it take me this long to notice πŸ˜…

#gpu #graphics #vulkan #programming #gamedev

"Every renderer that works contains an even number of sign mistakes"
@AminiAllight i could carefully read the docs or maybe source code to figure out what conventions are used for transform matrices… or i could transpose and swap multiplication order until things look like i expect

@AminiAllight

Hello darkness, my old friend,
I've lost my triangle again.
Were the vertices all meeting?
Do the stencil ops need tweaking?
Did the whole thing,
Get removed by a backface cull?
Or was it null?
Oh no it's just behind us.

(by Paul Malin: https://bsky.app/profile/p-malin.bsky.social)

Paul Malin (@p-malin.bsky.social)

Tech Director at Assemble Tech Ltd. with a fondness for shiny graphics and good engineering. Formerly Activision Central Tech & Bizarre Creations. he/him shadertoy.com/user/P_Malin https://blog.mousefingers.com/ https://www.pouet.net/user.php?who=105060

Bluesky Social
@AminiAllight technically zero is even, though in practice most renderers choose a higher number to simplify their design

@AminiAllight @drj

When I was starting to do real math, my advisor told me to always do work in even numbers of half pages, as one has, on average, a sign error per half page …

@AminiAllight Reminds me of the time I had the matrixes transposed (row/column order mixed up) and was multiplying things in the reverse order which compensated for that.

Eventually I figured it out.

@AminiAllight my renderer currently flips y at every render pass πŸ™ƒ
@AminiAllight this works very well for physics simulations too, even outside of gaming