Skip to content

Instantly share code, notes, and snippets.

@pyalot
Created April 2, 2015 08:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pyalot/05f5007b6826342621a8 to your computer and use it in GitHub Desktop.
Save pyalot/05f5007b6826342621a8 to your computer and use it in GitHub Desktop.
state assembly test
createState: (framebuffer, code) ->
@fw.state
cull: 'back'
shader: [
fs.open('/pbr-tools.shader')
fs.open('tools.shader')
"""essl
fragment:
void main(){
#{code}
}
"""
]
depthTest: true
vertexbuffer: @vertexbuffer
constructor: (@fw) ->
@foo = @createState null, '''essl
vec3 albedo = getAlbedo();
vec3 excident = shade(albedo, 1.0, 0.0)+albedo*0.25;
write(excident*1.5);
'''
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment