Cycles: Subsurface Scattering
New features: * Bump mapping now works with SSS * Texture Blur factor for SSS, see the documentation for details: http://wiki.blender.org/index.php/Doc:2.6/Manual/Render/Cycles/Nodes/Shaders#Subsurface_Scattering Work in progress for feedback: Initial implementation of the "BSSRDF Importance Sampling" paper, which uses a different importance sampling method. It gives better quality results in many ways, with the availability of both Cubic and Gaussian falloff functions, but also tends to be more noisy when using the progressive integrator and does not give great results with some geometry. It works quite well for the non-progressive integrator and is often less noisy there. This code may still change a lot, so unless you're testing it may be best to stick to the Compatible falloff function. Skin test render and file that takes advantage of the gaussian falloff: http://www.pasteall.org/pic/show.php?id=57661 http://www.pasteall.org/pic/show.php?id=57662 http://www.pasteall.org/blend/23501
This commit is contained in:
@@ -1078,6 +1078,19 @@ __device_inline float triangle_area(const float3 v1, const float3 v2, const floa
|
||||
|
||||
__device_inline void make_orthonormals(const float3 N, float3 *a, float3 *b)
|
||||
{
|
||||
#if 0
|
||||
if(fabsf(N.y) >= 0.999f) {
|
||||
*a = make_float3(1, 0, 0);
|
||||
*b = make_float3(0, 0, 1);
|
||||
return;
|
||||
}
|
||||
if(fabsf(N.z) >= 0.999f) {
|
||||
*a = make_float3(1, 0, 0);
|
||||
*b = make_float3(0, 1, 0);
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
if(N.x != N.y || N.x != N.z)
|
||||
*a = make_float3(N.z-N.y, N.x-N.z, N.y-N.x); //(1,1,1)x N
|
||||
else
|
||||
@@ -1161,6 +1174,11 @@ __device_inline float3 rotate_around_axis(float3 p, float3 axis, float angle)
|
||||
|
||||
/* NaN-safe math ops */
|
||||
|
||||
__device_inline float safe_sqrtf(float f)
|
||||
{
|
||||
return sqrtf(max(f, 0.0f));
|
||||
}
|
||||
|
||||
__device float safe_asinf(float a)
|
||||
{
|
||||
if(a <= -1.0f)
|
||||
|
Reference in New Issue
Block a user