JerboaBurrow / Hop

Lightweight, cross-platform, 2D game engine | ECS; Lua Console; Physics; Tile based

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Polygon triangulation renderer

Jerboa-app opened this issue · comments

commented
  • port triangulation code
  • refactor sRender to use sSpriteRender
  • polygon component
  • implement sDynamicSpriteRender to use polygon components
  • pass to sRender to render rigged objects

Rigging polygon can be any polygon + triangulation
Routines to construct one from collision mesh/ v.v.

sRender will take in sprites as current, and rigged renderables as well

sSpriteRender will take in sprite renderables (as all were before)
sDynamicSpriteRender will take in those that also have riggin polygons
sRender will be an interface to use both seamlessly

commented

Sprite

Dynamic components

  • Shader/s
  • Texture/s

Fixed size object (can have render frames though)

  • Quad (pos and tex coords)
  • translation (vec4)
  • colour (vec4)
  • atlas coords (vec4)
  • util (vec4

ProceduralSprite

Dynamic sized components

  • Triangulation pos coords - gets changed as object shifts, N = n * 3 * 2
  • Triangulation tex coords - static for uv mapping, N
  • Colour, N

Fixed size components

  • Atlas coords (vec4)
  • Util (vec4)
commented

#105 sRender now interfaces with sSpriteRender for functionality