Search Home Members Contacts
About Us
Products
Downloads
Community
Support
Pages: [1]
  Print  
Author Topic: Realtime HLSL Fur Demo (now includes Video)  (Read 11509 times)
BlindSide
Customers
Community Member
*****
Posts: 760


« on: January 04, 2007, 02:13:09 AM »

I decided I wanted a little break from shadowmapping and such, so I spent the last day and night working on a little fur =).

There's nothing really special here, it's a standard shells-based method, but I think the results are pretty nice.

UPDATE - VIDEO: http://smithbower.com/old/fur/BFD.avi NOTE:6 megs, uses XVid

Click for a larger version




Here's the general idea...
Ideally, fur should be modelled physically in order to create the best effect. However, that would require an amount of detail not available to us in the realtime rendering world. Instead we must create an approximation.. so how do we do that? One way is to create partially transparent "shells" layered on your mesh, so that the visible sections of the shells appear to extrude from the mesh. If done right, this gives us the illusion of several fine hairs. Simple eh?

This implementation creates a "fur" texture for each shell layer, so with varying opacities so as to create "thinner" fur as the fur gets longer. By messing with the way the maps are generated, you can create a whole whack of effects, like curly fur, scraggly fur, fine/course fur, or having fur be shorter/longer/non-existant on different parts of the model.

Additionally, there is support for faked inter-fur shadowing - by creating additional fur shells with an offset, you get a bit more definition for each "spike".

Oh, and for the adventurous.. the shader code supports a force value to bend the fur. Could be used to create wind effects? I'm going to play with it a bit, I suggest you do too!

Beta users, download here: http://www.truevision3d.com/phpBB2/viewtopic.php?p=99531#99531
Logged
Zaknafein
Customers
Community Member
*****
Posts: 2940


WWW
« Reply #1 on: January 04, 2007, 02:33:30 AM »

Bloody hell this looks good. I'm amazed, as this is the first fur implementation I've seen in TV3D.

Great work Blind, as always!
Logged

JohnB
Customers
Community Member
*****
Posts: 183


« Reply #2 on: January 04, 2007, 03:56:11 AM »

Uhm - WOW again BlindSide - that's just amazing!

John B.
Logged
sgrippa
Customers
Community Member
*****
Posts: 238


« Reply #3 on: January 04, 2007, 04:35:33 AM »

Gosh, it seems there is a race between Blindside and Zaknafein to win the world championship in HLSL developement. :shock:
Logged

Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. (Rich Cook)
WEst
Customers
Community Member
*****
Posts: 945

Daniel Martinek


WWW
« Reply #4 on: January 04, 2007, 04:39:01 AM »

Looks great!
Logged

Greetings

Daniel Martinek
Technical Director
23 Volts
Waterman
Moderator
Community Member
*****
Posts: 1157


« Reply #5 on: January 05, 2007, 07:45:05 AM »

Good work! Now furs are in TV3D.
Logged

Things should be described as simply as possible - but not simpler [A. Einstein]
Rynus_Rein
Community Member
*
Posts: 1008


« Reply #6 on: January 07, 2007, 02:39:29 PM »

Looks cool! It's actually the second time I see fur in TV3D 6.5 Smiley
Logged

Rynus Rein
Current Project: MapX Live, Society3D
AriusMyst
Guest
« Reply #7 on: January 07, 2007, 02:59:31 PM »

Blind did actually do fur ages ago. Not sure if he posted it before. I think this is his better version though, now he has more exp in HLSL.
Logged
BlindSide
Customers
Community Member
*****
Posts: 760


« Reply #8 on: January 07, 2007, 03:20:29 PM »

Yup.. eons ago, I did fur. I think that was my second public demo/shader thing - but it wasn't very attractive. It was heavily based off the Nvida sample. I think there's a screenshot of the tiger still in the 6.5 screenshots section.

This fur is much better =D
Logged
Happy
Customers
Community Member
*****
Posts: 78


« Reply #9 on: January 07, 2007, 05:44:28 PM »

WOW!! Blindside thats just mad awesome man, I didn't think many shaders were compatible with TV3D65 after I tried 7 apps with HLSL, GLSL and CG support.. I've only manage to get 9 shaders to work... but none like youre's or Zaks. Impressive work guys keep up the good work, Also Blindside good luck with the shadowmapping demo man. Cool

Seeya Later!
Logged
BlindSide
Customers
Community Member
*****
Posts: 760


« Reply #10 on: January 07, 2007, 05:47:05 PM »

Thanks Happy, the demo is coming along slowly =D

Any DX compatible shader will run in TV, since TV uses DX's shader engine. The tricky part is that most complex shaders, such as fur, or shadowing, require a fair mount of application work as well as shader work. This is where more problems arise - even when you copy straight from a DX demo. It really isn't easy to simply port someone's code, there are a lot of small things that tend to get in the way.
Logged
AriusMyst
Guest
« Reply #11 on: January 07, 2007, 05:52:28 PM »

Quote from: "BlindSide"
It really isn't easy to simply port someone's code, there are a lot of small things that tend to get in the way.


Hehe, yea. A good example of this is actually Blinds fur shader. I've spent all day trying to port it. Neither he nor I had any idea why its not working  :wink: .
Logged
Slider
Community Member
*
Posts: 1135


« Reply #12 on: January 11, 2007, 03:45:53 AM »

Here's the original shader, for those of you interested:

http://www.xbdev.net/directx3dx/specialX/Fur/index.php

I don't think you mentioned it is based on an existing shader demo?
Logged

Slider is the name, and logic is my game...
Helping retards through life since 1981
BlindSide
Customers
Community Member
*****
Posts: 760


« Reply #13 on: January 11, 2007, 04:55:34 PM »

Quote from: "Slider"
Here's the original shader, for those of you interested:

http://www.xbdev.net/directx3dx/specialX/Fur/index.php

I don't think you mentioned it is based on an existing shader demo?


Aye, thanks, forgot to stick that in =)

The original code is based on the tutorial on that site, which explains things a lot better than I did, however I was never able to get it to work, so I'm not sure how my implementation compares to his - I don't know how he does the curely fur, though I would imagine he offsets his depths maps by a smidge for each layer to create a jitter.
Logged
Slider
Community Member
*
Posts: 1135


« Reply #14 on: January 12, 2007, 08:39:48 AM »

Quote from: "BlindSide"
Quote from: "Slider"
Here's the original shader, for those of you interested:

http://www.xbdev.net/directx3dx/specialX/Fur/index.php

I don't think you mentioned it is based on an existing shader demo?


Aye, thanks, forgot to stick that in =)

The original code is based on the tutorial on that site, which explains things a lot better than I did, however I was never able to get it to work, so I'm not sure how my implementation compares to his - I don't know how he does the curely fur, though I would imagine he offsets his depths maps by a smidge for each layer to create a jitter.


Well, the curly effect is done by manipulating the vertex shader.
Here's a way to do it to create, for example, waving/curly fur (non TV):
Code:
// Apply swaying
    IN.position.x  += cos(SwayXNoise * fSeconds * SwaySpeed) * sin(SwayXNoise * fSeconds * SwaySpeed) * SwayIntensity * (a_Layer * a_Layer);
    IN.position.z  += sin(SwayZNoise * fSeconds * SwaySpeed) * cos(SwayZNoise * fSeconds * SwaySpeed) * SwayIntensity * (a_Layer * a_Layer);


I've been using something similar to create waving grass:
Logged

Slider is the name, and logic is my game...
Helping retards through life since 1981
Zaknafein
Customers
Community Member
*****
Posts: 2940


WWW
« Reply #15 on: January 12, 2007, 01:45:18 PM »

Oooh, sexy.
It's been a while since we heard/saw stuff from you Slider, welcome back! Cheesy
Logged

Slider
Community Member
*
Posts: 1135


« Reply #16 on: January 12, 2007, 02:50:44 PM »

Quote from: "Zaknafein"
Oooh, sexy.
It's been a while since we heard/saw stuff from you Slider, welcome back! Cheesy


Thanks! I've been quiet busy lately so I haven't been around much Sad
I'm working as a programmer for a game company now (actually, it's already been two years by now), so I'm legally allowed to play with the big engines now Smiley
Logged

Slider is the name, and logic is my game...
Helping retards through life since 1981
Raul
Customers
Community Member
*****
Posts: 550

I like games.


WWW
« Reply #17 on: January 15, 2007, 04:22:20 PM »

wow.. this rocks Cheesy

nice effects.. Smiley
Logged

Pages: [1]
  Print  
 
Jump to:  

Powered by SMF 1.1.3 | SMF © 2006-2007, Simple Machines LLC
Seo4Smf v0.2 © Webmaster's Talks