Coder Social home page Coder Social logo

larsmichelsen / cube-shaders Goto Github PK

View Code? Open in Web Editor NEW

This project forked from polyfloyd/cube-shaders

0.0 1.0 0.0 23.77 MB

Animations for my 3D LED-Cube written in GLSL

Home Page: https://polyfloyd.net/post/opengl-shaders-ledcube/

Makefile 4.62% GLSL 95.38%

cube-shaders's Introduction

LED-Cube Shaders

This repository contains GLSL animations for my LED-Panel-Cube to be rendered using Shady.

Usage

All animations for the cube should define a mainCube function as entry point along with some boilerplate:

void mainCube(out vec4 fragColor, in vec3 fragCoord) {
  // Animation code goes here...
}

#ifndef _EMULATOR
void mainImage(out vec4 fragColor, in vec2 fragCoord) {
  mainCube(fragColor, cube_map_to_3d(fragCoord));
}
#endif

The mainImage function renders for the actual cube. It is wrapped in an ifndef so the emulator is allowed to redefine the mainImage function.

Emulator

I've written a shader that acts as an emulator for the cube. It works by defining a mainImage function that raymarches a cube and for each pixel on the surface, calls mainCube.

Quick test:

shady -g 1366x768 -i emulator.glsl -i anim/globe.glsl -ofmt rgb24 -framerate 20 \
  | ffplay -loglevel quiet -f rawvideo -pixel_format rgb24 -video_size 1366x768 -framerate 20 -i -

Rendered

Blorps Fuji VHS Nyan Tesseract Voronoi 3D RGB Cave Game Globe

cube-shaders's People

Contributors

larsmichelsen avatar polyfloyd avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.