-
Notifications
You must be signed in to change notification settings - Fork 11
Home
rookboom edited this page Nov 12, 2012
·
67 revisions
SharpShaders is a library that allows you to write GPU shader code in F#.
Shader translation using code quotations ####Examples
####Future Work
- Runtime code compilation
- It should be possible to edit an F# shader and immediately see the result at runtime (if the changed shader compiles of course)
- Dynamic Shader Linking
- The Dynamic attribute on shader functions should indicate that this function can be swapped at runtime
[<Dynamic>]
let marble = ...
[<Dynamic>]
let lumpy = ...
[<Dynamic>]
let crinkled = ...
let mutable surface = marble
[<PixelShader>]
member m.crinkled(input:PSInput) =
surface input
At runtime the surface shader can be swapped:
ps.surface <- ps.crinkled