Giter Site home page Giter Site logo

pampanelson / ofxshadertoy Goto Github PK

View Code? Open in Web Editor NEW

This project forked from tiagosr/ofxshadertoy

0.0 2.0 0.0 3.28 MB

Addon for openFrameworks that sets up and loads Shadertoy (http://www.shadertoy.com) shaders

Makefile 32.29% GLSL 35.41% C++ 32.29%

ofxshadertoy's Introduction

ofxShadertoy

ofxaddons

openFrameworks addon for loading and displaying shaders from the Shadertoy page.
Shadertoy is (c) iq
This addon is distributed under the terms of the MIT License.

Usage

  1. Set up your project to use the programmable shader. in the int main(...) function, set your window to use OpenGL 3.2 or greater:

    ofGLWindowSettings settings;
    settings.setGLVersion(3, 2);    // <--- ofxShadertoy NEEDS the GL Programmable Renderer
    settings.width = 1024;
    settings.height = 768;
    ofCreateWindow(settings);       // <-------- setup the GL context
  2. Set up the ofxShadertoy to load a file with the shadertoy glsl code

    ofxShadertoy shadertoy;
    ...
    shadertoy.load("shaders/raymarch.frag");
  3. Set up textures if needed by the shader

    shadertoy.setTexture(0, nifty_texture);
  4. In your draw() routine, draw a quad (or use begin() and end() to set up the shaders for a mesh) Effects happen in screen space.

Extensions

I've set up some extensions to the shader parameters, mostly relating to using a camera (for use, non-exclusively, with another one of my addons, ofxFPSControls). The new uniforms are:

uniform mat4 tCameraMatrix; - a camera matrix that can be set up using ofCamera or any child class (e.g. ofxFPSControls)

ofxshadertoy's People

Contributors

tiagosr avatar

Watchers

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