godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
91.47k stars 21.26k forks source link

AA on polygons with internal faces is rendered improperly #48704

Open insomniacUNDERSCORElemon opened 3 years ago

insomniacUNDERSCORElemon commented 3 years ago

Version: Still as of 3.3

Description: Improperly here means strings on the outside of concave shapes, and on the inside of convex shapes that have some sort of color difference (for instance, vertex colors which the AA strings inherit from their origin vertex).

Note that because AA is rendering in the wrong order/places, some external edges of polygons may be missing their AA.

Likely caused(/missed) in https://github.com/godotengine/godot/pull/33857 by @pouleyKetchoupp

How to reproduce: It's easiest to see with a concave shape, particularly 4 external vertices in the shape of a V and turn AA on (and HDR off, or Framebuffer to 2D). Assign any texture (required to use the UV editor to add internal verts/faces) and add 3 internal vertices in the shape of a triangle and then add at least 1 face.

A similar situation can be had with a convex shape, instead 3 external vertices and 3 internal vertices, but you also need to add differing vertex colors to see the strings.

Minimal reproduction project: broken_aa_advanced_polygon.zip

Visual of example project:

ArcoLinux_2021-05-13_18-12-57

insomniacUNDERSCORElemon commented 3 years ago

Still in 3.3.2.