Desaxismundi’s Velvet Shader

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.


3 Responses to “Desaxismundi’s Velvet Shader”

  1. May 12, 2008 at 6:28 pm

    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 !

  2. 2 toneburst
    May 12, 2008 at 9:29 pm

    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 🙂


  3. 3 D
    May 20, 2008 at 7:13 am

    Thanks for sharing the Desaxismundi shader, very cool work. Your blog is quite the find. 🙂

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


Error: Twitter did not respond. Please wait a few minutes and refresh this page.

May 2008
« Apr   Jun »


Blog Stats

  • 477,478 hits

%d bloggers like this: