{"repo":"johanhelsing/bevy_smud","free":true,"listed":false,"github":"https://github.com/johanhelsing/bevy_smud","clone":"git clone https://github.com/johanhelsing/bevy_smud.git","description":"Sdf 2d shape renderer for Bevy","language":"Rust","stars":180,"topics":["bevy","sdf","signed-distance-field","shapes","2d","shaders","game-development","bevy-plugin"],"license":null,"category":"game-templates","readme_excerpt":"bevy smud [Signed Distance Field/Function][SDF] (SDF) 2D shape rendering for Bevy. Bevy smud is a way to conveniently construct and render sdf shapes with Bevy. Given a shape function/expression, and a fill type, it generates shaders at run-time. If you keep the number of different sdf and fill combinations relatively low it's pretty performant. My machine easily handles 100k shapes at 60 fps, with 40 different shape/fill combinations in randomized order (see gallery example). Usage An SDF is a way to map points in space to distances to a surface. If a point maps to a positive value, it's outside the shape, if it's negative, it's inside the shape. These \"mappings\" can be described by functions, which takes a point as input and returns a distance to a surface. For instance, if you wanted to make a circle, it could be described as length(position - center) - radius . That way, all the points that are radius away from center would be 0 and would define the edge of the shape. Many such functions describing geometric primitives are included in this library, they are imported automatically when using the single-expression or body shorthand for adding sdfs. For instance, the circle above could also be described as: Similarly there are a bunch of other shapes ( sd ellipse , sd box , sd rounded box , sd egg etc. etc.) Most of the built-in shapes are direct ports of the ones on this page, which includes screenshots of the various shapes. So that page might act as a good reference. The ","default_branch":null,"files":null,"tree":[],"storefront":"/r/johanhelsing","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/johanhelsing/bevy_smud/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}