Skip to content

Commit

Permalink
Add overlay support to the model
Browse files Browse the repository at this point in the history
Each chunk can now define an overlay. An overlay is drawn over the base
model, and can have its own `color`, `gradient`, and `mask` properties.
An overlay can be used to apply a pattern over the entire model at
once.

Using an overlay does have a performance impact because each polygon in
a chunk with an overlay gets duplicated. But it makes it dramatically
easier to apply a pattern over the entire model at once.

A demo of this functionality has been added, called "overlay". It is
not the nicest looking example, but it does demonstrate the
functionality well.
  • Loading branch information
Gudahtt committed Oct 26, 2021
1 parent 5d918e6 commit c1befec
Show file tree
Hide file tree
Showing 5 changed files with 453 additions and 6 deletions.
1 change: 1 addition & 0 deletions demo/src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
<li><a href="./recolor/index.html">recolor</a></li>
<li><a href="./distort/index.html">distort</a></li>
<li><a href="./fade/index.html">fade</a></li>
<li><a href="./overlay/index.html">overlay</a></li>
<li><a href="./beta/index.html">beta</a></li>
<li><a href="./flask/index.html">flask</a></li>
</ol>
Expand Down
14 changes: 14 additions & 0 deletions demo/src/overlay/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" type="text/css" href="../style.css">
<title>---</title>
<meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport" />
<meta charset=utf-8>
</head>
<body>
<div></div>
<script src="bundle.js"></script>
<p>Press C to copy the SVG text of the image.</p>
</body>
</html>
Loading

0 comments on commit c1befec

Please sign in to comment.