intigrated SSS ideas

i start this thread as a place where people to discuss ideas for integrating an SSS shader into the blender internal that would be able to calculate multilayers forward scattering multiscattering and backscattering WITHOUT a complete renderer rewrite. i myself do not know the subtlties of how blender’s internal render engine works and do not have the ability to code in blender, but i do know alot about how SSS shaders work and techniques work, having reaserched methods of accessing it for a number of months.
if you decide to post an idea or crique of an idea here you should at least know what SSS actualy is, understand some of the methods of going about it (other than personal speculation), or some understanding of blender’s render engine.
I personaly have a number of ideas about how to do SSS in blender, one of which is to use a sort of conical multi-sampling (for forward scattering) method of raytracing from the first ray cast. when the ray hits an SSS material, it would send out shadow rays (if the BI works how i think it does), but have them be a sort of conical primitive, that would apply the full sampling of the circle to that one point, thus if only half of the conic was intersected, the ray hitting the light would still be a light hit, although proportionaly scalled. the orignial ray on hit would also send out refraction rays (conics) to the other side of the material and take the light sampling from the point at which it intersects the opisite side. this method would require ray code alot like the ones used for glass, and would only increase the render time a small amount.

I think that first we must decide what we want, forward scattering,multiscattering?
They are different,multiscattering can be done in several not physical ways,forward scattering is a different things,I’m more interested in skin,and I vote for multiscattering:)
For mutiscattering,there is a really easy way to do it,simply convolve the normals with a smooth geometry filter,and it’is done!.This,combined with my precedent shadow map techniques give perfect,artifact free,skin shading(I have tested the technique versus mental ray miss_fast skin ,one of the best skin shaders,and work really,really,similar)
My approach has one big drawback,currently I use the normal map(my own code,not the blender one,because they are wrong)for convolving the normals,but object space normal map(the one I use)can’t be used in skeletal animation,tangent space normal maps are needed,but how can be convolved?(my approac is geometric,I use the smooth brush sculpting tools to geometrically convolve the normals,that baked give multiscatter map,but baking tangent space normal map isn’t supported)

wow :smiley: you seem to have a fairly concrete idea of the principles of a SSS shader
Unfortunately you will not find many coders here who understand your ideas and can advise you what is possible and what is difficult.
Maybe you should go to the blender.org forum. You should find people who can help you there. Some things you should be aware of: Your chances of getting a coder to help you might be better if you understood the principles of C because communication would be much easier… If you want to be taken seriously you should make the proposal and the idea as clear as possible (-> the above post is a little bit difficult to read, especially if English is not your mother tongue)
There is a tutorial on how to write a shader for blender (i.e. which files you have to change) here.
However, it seems as if your SSS shader is a lot more difficult to write than the example shader.
I wish you good luck with your idea. IMHO blender needs a SSS shader even though there are some very good and fast fake methods.

well, i can code in java, so coding is not out of the question, its just that i cant seem to figure out how to compile blender, and C++ doesnt make much sense visualy to me. english is my mother toungue, i was just getting wordy while trying not to say anything that would start a virtual riot. as for writing a shader, in most situations, i do not think simply writing a shader would work, because the shader would have to act on both the ray on the hit, and ray bounces/computations after the hit.
renderdemon: if blender is to have a realistic sss shader, it will have all three types of scattering to be physicaly correct. however, it does not have to use physicaly correct methods to compute these effects. that would be the world of an unbiased/hybrid renderer. the effect must be done either in passes, spacial databases, or a traditional shader/raymode.

Yes,you are right,it’s better to find solution for all the scattering effects,but I don’t want a shader solution that can do only candle rendering:o.
For me,the problem is how to find a way to integrate correctly the incoming light in a fast way,we have to find a way to take samples on the surface,for multiscattering this is what it’s needed to give reasonable good results.All the shader I know do the same basic thing,they keep light samples at some points and average it together,based on some radius(the suggested normal maps convolving do exactly the same things,but with an interesting property,it does at geometric level,with only one map you can render with every light position/distribution,and this is a good thing).Taking the samples on surface can be very heavy,this is the difficoult part,some shader do the sampling in camera space(mental ray miss_fast work in this way I think),some on uv space(like the method broken suggested),
EDIT
I have done some render with my system,I hope you don’t find tasteless,sorry in that case,it’s not my intent,but this kind of subject are ideal to test skin shading,trying only on head it’s not a good thing,the details put on texturing doesn’t help to understand correctly the shading,

Yes,you are right,it’s better to find solution for all the scattering effects,but I don’t want a shader solution that can do only candle rendering:o.

the reason so many people’s shaders with sss look like candles is because of improper handling of the specular highlights, bump maps, and absorbtion qualities. for stuff like skin which has different angle and power dependent properties, the node system would be used.

technicaly both multiscattering in camera space and in uv space are the same, however camera space is a much better solution. the problem with these shaders would be however, that for some reason, i think that blender’s internal does not save spatial data or previous ray data in the render, the blur method of multisampling during a render by any way other than uv baking imposible. the problem with uv baking then becomes that the model has seems, the internal would have to have intigrated passes, and it would have to create a new texture for each render. on a side note, i think cinema 4d’s chanelum shader does one of these.

beleive it or not, the SSS effects seen in skin are almost all forward scattering and backscattering. because skin is so thin and so absorband, there is little room for multiscattering, thus hard shadows are still hard on skin. the red around the ear is all forward scattering, and the moist quality arises from backscattering. Wax on the other hand, is mostly forward scattering and multiscattering, and very little backscattering.

I don’t agree,forward scattering isn’t so important for skin rendering(yes,you have the burning ear, but the whole thing?Try rendering an organic shape with diffuse/lambert,and try rendering with a correct multiscatter simulation,it will look much better,it smooth the look,diffuse + front scatter it’s not the same thing.The first sss simulations were mainly focused on front/back scattering,and for skin shading the results were really poor,for me good shader are diffusion by daniel rind and mental ray miss_fast_skin)
Btw,front/back/multiscattering/diffusion,it doesn’t interest me much,we simply have to find a good solution (fast)to render translucent material,I think we can agree on this:o ,

very tasty renderdemon :wink:

is this modeled or scanned?

mind sharing how you set up the SSS ?

please share the .blend (just the setup at least, not necessarily the model).

Thanks cekuhnen,it’s a model of mine,not scanned,modelled with nicholas bishop wonderful sculpt tool,I want to use it for an image I’m working on,but I have to do hair for her,I have a version without sculpted hair(I have asked Ton some little stuff for modelling hair,I hope he find the time to do it),and for now I’m testing skin shading.
About the setup,I use my custom node to do normal map calculation,
The idea is what I have explained before,I integrate the surface using the sculpt tool,at geometric level,I bake to normals(the bake I do in Zbrush,probably it can be done even with new Blender bake,but for this stuff I use my custom Blender 2.42 build,I have to see what normal the bake exports,if object space it can be done all in blender),
The scatter layers(based on normal map shading) are modulated with a vector curves node,I use it in some trick ways to find the correlation beetween light and camera,nothing special.The layers(I use 2 layer for multiscattering,and other 2 for forward/back scatter) are screen added to diffuse and specular terms.I also have some stuff for darkening the skin for the oil layer and the asperity scattering but currently (in these renders)they do nothing,I have to improve that stuff.
Finally some nodes to use ao in a good way
A blend file without my custom build does nothing,if I make some progress I’ll post the blend file + the blender.exe

well why not upload your custom build then please?

Watching this thread closely, but not really anything substantial to contribute thus far. I get the feeling that renderdemon will upload what he can once he has removed more glitches and made his process more refined/streamlined/easy to use. If the results are this good already, I’m happy to wait until it’s finished. :slight_smile: I wish I could help more, but all I can think of is providing high resolution models to test the effect on.

check this out:
Download the first picture. start the program. it uses depth buffers, but it works so well
and this:
interactive rendering of translucent deformable objects

it would be nice if somebody could either get the paper for that or find out more about how the first one works.
btw, i realy dont mind bugs in blender, its just realy hard to understand exactly what you mean with such abstract descriptions.