I find it pretty astounding that you can do something that looks so accurate, using the same techniques as those papers, but as a post effect using only Z and normals. Very clever stuff.
Anti-aliasing I have to look into still. That should be fixed automatically when this is integrated properly in the renderer (which is the eventual goal)
Well that’s music to my ears You’re doing an incredible job already, keep up the great work!
You probably already know these, but just in case you don’t and possibly could inspire with more idea’s, here are two papers that I found very useful when I worked on my failed attempts, the first is an image based technique like yours:
And this one on the renderman repository site, look for the siggraph 2003 pdf, article ‘implementing a skin bssrdf or several’ by Cristophe Hery. That one was the basis for my random guess work: http://www.renderman.org/RMR/Publications/index.html
Anyway, once again, very good work brecht, can’t say enough about it really. Just goes to show that actual math knowledge is good for something, and that randomly hacking, hoping it magically will all work somehow, is not going to cut it in the end
eeshlo,the paper you suggested is very good,but I think brecht is on the right way,the only thing that should be improved in MHO is the workflow(for a true usage in real scenes),for skin we need more than one layer,and some masking/weighting,even if it can be done using the compositor at full power,it can become daunting(How to do multi characters with different setting,or different settings for skin,eyes,and teeth without going mad?)
Just wanted to say, I’m amazed, specially because its a post process effect!!! and it runs super fast here, around 5 sec for an 800x600 image (default settings, just playing with presets)
great!
If just an “inverted Z” pass wouldn’t change the brightness in different positions to the cam :S
It would be perfect for Backscatter
Maybe you can bring the depth to equal, to get just the thickness, by using add/supstract or multiply/divide…
The effect looks soooo great!
good work
Using “selective gaussian blur” in the Gimp may be better because it doesn’t blur the fine detail in the skin texture image or the UV island limits, which if too blurred cause the background black to bleed in the seams. The greenish bands (3D stereo effect) also disappear.
i can’t understand how such a great thing is possible through a POST-effect… shouldn’t sss be calculated dirctly within the renderer during the calculation with light-rays. <- is this the difference between front- and back-scatter ?!?
:spin: - i can’t believe my eyes, that it’s a post-effect - :spin:
I applied your patch to today’s cvs on a Kubuntu 6.06.1 Amd64 system. I usually enable blenderplayer and the game engine. When I do that I get those build errors (without those enabled it builds fine):
Compiling ==> 'buildinfo.c'
Linking program ==> 'blender'
Linking program ==> 'blenderplayer'
build/linux2/lib/libnodes.a(CMP_scatter.o): In function `create_octree_points':CMP_scatter.c:(.text+0xfd4): undefined reference to `RE_scatter_map_screen_to_world'
:CMP_scatter.c:(.text+0x1006): undefined reference to `RE_scatter_get_pixel_area'
:CMP_scatter.c:(.text+0x1021): undefined reference to `RE_scatter_get_pixel_area'
build/linux2/lib/libnodes.a(CMP_scatter.o): In function `node_composit_exec_scatter':CMP_scatter.c:(.text+0x1533): undefined reference to `RE_scatter_init'
:CMP_scatter.c:(.text+0x1588): undefined reference to `RE_scatter_init'
:CMP_scatter.c:(.text+0x1bdb): undefined reference to `RE_scatter_init'
:CMP_scatter.c:(.text+0x1c81): undefined reference to `RE_scatter_map_screen_to_world'
collect2: ld returned 1 exit status
scons: *** [build/linux2/bin/blenderplayer] Error 1
scons: building terminated because of errors.
I don’t know if this is interesting to you at this early stage, but in case it is, I thought I’d mention it.
Now I’m off going to play with this shiny new node.
eeshlo, I based my first implementation on these papers (the code is still in the patch, but uncommented). With a tree structure however you do not have to worry about setting the number of samples to avoid noise, just setting error to 0.1 seems to work in all cases I tested, whereas otherwise the number of samples may need to be very high, require user tweaking, depending on the geometry and blurring radius.
renderdemon, I fully agree the compositor is not the right way to integrate this, it was just the easiest way for debugging etc. The goal is to have it as part of the renderer.
Sanne, seems only blenderplayer that is failing to compile, so you can still use blender, but this will be fixed in the next version of the patch.
oodmb, that’s one of those limitations of having it as a post process node.
I was all ready to poo-poo this because it was a post effect, but holy crap that looks nice. And, in imagery, if it looks nice it is nice. I’d like to see it integrated into a scene and see how it looks though.
brecht, yes, I just disabled blenderplayer (and gameengine also) and recompiled successfully. I just wanted to make sure you know about this.
I played a bit with the sss node by now and wow, boys’n’girls, this is good stuff! Thanks again. I’m looking forward to following the further development.
The node works very well, but I’m curious why it’s not a material node and why it takes five seconds to render on ZanQdo and twenty minutes on my computer? Once I’m able to get this to work faster, I’m going to use it all the time =)
EDIT: Oops… I was using a stupid node setup. I checked your screenshots and got it to work properly and faster.
I think the 3delight renderman people implemented the SSS equations from the BSSRDF paper. They made a subsurface() function call to make it easy to write SSS shaders. All you do is basically call the function and add the result to your standard BRDF equation. It supports the parameters in the BSSRDF paper as attributes. I plugged in some values for skin and tweaked them a little to get this:
This is a 600x600 image and it took 20 seconds to render, fully antialiased - it should support animation too. I’m really hoping to get my 3delight script finished soon so you guys can play with it. Yet again I should apologise for taking so long. I just want to get it right and let’s face it, I’m not Cambo who can knock scripts out in a week or so.
I actually like the idea of the post-process effect. If it’s faster than rendering, it would be much easier to tweak. The more I use compositing, the less I want to wait on the renderers churning away at images.