Desaxismundi was kind enough to let me see the code to his HLSL velvet surface shader. After a bit of fiddling around this morning, I was able to get it working in QC. Here is the result, applied to some imported 3D meshes, created with the Paul Bourke’s excellent supershape explorer application.
I’ve modified the code slightly, so it runs as two discrete functions, one in the Vertex Shader, and one in the Fragment Shader. You just have to call these functions from the main loop in the two shader programs. The VS function takes the normal as input and outputs the correct varyings to send to the FS, and the function in the Fragment Shader takes as input the various lighting parameters, and a texture input and returns the final lit colour of the fragment.
This should make it nice and easy to integrate into other shader code.



Any way to get access to your code ? You could use a Box.net widget to make it available … (see my own blog at http://3dmon.wordpress.com ) Thanks !
Hi Dr.Goulu,
the Box.net widget looks like a good idea. I think I will sign up for that. Thanks for the suggestion!
I’ll see what Desaxismundi says about sharing his code. I always think it’s good to ask first
a|x
Thanks for sharing the Desaxismundi shader, very cool work. Your blog is quite the find.