View topic - Beta release: SubSurface Scattering

Beta release: SubSurface Scattering

This forum hosts proposals sent to YafaRay, discussions about GSOC 2010 accepted projects and their betatesting.

Beta release: SubSurface Scattering

Post Sat Aug 07, 2010 2:21 pm

Hi all,
I'm releasing the alpha version of the translucent shader for Yafaray. I'd like you guys test this shader and give me any suggestion (of course include bugs), let's make this shader better.

Bellows are the source code of Yafaray with my shader and the corresponding exporter:
http://github.com/liyong03/YafaRay
http://github.com/liyong03/YafaRay_Blender-2.49/
Because my dev environment is Mac, Sorry for that I can't provide a compiled version.

How to use it:
1. Material setting (as the image show):
I added a material called "Translucent(SSS)"
"Diffuse Color" "Glossy Color" "Specular Color" are very clear, the same as other material.
"Absorption color", this is "sigma a" in translucent object, which describes the absorb property of translucent material. Sample value is (0.0021, 0.0041, 0.0071).
"Scatter color", this is "sigma s" in translucent object, which describes the scatter property of translucent material. Sample value is (2.19, 2.62, 3.00).
"SigmaS factor", the value of sigma S is computed by "Scatter color"*"SigmaS factor". Because in exporter, "Scatter color" is set by color picker, so it's range is from (0,0,0) to (1,1,1), so if you want set "Scatter color" larger than (1,1,1), you will need this parameter.
"IOR", like glass material.
"Diffuse reflection" "Glossy reflection" "Translucency" are the strength of the three part in result.
"Exponent", like glossy material, for glossy part.
Image


The texture could be mapped to some of these parameters. As the image shows, the texture and their mapping are:
Col -> "Diffuse Color"
Nor -> normal mapping
Csp -> "Specular Color"
Ref -> "Glossy reflection"
Alpha -> "Absorption color"
TransLu -> "Scatter Color"
Image


2. Render setting (as the image show):
Three lighting method support translucent rendering: Direct light, Photon mapping, and Path tracing.
In every lighting setting:
"Use SSS" button is open the rendering of translucent object. If there is not translucent object in your scene, please don't press this button.
After pressed this button, there will be four parameters:
"SSS Photons", the photons in sss photon map. Because I used an adaptive scheme of shooting photon, so here this parameter is the total amount of photons that the lights shoot, but also the photons that hit the translucent object.
"SSS Depth", this parameter controls the photon reflected times in the scene.
"Single Scattering Samples": the sample number for evaluation the single scattering.
"Scale": This parameter is used for setting the scale of translucent object. Because the translucent model is defined in the unit of [mm], so this parameter how many [mm]s in the scene the distance 1 equals. If "Scale"=30, so the distance 1 in the scene represents 30 [mm] in reality.
Image


Welcome suggestions.
liyong03
 
Posts: 17
Joined: Mon Mar 22, 2010 3:19 am

Re: Beta release: SubSurface Scattering

Post Sat Aug 07, 2010 6:39 pm

hi,

I am on Ubuntu 10.04 64-bit and I just compiled and set up your version of yafaray successfully. First renders are made. :D
The material-preview for SSS-mat doesn't work here. Shows black sphere only. Would help a lot to have it for further testing. :)

cheers, oberon

p.s. I appreciate what you and the other GSOC-people made the last weeks, so much.
oberon
 
Posts: 12
Joined: Sun Sep 13, 2009 7:28 am

Re: Beta release: SubSurface Scattering

Post Sat Aug 07, 2010 9:02 pm

This looks great, thanks liyong03.

I was wondering though. Most people rendering with Yafaray use 1 Blender Unit = 1 metre. If appropriate, would it be possible to have 1000 as the default setting for 'Scale'?
User avatar
stoneage
 
Posts: 1241
Joined: Sun Dec 23, 2007 1:06 pm

Re: Beta release: SubSurface Scattering

Post Mon Aug 09, 2010 6:12 am

test for SSS
Attachments
sssdragon.png

"Power tends to corrupt, and absolute power corrupts absolutely. Great men are almost always bad men."

User avatar
condar
 
Posts: 771
Joined: Sun Apr 12, 2009 2:41 am

Re: Beta release: SubSurface Scattering

Post Mon Aug 09, 2010 1:29 pm

Because my dev environment is Mac, Sorry for that I can't provide a compiled version.


I may sound stupid, but if you test your branch on a mac, can't you provide a mac build?
Because I really would like to test this, and I'm on OSX too. Anyways, thanks for your work.
User avatar
bupla
 
Posts: 164
Joined: Thu Oct 23, 2008 7:06 am

Re: Beta release: SubSurface Scattering

Post Mon Aug 09, 2010 3:52 pm

@oberon
The material-preview for SSS-mat doesn't work here. Shows black sphere only. Would help a lot to have it for further testing.

I will try to fix this problem.

@stoneage
That's true. The reason why I set default as 30 is that the translucent effect is more obvious than that's 1000.

@bupla
Sorry, I will learn how to package the compiled version, and provide it.

@condar
You can set sss scale smaller, like 100, here is my result.
Attachments
dragon2.png
my result
liyong03
 
Posts: 17
Joined: Mon Mar 22, 2010 3:19 am

Re: Beta release: SubSurface Scattering

Post Mon Aug 09, 2010 8:00 pm

I have made a few tests of the sss material, and the results overall have been pretty nice with very few problems. I did get a bit stuck with one scene however, a tomato with a very simple test material:

tomato002.png


I think the tomato came out nice, even for a simple test. I tried putting an sss material on the stem too, but as you can see it rendered really dark. I tried the default white sss material with translucency turned way down, and it was still too dark. I also tried putting the scale to 100 thinking it was a scale issue, but no luck. It's probably something simple but I'm not sure what the problem is.

One other quick question: is the sss code fully optimized for speed at this time? I'm just curious if it could get any faster in the future.
Attachments
tomato.zip
(95.13 KiB) Downloaded 538 times
User avatar
wizofboz
 
Posts: 235
Joined: Tue Sep 16, 2008 7:00 pm

Re: Beta release: SubSurface Scattering

Post Tue Aug 10, 2010 8:16 am

@liyong03

:oops: I had to tweak the values a bit more for a preview. It seems, that I only had to raise "glossy reflection" to more than 0.000 to get the other parameters work. :roll:
oberon
 
Posts: 12
Joined: Sun Sep 13, 2009 7:28 am

Re: Beta release: SubSurface Scattering

Post Tue Aug 10, 2010 8:16 pm

Windows build (2010-08-11) (fixed link)
http://exvion.ru/liyong03/liyong03-YafaRay-89b2c5b-github.exe

Yafaray Blender 2.49
liyong03-YafaRay_Blender-2.49-5a077a2.zip
(47.15 KiB) Downloaded 608 times
Last edited by exvion on Wed Aug 11, 2010 12:34 am, edited 1 time in total.
exvion
 
Posts: 105
Joined: Sun Jan 10, 2010 6:40 pm
Location: Russia

Re: Beta release: SubSurface Scattering

Post Tue Aug 10, 2010 10:32 pm

.exe link is broken

exporter downloads ok
loh
 
Posts: 250
Joined: Sat Sep 20, 2008 3:22 am

Re: Beta release: SubSurface Scattering

Post Wed Aug 11, 2010 8:06 am

exvion wrote:Windows build (2010-08-11) (fixed link)
http://exvion.ru/liyong03/liyong03-YafaRay-89b2c5b-github.exe

Yafaray Blender 2.49
liyong03-YafaRay_Blender-2.49-5a077a2.zip


Hi Exvion, thank you very much for your help

Just for clarification for other people as well, the exporter zip have got scripts that are already installed with the installer you have provided. Should I replace the installer scripts in the python folder and Blender scripts folder with the scripts of the ZIP file?

Thanks in advance for your answer.
User avatar
Samo
 
Posts: 3105
Joined: Tue Dec 20, 2005 10:39 am
Location: Spain

Re: Beta release: SubSurface Scattering

Post Wed Aug 11, 2010 8:10 am

I see, they are all the same.
User avatar
Samo
 
Posts: 3105
Joined: Tue Dec 20, 2005 10:39 am
Location: Spain

Re: Beta release: SubSurface Scattering

Post Wed Aug 11, 2010 8:11 am

Samo, put yafaray_ui.py and yafCliRender2.py in ./blender/scripts folder. I do not know whether this is correct, but it works for me.
exvion
 
Posts: 105
Joined: Sun Jan 10, 2010 6:40 pm
Location: Russia

Re: Beta release: SubSurface Scattering

Post Wed Aug 11, 2010 3:02 pm

Can anyone confirm whether non SSS Glossy materials are rendering correctly? I only had time for a quick test as I have some other renders to finish, so I was unable to test more thoroughly.

Either there is a problem or it was just something stupid I did......... :)
User avatar
stoneage
 
Posts: 1241
Joined: Sun Dec 23, 2007 1:06 pm

Re: Beta release: SubSurface Scattering

Post Thu Aug 12, 2010 8:59 am

hi there

Liyong03, I believe that in many scenes people use 1 blender unit = 1 metre. Besides, Yafaray settings are more optimised for this kind of setup, than for example 1 Blender unit = 1 mm.

That's why I believe that the scale value should have as upper limit = 1000, instead of 100.
User avatar
Samo
 
Posts: 3105
Joined: Tue Dec 20, 2005 10:39 am
Location: Spain

Next

Return to Google summer of code 2010 - YafaRay Projects



Who is online

Users browsing this forum: No registered users and 1 guest

cron