Git Product home page Git Product logo

gomapper's Introduction

Go experiments around a shader based pixel mapper

PoC implementation in p5.ps : https://github.com/Drunk-Developper/absolute-crazy-led-mapper

This is half baked :

  • setup go, glsl, ...
  • load shader from file
  • render shader
  • pass float uniform to shader (time)
  • pass texture to shader as uniform
  • extract texture data from shader
  • chain shaders (send output texture from a shader as input texture for the next)
  • refactor code for readability
  • render each shader in its own texture
  • use proper mapping shaders
  • extract pixels from mapping texture
  • generate artnet or sACN udp packages
  • fix broken mapping
  • add mask generator from a json
  • add multi-universe support
  • [x] fps throttling for sacn
  • fps throttling for all (screen and sacn output)
  • dynamic quantity of universes (should be limited by underlying hardware)
  • fix mapping.frag
  • [-] fix multi-universe
  • basic debug UI [draw mapping lines on top of screen]
  • make it run on a jetson nano
  • [-] make basic control UI
  • add isf support
  • add automatic OSC -> ISF controls
  • optional antialiasing (average 4 next pixels)

Debug

  • mapping position has to be multiplied by 10 to work (why ?!)

Controls

  • [Space] - toggle view between Rendering and Mapping Shader
  • [Esc] - Quit

Current limitations (todo for later):

  • Only one shader as input
  • input shader will render in a 800x600 texture
  • ReadPixels is reading from the currently on screen shader, it should always read the mapping shader

Multi-Universe :

First prototype was using a p x 1 mapping texture, n beeing the quantity of pixel to map.

Updated approach is to use a 170 x u mapping texture, u beeing the quantity of universe to send.

If a fixture is overflowing a universe, it will continue on the next one.

Each universe is encoded as one line in the mapping texture and all unused pixels will be "blank" (actually white -> vec4(255 255 255 255) as black -> vec4(0 0 0 0) translate is a valid position vec2(0, 0)) We'll filter out blank pixel in the mapping shader (no computation) and won't send non mapped universe out on the network.

Note : As we only need 3 channels per pixel (RGB) we can send 170 pixels per universe, but it requires dealing with the "2 left over bits" at the end of the frame.

Our mapping texture is 680 bytes per universe (rgba) while our extraction is only 510 bytes per univese (rgb).

Thanks to :

Maight thank you later :

gomapper's People

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.