Files
godot-demo-projects/2d/polygons_lines
Hugo Locurcio 6424e02ebf Add fallbacks and mention non-working features when using Compatibility or the Web platform (#1132)
- Make 3D lights with shadows darker when using Compatibility to better
  match the appearance of Forward+/Mobile, due to the use of sRGB blending
  for those lights.
- Silence some warnings when running projects with the Compatibility
  rendering method, such as the one about 2D MSAA not being supported.
- Rebake lightmaps in Global Illumination to improve quality and reduce
  light leaking with improvements from 4.3.
  - Increase probe density for dynamic objects, and mark the moving box
    as a dynamic object for GI purposes.

This is done to improve the experience with the web-based demos,
which always run with the Compatibility rendering method.
2025-10-02 10:31:42 -07:00
..
2024-06-25 18:09:34 +02:00
2024-06-25 18:09:34 +02:00
2024-06-25 18:09:34 +02:00
2025-03-21 02:00:41 +01:00
2024-06-25 18:09:34 +02:00

2D Polygons and Lines

A demo of solid and textured 2D polygons and lines using Polygon2D and Line2D.

In this project, solid Line2Ds are antialiased by using a specially crafted texture. By using a texture that is solid white on all its pixels except the top and bottom edges (which are fully transparent white), the border appears smooth thanks to bilinear filtering. A more extensive variation of this concept (which works better with variable-width lines) can be found in the unofficial Antialiased Line2D add-on.

2D multisample antialiasing (MSAA) is also supported when using the Forward+ and Mobile rendering methods. This is a slower approach, but it works on all 2D drawing performed within the viewport, including Polygon2D nodes or custom drawing. This approach can be used at the same time as the aforementioned Line2D antialiasing technique.

Language: GDScript

Renderer: Mobile

Screenshots

Screenshot