Well, when i should have been fixing bugs, adding long-requested features, and replying to emails, I've instead been working on a shader language for Indigo!
*begs forgiveness from exporter writers*
The language is a simple little strongly typed, pure functional language.
It's currently interpreted by a stack-based bytecode VM I hacked up.
I looked around at a few existing languages / VMs, but none of them provided quite what i wanted, or had too much overhead, so I decided to roll my own. Perhaps I'll switch to an existing language later, we'll see.
So here's an example shader used on a diffuse material:
Code: Select all
<material> <name>mat1</name> <diffuse> <colour>0.7 0.7 0.7</colour> <albedo_texture> <uv_set>albedo</uv_set> <path>colorchecker_srgb_from_ref.jpg</path> <exponent>2.2</exponent> </albedo_texture> <albedo_shader> <![CDATA[ def rgbAlbedo(vec3 pos, vec2 uv) vec3 : sample2DTextureVec3( 0, add( getTexCoords(0, uv), vec2(fbm(pos, 10)) ) ) ]]> </albedo_shader> </diffuse> </material>
http://fatalfantasy6.deviantart.com/art ... 2-89539933
It uses a fractal Brownian motion function to perturb the texture coordinates. (good for making procedural marble )
You will be able to write shaders for any material parameter, also for displacement.
Thoughts, ideas, requests, etc..?