Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/render/intern/source/sss.c')
-rw-r--r--source/blender/render/intern/source/sss.c64
1 files changed, 32 insertions, 32 deletions
diff --git a/source/blender/render/intern/source/sss.c b/source/blender/render/intern/source/sss.c
index 4192aaf42aa..a60db8a963f 100644
--- a/source/blender/render/intern/source/sss.c
+++ b/source/blender/render/intern/source/sss.c
@@ -32,16 +32,16 @@
/* Possible Improvements:
- - add fresnel terms
- - adapt Rd table to scale, now with small scale there are a lot of misses?
- - possible interesting method: perform sss on all samples in the tree,
- and then use those values interpolated somehow later. can also do this
- filtering on demand for speed. since we are doing things in screen
- space now there is an exact correspondence
- - avoid duplicate shading (filtering points in advance, irradiance cache
- like lookup?)
- - lower resolution samples
-*/
+ * - add fresnel terms
+ * - adapt Rd table to scale, now with small scale there are a lot of misses?
+ * - possible interesting method: perform sss on all samples in the tree,
+ * and then use those values interpolated somehow later. can also do this
+ * filtering on demand for speed. since we are doing things in screen
+ * space now there is an exact correspondence
+ * - avoid duplicate shading (filtering points in advance, irradiance cache
+ * like lookup?)
+ * - lower resolution samples
+ */
#include <math.h>
#include <string.h>
@@ -82,11 +82,11 @@ extern Render R; // meh
/* Generic Multiple Scattering API */
/* Relevant papers:
- [1] A Practical Model for Subsurface Light Transport
- [2] A Rapid Hierarchical Rendering Technique for Translucent Materials
- [3] Efficient Rendering of Local Subsurface Scattering
- [4] Implementing a skin BSSRDF (or several...)
-*/
+ * [1] A Practical Model for Subsurface Light Transport
+ * [2] A Rapid Hierarchical Rendering Technique for Translucent Materials
+ * [3] Efficient Rendering of Local Subsurface Scattering
+ * [4] Implementing a skin BSSRDF (or several...)
+ */
/* Defines */
@@ -164,7 +164,7 @@ typedef struct ScatterResult {
} ScatterResult;
/* Functions for BSSRDF reparametrization in to more intuitive parameters,
- see [2] section 4 for more info. */
+ * see [2] section 4 for more info. */
static float f_Rd(float alpha_, float A, float ro)
{
@@ -182,7 +182,7 @@ static float compute_reduced_albedo(ScatterSettings *ss)
int i;
/* use secant method to compute reduced albedo using Rd function inverse
- with a given reflectance */
+ * with a given reflectance */
fxn= f_Rd(xn, ss->A, ss->ro);
fxn_1= f_Rd(xn_1, ss->A, ss->ro);
@@ -232,10 +232,10 @@ static float Rd(ScatterSettings *ss, float r)
}
/* table lookups for Rd. this avoids expensive exp calls. we use two
- separate tables as well for lower and higher numbers to improve
- precision, since the number are poorly distributed because we do
- a lookup with the squared distance for smaller distances, saving
- another sqrt. */
+ * separate tables as well for lower and higher numbers to improve
+ * precision, since the number are poorly distributed because we do
+ * a lookup with the squared distance for smaller distances, saving
+ * another sqrt. */
static void approximate_Rd_rgb(ScatterSettings **ss, float rr, float *rd)
{
@@ -444,10 +444,10 @@ static void compute_radiance(ScatterTree *tree, float *co, float *rad)
traverse_octree(tree, tree->root, co, 1, &result);
/* the original paper doesn't do this, but we normalize over the
- sampled area and multiply with the reflectance. this is because
- our point samples are incomplete, there are no samples on parts
- of the mesh not visible from the camera. this can not only make
- it darker, but also lead to ugly color shifts */
+ * sampled area and multiply with the reflectance. this is because
+ * our point samples are incomplete, there are no samples on parts
+ * of the mesh not visible from the camera. this can not only make
+ * it darker, but also lead to ugly color shifts */
mul_v3_fl(result.rad, tree->ss[0]->frontweight);
mul_v3_fl(result.backrad, tree->ss[0]->backweight);
@@ -484,7 +484,7 @@ static void sum_leaf_radiance(ScatterTree *UNUSED(tree), ScatterNode *node)
node->backrad[0]= node->backrad[1]= node->backrad[2]= 0.0;
/* compute total rad, rad weighted average position,
- and total area */
+ * and total area */
for(i=0; i<node->totpoint; i++) {
p= &node->points[i];
@@ -532,7 +532,7 @@ static void sum_leaf_radiance(ScatterTree *UNUSED(tree), ScatterNode *node)
}
else {
/* make sure that if radiance is 0.0f, we still have these points in
- the tree at a good position, they count for rdsum too */
+ * the tree at a good position, they count for rdsum too */
for(i=0; i<node->totpoint; i++) {
p= &node->points[i];
@@ -558,7 +558,7 @@ static void sum_branch_radiance(ScatterTree *UNUSED(tree), ScatterNode *node)
node->backrad[0]= node->backrad[1]= node->backrad[2]= 0.0;
/* compute total rad, rad weighted average position,
- and total area */
+ * and total area */
for(i=0; i<8; i++) {
if(node->child[i] == NULL)
continue;
@@ -606,7 +606,7 @@ static void sum_branch_radiance(ScatterTree *UNUSED(tree), ScatterNode *node)
}
else {
/* make sure that if radiance is 0.0f, we still have these points in
- the tree at a good position, they count for rdsum too */
+ * the tree at a good position, they count for rdsum too */
totnode= 0;
for(i=0; i<8; i++) {
@@ -686,8 +686,8 @@ static void create_octree_node(ScatterTree *tree, ScatterNode *node, float *mid,
}
/* here we check if only one subnode is used. if this is the case, we don't
- create a new node, but rather call this function again, with different
- size and middle position for the same node. */
+ * create a new node, but rather call this function again, with different
+ * size and middle position for the same node. */
for(usedi=0, usednodes=0, i=0; i<8; i++) {
if(nsize[i]) {
usednodes++;
@@ -865,7 +865,7 @@ static void sss_create_tree_mat(Render *re, Material *mat)
points.first= points.last= NULL;
/* TODO: this is getting a bit ugly, copying all those variables and
- setting them back, maybe we need to create our own Render? */
+ * setting them back, maybe we need to create our own Render? */
/* do SSS preprocessing render */
BLI_rw_mutex_lock(&re->resultmutex, THREAD_LOCK_WRITE);