All Projects → anyuser → vectorshapes-unity

anyuser / vectorshapes-unity

Licence: MIT, Unknown licenses found Licenses found MIT LICENSE Unknown LICENSE.meta
Library for drawing vector shapes in Unity.

Programming Languages

C#
18002 projects
HLSL
714 projects
ShaderLab
938 projects

Projects that are alternatives of or similar to vectorshapes-unity

powerpaint
Kreative PowerPaint - Library and Application for Bitmap and Vector Image Editing
Stars: ✭ 27 (-38.64%)
Mutual labels:  vector, vector-graphics
Clarity
Customizable Monoshape Vector Icon Theme for GTK+
Stars: ✭ 37 (-15.91%)
Mutual labels:  vector, vector-graphics
ludigraphix.github.io
Documentation for Ludigraphix
Stars: ✭ 21 (-52.27%)
Mutual labels:  vector, vector-graphics
Synfig
This is the Official source code repository of the Synfig project
Stars: ✭ 1,056 (+2300%)
Mutual labels:  vector, vector-graphics
vector
A javascript library for creating interactive graphics.
Stars: ✭ 154 (+250%)
Mutual labels:  vector, vector-graphics
Svg.skia
An SVG rendering library.
Stars: ✭ 122 (+177.27%)
Mutual labels:  vector, vector-graphics
Mathsharp
A vector and matrix library written in C# using hardware intrinsics
Stars: ✭ 616 (+1300%)
Mutual labels:  vector, vector-graphics
Vectorlogozone
3,000+ gorgeous SVG logos, perfect for your README or credits page
Stars: ✭ 239 (+443.18%)
Mutual labels:  vector, vector-graphics
vectorexpress-api
Vector Express is a free service and API for converting, analyzing and processing vector files.
Stars: ✭ 66 (+50%)
Mutual labels:  vector, vector-graphics
com.xrtk.oculus
The Oculus platform components for the XRTK
Stars: ✭ 11 (-75%)
Mutual labels:  upm-package
vec-la-fp
↗️ A tiny (functional) 2d linear algebra library
Stars: ✭ 21 (-52.27%)
Mutual labels:  vector
ScalaTIKZ
ScalaTIKZ is an open-source library for PGF/TIKZ vector graphics.
Stars: ✭ 18 (-59.09%)
Mutual labels:  vector-graphics
timvt
PostGIS based Vector Tile server.
Stars: ✭ 113 (+156.82%)
Mutual labels:  vector
SuperformulaSVG
2D superformula line-art generator built in Processing, with SVG export for use in digital fabrication workflows.
Stars: ✭ 40 (-9.09%)
Mutual labels:  vector
CapsNet-tensorflow-jupyter
A simple tensorflow implementation of CapsNet (by Dr. G. Hinton), based on my understanding. This repository is built with an aim to simplify the concept, implement and understand it.
Stars: ✭ 16 (-63.64%)
Mutual labels:  vector
hack
Kubernetes security and vulnerability tools and utilities.
Stars: ✭ 56 (+27.27%)
Mutual labels:  vector
ModernUI
Modern desktop framework from low-level 3D graphics API to high-level view model, for development of 2D/3D rendering software or game engine, with internationalization support and many new technologies.
Stars: ✭ 168 (+281.82%)
Mutual labels:  vector-graphics
unity-history-window
A simple selection history window for Unity.
Stars: ✭ 118 (+168.18%)
Mutual labels:  upm-package
elementary-plotlib
C/C++ Plotting Library
Stars: ✭ 19 (-56.82%)
Mutual labels:  vector-graphics
GDX
Game Development Extensions
Stars: ✭ 46 (+4.55%)
Mutual labels:  upm-package

Vector Shapes for Unity

VectorShapes is a simple and easy to use library for drawing vector shapes in Unity.

Created by Mario von Rickenbach

Features

  • Draw shapes by hand or from code.
  • Supported shape types: Rectangle, Ellipse/Circle, Polygon (closed, open)
  • Polygon Point Types: Corner, Bezier, Bezier Continuous, Smooth
  • Shapes can be saved in scene or as asset reference.

Stroke features

  • Stroke rendering in shader (fast) or CPU (slow)
  • Shader-based stroke rendering works with any number of cameras
  • Stroke render types: Screen space pixel, Screen space relative, Shape space
  • Stroke corner types: Bevel, Extend and cut, Extend and miter
  • Texture modes: Normalized, Absolute
  • Stroke points can have independent widths
  • Antialiasing can be activated in stroke shader, no full-screen AA required

Fill features

  • Supports plain color fills
  • Texture modes: Normalized, Absolute
  • Fill material can use any shader

Compatibility

Works with unity 2019.3+

Installation

Install this package in the package manager: "+" -> "Add package from git URL":

https://github.com/anyuser/vectorshapes-unity.git

Getting started

VectorShapes can be used completely without coding. Shapes can be created by adding a Shape and ShapeRenderer component to a GameObject.

Create shape

Basic shapes can be created by clicking "GameObject/2D Object/XYZ Shape" in the Unity menu bar. Alternatively, a shape can be created by adding a Shape and a Shape Renderer component to a game object.

Shapes

Shape is a component that can be attached to GameObjects. It defines the properties of a shape and can be rendered by a ShapeRenderer. By default, shape data is directly saved in the object. Alternatively, the shape data can be a referenced from a Shape Asset.

Shape renderers

Shapes are either rendered by a ShapeRenderer attached to the GameObject, or by a ShapeRenderer in a parent object. If you want to render multiple shapes with the same materials, it's best to create only one renderer and attach Shapes to the transform hierarchy under that ShapeRenderer. If more than one parent object of a Shape has a ShapeRenderer, the closest activated one in the hierarchy is used to render the object.

Shape assets

Shape Asset is an asset which contains shape data, saved in the project as an asset. It can be referenced by a Shape comonent to reuse content.

Shape Properties

  • Shape types:

    • Rectangle
    • Ellipse/Circle
    • Polygon (closed, open)
  • Polygon Point Types:

    • Corner: Corner point
    • Bezier: Bezier point with independent tangents
    • Bezier Continuous: Bezier point with aligned tangents
    • Smooth: Bezier point with automatic tangents
  • Stroke render types:

    • Screen space pixel: screen space, 1 stroke width unit is one pixel
    • Screen space relative: screen space, 1 stroke width unit is screen height
    • Shape space: relative to shape z direction
  • Stroke corner types:

    • Bevel: simple line segments connected to close the corner
    • Extend and cut: extend until miter limit is reached, cut if above
    • Extend and miter: extend until miter limit is reached, miter if above
  • Stroke Texture modes:

    • Normalized: Texture is stretched to the full line length
    • Absolute: Texture is laid onto stroke in absolute object space size
  • Stroke Texture offset & scale: Offset & scale textures based on texture mode

  • Fill color: Color

  • Fill Texture modes:

    • Normalized: Texture is scaled to fill the bounds of the shape and starts in the center of it
    • Absolute: Texture is applied in object space, starting at the pivot point
  • Fill Stroke Texture offset & scale: Offset & scale textures based on texture mode

Optimizing performance

Performance considerations:

  • Shapes are generated meshes. Each time a shape changes, the mesh will be regenerated. Only change shapes in Update when really necessary.
  • For best performance, use the line shader included. If the line material is not using the line shader, stroke rendering will fall back to CPU mode.
  • As long as the shape doesn’t change, there isn’t any performance cost in addition to rendering the mesh. The lines are transformed in the vertex shader.
  • Changing a filled shape can generate allocation garbage, because the triangulation library (LibTessDotNet) is currently not optimized for that.
  • Fill meshes are only rebuilt when the
  • Scene view is always rendered in cpu mode, to make the lines selectable.
  • LibTessDotNet allocates memory when triangulating meshes.

CPU mode

  • If the stroke material doesn't use the included stroke shader, stroke rendering will fall back to CPU mode.
  • In CPU mode, each mesh additionally has to be regenerated each time the camera changes its transformation matrix. Therefore, CPU mode is by magnitudes slower than GPU in almost all cases.
  • There is one case where a CPU shape is faster than the shader version: For shapes that don't change, with StrokeRenderType set to ShapeSpace.
  • CPU mode only supports one camera, the one set in the shape renderer.

Known issues / limitations

Render order

  • render order not defined (TODO: Graphics.DrawMesh? materialpropertyblock)

Corners

  • miter mode glitch

Antialiasing

  • Stroke antialiasing is done in shader
  • No antialiasing (except builtin) for fills. workaround 1px line
  • Antialiasing in shapespace mode is not so nice
  • Antialiasing doesn't work well in miter mode in extreme cases
  • Antialiasing Y UV for cutted lines

Variable stroke width & color

  • Variable stroke width has to be used with caution: Corners don't react well to all geometries.
  • Stroke points can have colors, currently
  • linear interpolation mobile
  • Stroke gradient show the mesh triangulation in some corner modes. Use "Bevel" corner mode for best gradients.

Stroke textures

  • stroke texture distorted
  • textures mapped on bezier curves are distorted
  • texture mapped on looping lines are glitchy

Import & export

  • Currently there's no import or export from other formats like SVG.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].