All Projects → bradley → Blotter

bradley / Blotter

Licence: other
A JavaScript API for drawing unconventional text effects on the web.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Blotter

Eternal
👾~ music, eternal ~ 👾
Stars: ✭ 323 (-88.6%)
Mutual labels:  webgl, glsl, creative-coding
Bonmot
Beautiful, easy attributed strings in Swift
Stars: ✭ 3,182 (+12.32%)
Mutual labels:  text, design, typography
Webgl Fundamentals
WebGL lessons that start with the basics
Stars: ✭ 3,315 (+17.01%)
Mutual labels:  webgl, glsl, glsl-shaders
Shader Doodle
A friendly web-component for writing and rendering shaders.
Stars: ✭ 356 (-87.43%)
Mutual labels:  webgl, glsl, creative-coding
Awesome Glsl
🎇 Compilation of the best resources to learn programming OpenGL Shaders
Stars: ✭ 530 (-81.29%)
Mutual labels:  webgl, glsl, creative-coding
3d Game Shaders For Beginners
🎮 A step-by-step guide to implementing SSAO, depth of field, lighting, normal mapping, and more for your 3D game.
Stars: ✭ 11,698 (+312.92%)
Mutual labels:  webgl, glsl, glsl-shaders
Awesome Creative Coding
Creative Coding: Generative Art, Data visualization, Interaction Design, Resources.
Stars: ✭ 8,696 (+206.95%)
Mutual labels:  webgl, creative-coding, design
React Regl
React Fiber Reconciler Renderer for Regl WebGL
Stars: ✭ 171 (-93.96%)
Mutual labels:  webgl, glsl, glsl-shaders
gamedex
👾 The code for my game dev + computer graphics experiments on YouTube.
Stars: ✭ 165 (-94.18%)
Mutual labels:  glsl, glsl-shaders
manyworlds
A scifi-inspired study of signed distanced functions and noise fields in WebGL
Stars: ✭ 24 (-99.15%)
Mutual labels:  creative-coding, glsl
ShaderView
ShaderView is an Android View that makes it easy to use GLSL shaders for your app. It's the modern way to use shaders for Android instead of RenderScript.
Stars: ✭ 53 (-98.13%)
Mutual labels:  glsl, glsl-shaders
glsl-doodle
Drawing patterns with glsl shaders on modern browsers.
Stars: ✭ 53 (-98.13%)
Mutual labels:  glsl, glsl-shaders
3D interactive graphics rendering engine
Develop a 3D interactive graphics rendering engine
Stars: ✭ 31 (-98.91%)
Mutual labels:  glsl, glsl-shaders
kotlin-glsl
Write your GLSL shaders in Kotlin.
Stars: ✭ 30 (-98.94%)
Mutual labels:  glsl, glsl-shaders
ShaderBoy
Simple text editor that lets you write Shadertoy shaders more comfortably, anytime, anywhere.
Stars: ✭ 133 (-95.31%)
Mutual labels:  glsl, glsl-shaders
baseline
New method for creating leading on the web
Stars: ✭ 31 (-98.91%)
Mutual labels:  text, typography
30-days-of-shade
30 days of shaders in GLSL using GLSLCanvas
Stars: ✭ 134 (-95.27%)
Mutual labels:  glsl, glsl-shaders
qml-glsl-coder
live editor of GLSL fragment shaders based on Qt / QML
Stars: ✭ 19 (-99.33%)
Mutual labels:  glsl, glsl-shaders
deffx
A collection of useful shader effects made ready to be used with the Defold game engine
Stars: ✭ 33 (-98.84%)
Mutual labels:  glsl, glsl-shaders
YALCT
Yet Another Live Coding Tool - Powered by Veldrid and elbow grease
Stars: ✭ 25 (-99.12%)
Mutual labels:  glsl, glsl-shaders

Blotter logo

A JavaScript API for drawing unconventional text effects on the web.

HomeHelp

Overview

When applying effects to text on the web, designers have traditionally been constrained to those provided by CSS. In the majority of cases this is entirely suitable – text is text right? Yet still, there exist numerous examples of designers combining CSS properties or gifs and images to create effects that evoke something more playful. Precisely here, Blotter exists to provide an alternative.

GLSL Backed Text Effects with Ease

Blotter provides a simple interface for building and manipulating text effects that utilize GLSL shaders without requiring that the designer write GLSL. Blotter has a growing library of configurable effects while also providing ways for student or experienced GLSL programmers to quickly bootstrap new ones.

Atlasing Effects in a Single WebGL Back Buffer

Blotter renders all texts in a single WebGL context and limits the number of draw calls it makes by using atlases. When multiple texts share the same effect they are mapped into a single texture and rendered together. The resulting image data is then output to individual 2d contexts for each element.

Animation Loop

Rather than executing on a time based interval, Blotter's internal animation loop uses requestAnimationFrame to match the browser's display refresh rate and pause when the user navigates to other browser tabs; improving performance and preserving the battery life on the user's device.

What Blotter Isn't

Any texts you pass to Blotter can be individually configured using familiar style properties. You can use custom font faces through the @font-face spec. However, Blotter ultimately renders the texts passed to it into canvas elements. This means rendered text won't be selectable. Blotter is great for elements like titles, headings, and texts used for graphic purposes. It's not recommended that Blotter be used for lengthy bodies of text, and should in most cases be applied to words individually.

Usage

Download the minified version.

To apply text effects, you'll also want to include at least one material, so download one of Blotter's ready-made effects, such as the ChannelSplitMaterial.

Include both in your HTML.

<script src="path/to/blotter.min.js"></script>
<script src="path/to/channelSplitMaterial.js"></script>

The following illustrates how to render Blotter's ChannelSplitMaterial in the body of your page with default settings.

<!doctype html>
<html>
  <head>
    <script src="path/to/blotter.min.js"></script>
    <script src="path/to/channelSplitMaterial.js"></script>
  </head>
  <body>
    <script>
      var text = new Blotter.Text("Hello", {
        family : "serif",
        size : 120,
        fill : "#171717"
      });

      var material = new Blotter.ChannelSplitMaterial();

      var blotter = new Blotter(material, { texts : text });

      var scope = blotter.forText(text);

      scope.appendTo(document.body);
    </script>
  </body>
</html>

Making Changes / Custom Builds

Firstly, install Blotter's build dependencies (OSX):

$ cd ~/path/to/blotter
$ npm install

The blotter.js and blotter.min.js files are built from source files in the /src directory. Do not edit these built files directly. Instead, edit the source files within the /src directory and then run the following to build the generated files:

$ npm run build

You will the updated build files at /build/blotter.js and /build/blotter.min.js.

Without Three.js / Without Underscore.js

Blotter.js requires Three.js and Underscore.js. If you're already including these files in your project, you should remove them from the defFiles array in the Gruntfile and re-run the build script.

Note: In order to decrease the total build size, Blotter uses a custom build of Three.js that only includes modules Blotter.js relies on. For more information view the build-custom-three script in package.json.

Custom Materials

The documentation for creating custom materials can be found in the Wiki.

Credits

Blotter is not possible without these contributions to JavaScript.


Some projects and people who have helped inspire along the way.

  • Two.js
    Jono Brandel's Two.js has provided much inspiration for Blotter's documentation and API design.
  • Reza Ali
    Reza's Fragment was a fundamental part of the development process for writing Blotter's Fragment shaders, and Reza kindly allowed Blotter to include an array of shader helper functions from Fragment.
  • Mitch Paone
    I was introduced to Mitch's work in computational typography while working on Blotter, and the work Mitch has done with DIA has been hugely motivational.
  • Stan Haanappel
    Stan Haanappel is a designer whose work with type has been inspirational to Blotter.
  • The Book of Shaders
    The Book of Shaders by Patricio Gonzalez Vivo and Jen Lowe is where anyone looking to learn more about writing shaders should begin.
  • Shadertoy
    Shadertoy has been a critical part of my personal learning experience while working on Blotter.


✌️ - Bradley Griffith

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].