• Stars
    star
    330
  • Rank 127,657 (Top 3 %)
  • Language
    C++
  • License
    Other
  • Created almost 13 years ago
  • Updated over 5 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Unlocking the GPU Power on openFrameworks with this add-on for that make easy to use GLSL Shaders

logos

I start this addon while I was working on Efecto Mariposa. Is the result of adapting different well know algorithms to GLSL Shaders for openFrameworks.

An important feature of ofxFX is it ability for fast-prototyping mixing different classes using the << operator.

ofxFX was originally develop for GLSL 120 but now is been edited to support openGL ES and openGL 2.0 thanks to the new programable render of openFrameworks. Oliver is giving me a hand with that. Anybody else that want to collaborate is wellcome.

ofxFXObject

It´s the parent class of all the other effect. If you want to make a new filter you may want to start looking at the ofxFXObject.h .

The structure it´s easy.

  1. Constructor: here it´s necessary to set three vital variables:

    • int passes: the number of passes or itineration of the main ping pong betweens FBO´s
    • int internalFormat: if it use GL_RGB, GL_RGBA, GL_RGB16f, GL_RGBA16f, GL_RGB32f, GL_RGBA32f, etc...
    • string fragShader: it´s the code of the shader. Note that some changes have to be made in order to fill everything on a string
  2. allocate(width,height,GL_RGBA): This usually it´s no need to be re-define. It´s basically allocate the FBO´s and loads the shader by using injectShader();

  3. setCode(string fragContent): here is where the shaders are loaded. See the example below.

  4. begin(int texN) and end(int texN): remember nTextures variable? you can passthrough information to it by using this end() and begin() and giving the argument the number of texture you want to open. This texture can be access from the shader by the uniform sample2DRect tex0 or tex1 or tex2 and so on.

    4.1. << and setTexture(texture-like, num=0) if you have an FBO, a texture, an ofxFXObject, or something similar, you can use this function to write it to tex0, tex1, etc (as indicated by the num argument). << always writes to tex0.

    4.2. If you're making a multi-pass shader, you can access to the previously rendered frame with uniform sample2DRect backbuffer in your shader. This will also contain the information from tex0 on the first pass.

  5. update(): This is the core of the class, where the magic happens. If you check for the ofxFXObject::update() you will see how the tex's, the backbuffer and other default uniforms variables (time, mouse, resolution) are loaded. NOTE: If you are using the << operator you don't need to update. It's done automatically for you

  6. draw(x,y,w,h): After all you definitely want to look at it.

Filters

Mix them all

ofxFXObject have some handy operators that let you combine them really easily. At the Mix´s Example you will find how to do it. Basicaly it´s somethin like this


ofxFXObject objA;
ofxGrayScott objB;
ofxBlur     blur;

objA.allocate(width, height);
objB.allocate(width, height);
blur.allocate(width, height);

...

blur << (objB << objA);

...

blur.draw();

<iframe src="http://player.vimeo.com/video/35230297" width="575" height="453" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe> <iframe src="http://player.vimeo.com/video/34304485" width="575" height="431" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe> <iframe src="http://player.vimeo.com/video/30684308" width="575" height="429" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe> <iframe src="http://player.vimeo.com/video/29887776" width="575" height="431" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe> <iframe src="http://player.vimeo.com/video/29896245" width="575" height="431" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe> <iframe src="http://player.vimeo.com/video/29894099" width="575" height="431" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>

More Repositories

1

thebookofshaders

Step-by-step guide through the abstract and complex universe of Fragment Shaders.
GLSL
6,031
star
2

glslViewer

Console-based GLSL Sandbox for 2D/3D shaders
C++
4,208
star
3

lygia

LYGIA, it's a granular and multi-language (GLSL, HLSL, WGSL, MSL and CUDA) shader library designed for performance and flexibility
GLSL
2,492
star
4

glslEditor

Simple WebGL Fragment Shader Editor
JavaScript
2,303
star
5

glslCanvas

Simple tool to load GLSL shaders on HTML Canvas using WebGL
JavaScript
1,753
star
6

PixelSpiritDeck

GLSL
483
star
7

glslGallery

JavaScript
363
star
8

glslTexture

Blender addon to create 2D textures from GLSL. It follows the same nomenclature that glslViewer, glslCanvas, glslEditor, ofxShader and PixelSpirit
Python
341
star
9

OpenLiDAR

DIY 3D LiDAR Scanner
C++
207
star
10

ofxStreetView

OF scraper for GoogleStreetView panoramas and depthmap
C++
185
star
11

sublime-glslViewer

Sublime Text 2/3 plugin for live coding GLSL Shaders
Python
147
star
12

ada

A general porpose OpenGL app library
C++
120
star
13

KinectCoreVision

Kinect Implementation of CCV
C++
100
star
14

hilma

library to generate 2D/3D geometries
C++
89
star
15

MidiGyver

C++
77
star
16

ofxFluid

GPU Fluid Simulation with a collisions layer
C++
76
star
17

vera

C++/WASM GL Framework
C++
65
star
18

vPlotter

Wireless vPlotter for RaspberryPi
C++
64
star
19

ofxComposer

Set of connecting boxes that let you load and processes different type of data on the GPU by using shaders.
C++
59
star
20

hypatia

Geo-Astronomical library for artist
C++
58
star
21

ofxVoro

OpenFrameworks wrapper of Voro++ that do 3D Voronoi Tessellation
C++
55
star
22

ofxPTAMM

Parallel Tracking and Multiple Mapping (PTAMM by Robert Castle) wrapper for openFrameworks.
C++
53
star
23

cursoOF

Curso en español de openFrameworks aplicado a la creación
C++
53
star
24

Shell-Initiation

Exoteric *nix terminal tutorial
51
star
25

ofxShader

Objective-C
50
star
26

LineOfSight

What are the satellites in your line of sight?
JavaScript
47
star
27

ss2015

C++
46
star
28

.glslScreenSaver

Make your own custom ScreenSaver in linux using GlslViewer
GLSL
46
star
29

libopz

non official API library for the OP-Z
C++
46
star
30

lygia_threejs_examples

GLSL
40
star
31

sims2014

Simulation Studio, creative coding course taught at parsons school of design, MFADT
C++
40
star
32

ofxInteractiveSurface

For Mapping ofTextures to surfaces making transformations and masking all in one process
C++
37
star
33

ofxBlobTracker

Classic and simple blobTracker implementation used on CCV ( Created by Ramsin Khoshabeh ) + Finger Tracking
C++
33
star
34

tangram-sandbox

JavaScript
32
star
35

ofxThermalPrinter

OpenFrameworks library to control mini thermal printers (https://www.adafruit.com/products/597)
C++
29
star
36

ofxBundle

Import bundle files with cameras and point clouds.
C++
29
star
37

lygia_unity_examples

ShaderLab
28
star
38

Meshes

Simple Python Module to load, construct, parse, transform, save meshes in OBJ/PLY format
Python
26
star
39

ofxBlackBox

Minimal aesthetic orientation GUI for openFrameworks with MultiTouch/TUIO compatibility
C
24
star
40

OFPlay

Simple and Easy Tool for install and manage openFrameworks libraries and projects
C++
24
star
41

ofxGame

Group of handy classes for making Interactive 2D Games. With time and work it could be a decent game engine
C++
24
star
42

sfpc_ll16

Lux Lingua introduction at SFPC
JavaScript
23
star
43

lygia_p5_examples

GLSL
22
star
44

HeNerator

script to generate HeN ipfs app exports of GLSL shaders
Python
22
star
45

ofxTuio

Old TUIO Wrapper
C
21
star
46

ofxPro

C++
19
star
47

AxiSurface

Python module to make 100% vector line compositions and export them as SVG or G-Code files
Python
18
star
48

lygia_of_examples

GLSL
18
star
49

RandomCity

JavaScript
18
star
50

patriciogv_algo2012

Algorithmic Animation Homework Parsons New School MFA DT 2012
C++
17
star
51

sNodes

Syphon Nodes EcoSystem wrote using openFrameworks for life coding of GLSL Shaders
C++
14
star
52

vscode-pickers

GLSL/HLSL Float, 2D/3D Vector and Color picker for vscode
JavaScript
14
star
53

vim-glslViewer

Vim pluging for glslViewer which allow you to live-code shaders from your RaspberryPi
Vim Script
13
star
54

ofxEliza

Wrapper for "Chatterbot Eliza 2.0" made by Gonzales Cenelia. With is a C++ implementation of this well know chatbot
C++
12
star
55

patriciogv_avsys2013

Audio/Video Systems Homework Parsons New School MFA DT 2013
C++
12
star
56

itp17

HTML
11
star
57

joyOfLight

application that provides a means for people to play with light-painting in an intuitive and colorful way.
C++
11
star
58

ofxKeyboard

openFrameworks Virtual Keyboard implementation using ofxTUIO
C
10
star
59

.dotfiles

CSS
10
star
60

ofxPiTFT

PiTFT addon for your RaspberryPi projects
Objective-C
10
star
61

ofxGlmTools

a set of tools that use glm library
C++
10
star
62

ISS

view of OpenStreetMap from the ISS
JavaScript
9
star
63

bootcamp2013_code

Processing
9
star
64

eyeo16

JavaScript
9
star
65

ofxTimelinePro

C++
9
star
66

Skylines03

City point cloud
C++
8
star
67

hilma_raymarcher

Cuda
8
star
68

ada_example3D

JavaScript
8
star
69

ofxPulseSensor

openFrameworks addon of PulseSensor ( for Arduino and RaspberryPi )
C++
7
star
70

ofxKinectStreamer

Multi-platform Kinect depth information streamer that use native openFrameworks addons
C
7
star
71

ofxMd2

Md2 viewer ported to openFrameworks byJellyFish.com and TheoWatson.com
C
7
star
72

Timeline

C++
6
star
73

ada_example

Simple example of an ADA program
HTML
6
star
74

AxiPrinter

Stand alone RaspberryPi controller for my AxiDraw A3
Python
6
star
75

wgpu_sandbox

rust/wgpu sandbox
Rust
6
star
76

opz_experiments

GLSL
4
star
77

openVis16

OpenVis 16' Talk about Maps and Shaders
JavaScript
4
star
78

Communitas

Interactive multiTouch table made using openFrameworks and TUIO protocol.
C++
4
star
79

ofxMapsPro

C++
4
star
80

oscLab

OSC client for the OP-Z (through libopz)
C
4
star
81

lygia_minecraft

Kotlin
4
star
82

ofxMtPhotoGallery

Mouse/TUIO moultiTouch PhotoGallery
C++
4
star
83

ofxKinectUsers

Kinect addon for re-programable gesture tracking
C++
4
star
84

glslBenchmark

JavaScript
4
star
85

RaspistillAPI

PHP Raspistill API
C++
4
star
86

patriciogonzalezvivo.com

Personal Portfolio
JavaScript
4
star
87

edenControl

iOS app for remote controlling EDEN software. That it´s an Interactive Ecosystem Simulation made specially for Efecto Mariposa.
Objective-C
4
star
88

ofxSubtitles

openFrameworks addon for working with .srt movie subtitles format
C++
4
star
89

lygia_examples

GLSL
4
star
90

mary

Open Source C++ Library for different telemetry sensors with Python bindings
C
3
star
91

PixelSpiritEditor

JavaScript
3
star
92

hawkeye

Refurnishing a Kodak Brownie Hawkeye with a RaspberryPi and RasbperryCam
GLSL
3
star
93

mesaDelTiempo

C++
3
star
94

ofxWiiOSC

Wiimote addon that connects to DarwiinOSC
C++
3
star
95

AlgorithmicNaturalis

3
star
96

southUp

http://southupmap.com/
HTML
3
star
97

ofxFXPro

C++
2
star
98

HardCodeAPaper

Write like you code. Write your academic paper in MarkDown and then export them to PDF in correct Chicago Style.
TeX
2
star
99

MotionRecorder

iOS Motion Recorder
Objective-C
2
star
100

OpenNI2TUIO

C++
2
star