Last active
August 29, 2015 14:01
-
-
Save floooh/8eb627385aef9fcedbc9 to your computer and use it in GitHub Desktop.
Testing Oryol shader template syntax
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| only exactly one @ tag per line | |
| @block MyTransform | |
| @uniform mat4 mvp ModelViewProj | |
| vec4 transform(vec4 pos) { | |
| return mvp * pos; | |
| } | |
| @end | |
| @vs MyVertexShader | |
| @use MyTransform [...] // @use has 'varargs' | |
| @in vec4 position | |
| @in vec4normal | |
| @in vec2 texcoord0 | |
| @out vec2 uv | |
| void main() { | |
| $position = transform(position); | |
| uv = texcoord0; | |
| } | |
| @end | |
| @fs MyFragmentShader | |
| @uniform sampler2D tex ColorTexture | |
| @in vec2 uv | |
| void main() { | |
| $color = $texture2D(tex, uv); | |
| } | |
| @end | |
| @bundle MyBundle | |
| @program MyVertexShader MyFragmentShader | |
| @end | |
| @stateblock MyStateBlock | |
| @state CullFaceEnabled true | |
| @state ColorMask true true true false | |
| @state ClearColor 1.0f 1.0f 1.0f 0.0f | |
| @end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment