Skip to content

A UIView subclass for rendering an OpenGL ES 2.0 fragment shader

Notifications You must be signed in to change notification settings

jellychen/UFDShaderView

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 

Repository files navigation

UFDShaderView

A UIView subclass for rendering an OpenGL ES 2.0 fragment shader

Usage

This example creates a shader view, loads the example shader source, and animates it at 30 frames per second.

UFDShaderView *shaderView = [[UFDShaderView alloc] initWithFrame:self.view.bounds];
[shaderView loadFragmentShader:kUFDShaderViewExampleFragmentShaderSource error:nil];
shaderView.animating = YES;
[self.view addSubview:shaderView];

This will make this awesome thingy appear:

alt tag

Fragment Shader Uniforms

uniform float time; // time in seconds
uniform vec2 touch; // location of current touch
uniform vec2 resolution; // resolution of the view

TODO

  • Retina support
  • OpenGL ES 3.0
  • CocoaPod

License

Credits would be nice I guess.

About

A UIView subclass for rendering an OpenGL ES 2.0 fragment shader

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published