• Stars
    star
    148
  • Rank 249,983 (Top 5 %)
  • Language
    Rust
  • License
    Other
  • Created over 5 years ago
  • Updated 11 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A dynamic texture atlas allocator with fast deallocation and rectangle coalescing.

Guillotière

crates.io Travis Build Status documentation

A dynamic texture atlas allocator with fast deallocation and rectangle coalescing.

Motivation

The ability to dynamically batch textures together is important for some graphics rendering scenarios (for example WebRender). A challenging aspect of dynamic atlas allocation is the need to coalesce free rectangles after deallocation to defragment the available space. Some atlas allocators perform this task by examining all possible pairs of free rectangles and test if they can be merged, which is prohibitively expensive for real-time applications.

Guillotière solves this problem by internally maintaining a data structure that allows constant time access to neighbor rectangles and greatly speeds up the coalesing operation.

The details of how this works are explained in the AtlasAllocator documentation.

Example

use guillotiere::*;

let mut atlas = AtlasAllocator::new(size2(1000, 1000));

let a = atlas.allocate(size2(100, 1000)).unwrap();
let b = atlas.allocate(size2(900, 200)).unwrap();

atlas.deallocate(a.id);

let c = atlas.allocate(size2(300, 200)).unwrap();

assert_eq!(c.rectangle, atlas[c.id]);

atlas.deallocate(c.id);
atlas.deallocate(b.id);

License

Licensed under either of

at your option.

More Repositories

1

lyon

2D graphics rendering on the GPU in rust using path tessellation.
Rust
2,289
star
2

etagere

Rust
109
star
3

kiwi

Generic pipeline system working with filters and resources that are connected through ports
C++
69
star
4

GLSL-Raymarching

Rendering course project at DTU
C++
33
star
5

shared_vector

Efficient reference counted vector data structure is Rust
Rust
14
star
6

parasol

A multi-threaded job scheduler in Rust.
Rust
13
star
7

rust_debug

Misc debugging utilities.
Rust
10
star
8

notes

Various notes for my own use
10
star
9

misc

Miscellaneous stuff.
Rust
8
star
10

webgl-flares

A 24h long webgl demoscene project
JavaScript
8
star
11

half_edge

A half-edge (doubly connected edge list) data structure in rust
Rust
7
star
12

toy-render-graph

Toy render graph to experiment with various allocation strategies for 2D renderers
Rust
7
star
13

talks

CSS
6
star
14

vodk.rs

Rust experiments, mostly around game programming related stuff.
Rust
5
star
15

android_system_properties

A minimal rust wrapper over android system properties
Rust
4
star
16

texture-atlas

Experimenting with various texture atlas algorithms.
Rust
4
star
17

backup

A simple backup tool in rust using rsync.
Rust
3
star
18

onGameStart2013

Slides of my talk atonGameStart 2013
CSS
2
star
19

prettylogs

Small CLI tools to make debugging logs less painfull.
Rust
2
star
20

sid

Tiny rust crate providing strongly typed id types and an id-based vector.
Rust
2
star
21

pph

Projet personnel en humanités
2
star
22

DTU-ComputerGraphics

Computer Graphics course at DTU
C++
2
star
23

mini-task-scheduler

Tiny multi-threaded task scheduler meant to help with rendering we content on multiple threads. May end up in Firefox, or maybe not.
C++
2
star
24

nical.github.io

HTML
2
star
25

rectangle_occlusion

A simple occlusion culling algorithm for opaque and transparent rectangles
Rust
2
star
26

.dotfiles

My config files
Perl
1
star
27

segmented_vec

Experimenting with a semented Vec<T> data structure
Rust
1
star
28

DTU-ConcurrentProgramming

Concurrent programming assignement
Java
1
star
29

vodk

A very small game engine designed to be productive during game jams
C++
1
star
30

resume

My resume
1
star
31

ngf-slides

Slides for my talk at Next Game Frontier
CSS
1
star
32

DTU-school-projetcs

class work at DTU, for Computer Graphics, Rendering, and Concurrent Programming courses
C
1
star
33

tde-data-playground

Data repository for tde.js experiments
GLSL
1
star
34

oldStuff

My old projects
C++
1
star
35

moz-wgpu-update

Scripts to automate the process of updating wgpu in mozilla-central
Rust
1
star
36

dev-tools

A collection of small tools I write to make everyday development and debugging easier/nicer.
D
1
star
37

graphic-works

Some of my drawing/painting/etc. works
1
star