https://github.com/falcon11/glslsandbox-ios
glslsandbox implementation for iOS
https://github.com/falcon11/glslsandbox-ios
glsl glslsandbox gpuimage opengl
Last synced: 3 months ago
JSON representation
glslsandbox implementation for iOS
- Host: GitHub
- URL: https://github.com/falcon11/glslsandbox-ios
- Owner: falcon11
- License: mit
- Created: 2019-12-02T13:48:53.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-01-12T05:50:52.000Z (over 5 years ago)
- Last Synced: 2025-01-14T01:24:15.440Z (4 months ago)
- Topics: glsl, glslsandbox, gpuimage, opengl
- Language: GLSL
- Homepage:
- Size: 4.33 MB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# glslsandbox-ios
## Overview
Native iOS implementation of [glslsandbox](http://glslsandbox.com/), using [GPUImage](https://github.com/BradLarson/GPUImage).You can run most Fragment Shader copied from [glslsandox](http://glslsandbox.com/) or [ShaderToy](https://www.shadertoy.com/) without modification or just a little modification.
## Add new Fragment Shader
1. copy fragment shader source code from [glslsandbox](http://glslsandbox.com/)
2. create a new fragment shader source file under FragmentShader folder, then past code copied from last step. If you copy shader from [ShaderToy](https://www.shadertoy.com/), you need to modify the file.
```c
// add below lines at begining
#ifdef GL_ES
precision mediump float;
#endif
uniform float time;
uniform vec3 mouse;
uniform vec2 resolution;
// shadertoy emulation
#define iTime time
#define iResolution resolution
#define iMouse mouse// add below lines at end
// --------[ Original ShaderToy ends here ]---------- //
void main(void)
{
mainImage(gl_FragColor, gl_FragCoord.xy);
}
```
3. in ***GLSLSandboxListViewController.m*** file, add the fragment shader source file name to the `sandboxDemosList`.
4. run the project you will find the new demo in the demo list.## Demo Snapshot
![]()
![]()
![]()