PDA

View Full Version : Question: realistic Skin shader


HotBox
09-17-2003, 02:04 PM
Just a quik question

is there a way within mental ray for maya to simulate sub-surface scattering as seen in human skin, any help will be much appreciated

thanks

Nigel

fxjeane
09-17-2003, 05:33 PM
Yes there is. Mental Ray supports all sorts of features that will allow you to write a sss shader. From www.MentalImages.com

>>>>>>>
Can mental ray do subsurface scattering?
mental ray supports any natural phenomenon, including simulation of subsurface scattering, in custom shaders. The algorithm is well-known from the medical literature.
>>>>>>>>


The problem is that if there is not one already written and distributed freely, you will have to write your own shader.
I believe their shaders are written in C++.

I dont use MRay so I encourage the Experts to invertene

http://www.mentalimages.com/4_1_motion_pictures/fight_club/_015.html

This image SEEMS like it uses sss, but I cant tell for sure (I havent read any making of articles on it).



Cheers
fxjeane

jeremybirn
09-17-2003, 05:53 PM
You could try:
http://www.andymator.co.uk/shaders/tranvol2/

I haven't heard of a lot of people getting results with it, and maybe it isn't the fastest implementation, but it is a free download. I hope it lets you paint the maps you need to control it, it does have a Maya interface to download. If you get something useful, please share your results.

"The algorithm is well-known from the medical literature."

LOL! They don't want to give credit to Henrik Jensen, but suggesting "medical" literature instead of SIGGRAPH papers???
http://graphics.ucsd.edu/~henrik/images/subsurf.html

-jeremy

EmreGoren
09-17-2003, 11:28 PM
I dunno about Maya but I know that in Max 6 , there are some interesting shaders from Lume Tools , written for MR 3.x (Max 6)..I've seen only alpha release and cant guess anything about the final version of these shaders...Of course those were for Max 6..And I have to add that MR for Max 6 is working faster than MR in XSI..

stew
09-17-2003, 11:33 PM
Originally posted by jeremybirn
"The algorithm is well-known from the medical literature."

LOL! They don't want to give credit to Henrik Jensen, but suggesting "medical" literature instead of SIGGRAPH papers???
http://graphics.ucsd.edu/~henrik/images/subsurf.html

From Mr. Jensen's paper:

"Subsurface scattering is also important in medical physics, where models have been developed to describe the scattering of laser light in human tissue [6, 8]. In that context, diffusion theory is often used to predict as well as to measure the optical properties of highly scattering materials. We have extended this theory for use in computer graphics by adding exact single scattering, support for arbitrary geometry, and a practical sampling technique for rendering.
[..]
Again building on medical physics research [8, 9], we have extended a methodology developedfor measuring biological tissues into a rapid image-based appearance measurement technique for translucent materials."

Sounds to me like the medical researches deserve the credit.

lazzhar
09-19-2003, 09:48 PM
Just some tests I did with this Custom Shader on MR4M where i used my humble head.
http://lazzhar.jeeran.com/testtransvol3.jpg
http://lazzhar.jeeran.com/testtransvol2.jpg

lazzhar
09-19-2003, 09:52 PM
http://lazzhar.jeeran.com/testtransvol1.jpg

Hope it helps
-lazhar

stew
09-20-2003, 10:32 AM
In my experience, the combination of subsurface scattering, good textures, bumps and good lighting is the best approach for realistic skin. SSS alone won't do it, it really needs good lighting too.
http://www.keindesign.de/stefan/poser/visu/hdriskin.jpg

lazzhar
09-20-2003, 01:01 PM
Very nice !!
For my head, it was just a test render to see the effect of SSS with tranvol2. I've never seen results with this shader so i tryed myself. I tryed to do it with textures but i know it will take ages to render with my slow computer.
what did you use to render this body?

stew
09-20-2003, 01:10 PM
This is Poser 5's renderer, using a light set created with HDRShop/LightGen. I rendered this to test the script I wrote to import the light set and I was surprised to see how it turned out, despite the low-res texture I used.

jeremybirn
09-20-2003, 04:04 PM
I'm just trying to get it installed here, I tried following the instructions but Maya is saying "Warning: File not found: render_tranvol201.xpm" and I don't know where to get that or put that...

-j

gga
09-20-2003, 06:04 PM
Besides the aforementioned transvol which was written with xsi in mind, there is also a shader from www.lightengine3d.com called subScatter written for maya more specifically. It is not free, but there is a demo version, limited to the number of lights (one).

The lightengine3d one offers a tad more control and also comes with a version for the maya renderer.

The mray version is somewhat limited in that it does not emulate all the attributes of a standard maya phong shader, and does only subscattering (at least last time I checked it). The maya version does it all.

Regarding missing .xpm, thatīs just the icon needed for the maya display (if it is not found it should still work, or you can use any icon and name it appropiately like that). It can be placed anywhere in which maya searches for icons (XBMFILEPATH or something like that environment variable).

lazzhar
09-20-2003, 09:18 PM
I've got that problem Jeremy, just put that file in the Icons directory of your Maya. It's not mentioned in the instructions, I think it's not written for Windows users.

jeremybirn
09-21-2003, 03:53 AM
Originally posted by lazzhar
I've got that problem Jeremy, just put that file in the Icons directory of your Maya. It's not mentioned in the instructions, I think it's not written for Windows users.

I never got a file with that name, but I renamed another icon file to that, hoping it would work -- it didn't, and when I create the transvol node there are no options or variables in the attribute editor for it. Hmmm...

-jeremy

lazzhar
09-21-2003, 12:57 PM
Oops... There is no icon file with Transvol. I still have that warning message when loading MR, but the Shader works fine as you can see above. Maybe you did miss something jeremy. I've donwloaded this shader some months ago, but i didnt try it till now. May be they changed something. It works fine on Maya 5.0.

jeremybirn
09-21-2003, 06:53 PM
Alright, thanks, I got it working, and played with it for a while, although it gets so slow (feels as if it is raytracing all the scattering), that I did most tests with very few samples looking at grainy output.

You can see from how it interacts with shadows in some areas that it wasn't designed to work as a skin shader in contrasty lighting situations. For example, light a head with a single key with opaque shadows, making one side of the nose bright but leaving the nostrils dark. Then add SSS, and see if the red glow extends into the nose interior - it didn't, and the characteristic soft reddish edges around shadows cast on the cheeks don't seem to work well, either, although I got one thin edge like that. The thread linked below notes that it is not really a SSS shader:
http://www.highend3d.com/boards/showflat.php?Cat=&Board=MayaMR&Number=153320
Still, it allows some interesting translucency effects to go pretty far beyond the stock Maya shader translucency, so it seems well worth downloading and testing in case it is needed - great shader for a free-bee, anyway, we should all thank Andy for his on-going work.

-jeremy

sean_G
09-23-2003, 08:19 PM
there's a shader called volumeFX, this does all kinds absorbtion and volumetric-scattering calculations.--this was mentioned in the link that mr. Birn appended in his last response.---

it is really versatile too. you can apply the same shader to an object for SSS, or apply it to a pass/scene and get all kinds nice atmospheric volumetric scattering effects. though the shader-node is not texturable, so i havent found it to be that suitable for things with varying levels of absorbtion. it would be great if you could apply a procedural-texture and have it map to an objects volume in 3d, which hypothetically is plausible, since procedurals are inherently 3d fractals.

what i dont understand is why mentalray for maya users dont have access to it (i use XSI), i was under the impression that mentalray shaders operated inside mentalray, and were therefore independant of whatever application they originally came with.
PS. im pretty sure this is the shader they used for all that great volume scattering in Fight Club.

jeremybirn
09-23-2003, 09:34 PM
Many of the MR shaders that ship with XSI were written by Softimage and only come with Softimage products with MR.

I hadn't heard that one wasn't mappable - for human skin, different parts of the face need to be mapped differently for SSS to work convincingly.

-jeremy

sean_G
09-23-2003, 11:08 PM
alot of surfaces and volumes need to be textured to correctly respond to SSS shading and lighting, ie. Henrik Jensen's
example of the granite sphinx, human skin, marbles, and anything which isnt entirely homogeneous. . .

i assume that you use Prman for most of your rendering production, mr. Birn. What kind of SSS solutions are avaliable to users of this product, are they texturable? are there some shaders that Pixar utilizes that may be made avaliable in the future? arent several layers of mesh actually required to correctly reproduce the scattering in human skin (fascial tissue, dermis, and epidermis)?

so much research has been done regaurding this subject that i wonder why more shaders using BSSRDF arent avaliable. . . although we are seeing alot of 3rd party solutions... Andymator's Transvol and Taron's Hotspotter for Lightwave, to name a few. possibly the adaption of mentalray to other packages, maya, 3dsmax etc has forced development of this kind of stuff to a backburner. i was at the SIIGRAPH in LA, and was delighted to see so much response on the subject. . .im just a little dissappointed that not alot has been done to implement all that great reasearch, but then at least its not an effect that has been played-out like the proverbial "LensFlare"

jeremybirn
09-25-2003, 10:12 AM
The need to map SSS I mentioned wasn't even based on variation in the skin (although that's there too) it's primarily the variation of what's underneath it. In your forehead, there's your skull right under the skin. In your cheek, there's translucent flesh. So, if a high-contrast shadow falls over your cheek, you get a red glow around it, or if the terminator is there there's an orange-red glow around the terminator, but you don't expect to see that in the forehead where there's less translucent red flesh beneath the skin. In the forehead all SSS does for you most of the time is warm up the frown lines and wrinkles so they go deep red instead of black.

Most SSS you hear about done in Renderman (such as for characters like Gollum) are at studios where they design their own shaders. I believe though that there's a "Swiss Army" shader that can support SSS and be linked to any texture you want.

I've very interested in off-the-shelf solutions I can use at home, and I find transvol interesting, and subscatter plug-in from lightengine3d to be promising. It's a shame MR isn't keeping up as well as it used to - back around the time Jenson was working for them, all the latest things (Photon Mapped GI, Caustics, Image Based Lighting) were getting implemented soon after he developed them. Now that they've parted ways, the more recent stuff he's come out with hasn't been getting implemented. I'd like to see a real focus on this issue in off-the-shelf products, because making something look soft and translucent shouldn't take a lot of R&D, SSS is a tool that many 3D artists could use to help shake that CG look on their renders.

-jeremy

CIM
10-15-2003, 09:47 PM
Someone should convert this skin shader for MR: http://graphics.stanford.edu/~mmp/software.html

rendermaniac
10-16-2003, 01:11 AM
No offense to Matt Pharr (he is a genius!), but his skin shader has one problem. And that's that it just adds extra light and does not transport light under the surface to another point. It doesn't help that RenderMan shaders are not designed for this generally.

What would be really nice for sub surface scattering is if there was a cheap trick like Image Based Illumination which is easy to use.

Or something like ambient occlusion. The main difference being that subsurface effects, by their nature, are very dependent on the scene lighting so it is difficult to bake out and still have the ability to tweak it. At the moment you need to manage a lot of complex information to get anywhere near fast enough for tweaking.

Simon

gga
10-18-2003, 07:04 AM
Originally posted by rendermaniac

What would be really nice for sub surface scattering is if there was a cheap trick like Image Based Illumination which is easy to use.


Well, there is one already described in Buhler and Jensen's paper.

It can be implemented with popular commercial renderers but not very easily (ie. you have to do several hacks and more likely, two render passes. In renderers that support better tesselation control, you can just likely use a simpler parametric tesselation and avoid Turk's method as mentioned in that paper).

Anyway, Buhler and Jensen's methodology is a good one and I can think of many uses for it besides SSS.

A better approach is then likely better to extend current renderers to allow baking as a dynamic render step on a per object basis.

That is, instead of having baking be done as a separate render (as all renderers currently do), a baking shader would be allowed to happen between a displacement shader and the calling of the surface shader each time an object is intersected.
The baking results would then be cached in memory, instead of saving to disk, albeit saving to disk could also be an option.

This baking shader would be called only once per object the first time a ray intersects its bounding box. Unlike other shaders, it would work similar to a displacement shader in that it would be run all across the object using a non-view determined step size (ie. a different tesselation would likely work too). The results of the baking shader would not be visible but would be stored in some acceleration structure like Jensen's octrees if the need arises.

The surface shader would then have the neighboring information needed to calculate anything that it wants.

Dan Wade
10-19-2003, 06:09 PM
Andy should be releasing a new version of his Transvol shader soon. He showed a few of us students it a few months back....seems to be much faster. It also has ambient occlusion built in.

Dan.

CIM
10-28-2003, 08:31 AM
This looks like a great way to do subsurface scattering, especially for skin: http://aolsearch.aol.com/aol/redir?src=websearch&requestId=175c917204479f36&clickedItemRank=3&userQuery=Hanrahan+and+Krueger.+%22Reflection+from+Layered+Surfaces+due+to+Subsurface+Scattering.%22+Computer+Graphics+Proceedings%2C+Annual+Conference+Series+%281993%29%2C+165-174&clickedItemURN=http%3A%2F%2Fwww1.cs.columbia.edu%2F%7Eravir%2F6998%2Fpapers%2Fp165-hanrahan.pdf

Worley's G2 (http://www.worley.com/G2/g2_skin.html) uses that method to do subsurface scattering for skin and it's by far the best skin shader I've ever seen. It can even be previewed in realtime.

kpalazov
11-02-2003, 01:19 PM
For me until now the best attempt at a human skin shader has come from Pixar. In this years Siggraph paper they have explained very well the theory and methods of implemenation of the skin shader they have developed. All the information one would need is there . Formulas snippets of the code...enough to put the shader together. As I'm still learning RSL and RIB the task of writing the shader and the DSO's required is quite daunting.
As the shader theory was used in production it is clearly a very fast solution and by the looks of it the best simulation of skin as yet. It actually simulates skin , meaning a thin layer of material ontop of another rather then a one big ray scattering material like wax!

What I think would be fantastic, is if a group of us got together to collect all the pieces of the puzzle and put it together for everyone to use. With the outpour of free renderman complient renders the shader can be used by almost anyone ......and I'm sure we could easily port it to other platforms like Mray.
We can showcase out development on the boards here and learn from each other the process of developing a complicated shader as well as learning about the programming involved.
Anyone would be able to view it and contribute.

It would be great if anyone is interested in this idea. If you are please post here or contact me at k_man_mango@hotmail.com. If you have skill in RSL , Renderman or General Shader Design it would be fantastic if could help.

Regards

Kiril

MCronin
11-02-2003, 05:53 PM
The problem with the shader presented by ILM and Pixar at Siggraph is that it's very much specific to Pixar's Renderman. You need to be able to generate and then access from within the shader, an irradiance cache, and there aren't too many renderers out there that have that capapbility. You could probably try to fudge it by computing irradiance at each point, but then that defeats the purpose of it being a fast solution.

That solution, I think, is the same solution used in the Swiss Army shader. So, if you aren't clear on how to implement it, take a look at the SL code and you should be able to figure it out. Further, somewhere in the RMan documentation, they explain a brute force method and some optimizations for SSS if you want to try them out.

Failing that, Matt Pharr's solution is pretty good. It's easy to implement in a lot of renderers, it's fast, and it looks decent, especially if you use ambient occlusion with it. I used his solution to write a skin shader in VEX for Mantra and it looks pretty good, I think.

kpalazov
11-02-2003, 11:55 PM
THanks for pointing that out MCronin I was not aware that DSO's were a renderman specific feature:)
I guess in that case there is not much point to that idea....however I still think a thread about shader writing and design , ( advanced shaders), would be really great . Talking more custom shaders like skin and clouds more then precedural texture.

BTW I have found the section in the documentation but I think I will check it out again...as well as the code for the SAK shader.
THanks very much for you input MCronin , most apprciated.

Cheers

Kiril

MCronin
11-03-2003, 02:40 AM
DSO's aren't PRMan specific. I'm sorry if I gave you the impression that this would be impossible anywhere else but in Renderman. The problem is most renderers, even Renderman compliant renderers, don't support these features yet. I don't know about MR, but I suppose it's probably possible there. In Mantra I'm pretty sure it's possible but you have to compute radiance on the fly for each point., as I can't find any info on accessing an irradiance cache in a shader. I don't know about the other free RMan renderers because I haven't really tried them, but so many of them are in such early stages of development, it's doubtful. You could however, write the needed support into a free open source renderer if you're willing :beer:

I'd like to see more about writing shaders as well. It such a powerful featutre for people using renders that spport shading languages yet so few people seem to take advantage of it, and there's so little good information.

CGTalk Moderation
01-16-2006, 03:00 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.