svn merge ^/trunk/blender -r43183:43220
This commit is contained in:
@@ -53,7 +53,6 @@
|
||||
#include "BKE_image.h"
|
||||
#include "BKE_main.h"
|
||||
#include "BKE_node.h"
|
||||
#include "BKE_object.h"
|
||||
#include "BKE_pointcache.h"
|
||||
#include "BKE_report.h"
|
||||
#include "BKE_scene.h"
|
||||
@@ -62,11 +61,12 @@
|
||||
#include "BKE_writeavi.h" /* <------ should be replaced once with generic movie module */
|
||||
|
||||
#include "BLI_math.h"
|
||||
#include "BLI_blenlib.h"
|
||||
#include "BLI_listbase.h"
|
||||
#include "BLI_string.h"
|
||||
#include "BLI_path_util.h"
|
||||
#include "BLI_fileops.h"
|
||||
#include "BLI_rand.h"
|
||||
#include "BLI_threads.h"
|
||||
#include "BLI_callbacks.h"
|
||||
#include "BLI_utildefines.h"
|
||||
|
||||
#include "PIL_time.h"
|
||||
#include "IMB_imbuf.h"
|
||||
@@ -81,7 +81,6 @@
|
||||
#include "renderpipeline.h"
|
||||
#include "renderdatabase.h"
|
||||
#include "rendercore.h"
|
||||
#include "envmap.h"
|
||||
#include "initrender.h"
|
||||
#include "shadbuf.h"
|
||||
#include "pixelblending.h"
|
||||
|
||||
@@ -780,7 +780,10 @@ static void traceray(ShadeInput *origshi, ShadeResult *origshr, short depth, con
|
||||
tracol[3]= col[3]; // we pass on and accumulate alpha
|
||||
|
||||
if((shi.mat->mode & MA_TRANSP) && (shi.mat->mode & MA_RAYTRANSP)) {
|
||||
if(traflag & RAY_INSIDE) {
|
||||
/* don't overwrite traflag, it's value is used in mirror reflection */
|
||||
int new_traflag = traflag;
|
||||
|
||||
if(new_traflag & RAY_INSIDE) {
|
||||
/* inside the material, so use inverse normal */
|
||||
float norm[3];
|
||||
norm[0]= - shi.vn[0];
|
||||
@@ -789,7 +792,7 @@ static void traceray(ShadeInput *origshi, ShadeResult *origshr, short depth, con
|
||||
|
||||
if (refraction(refract, norm, shi.view, shi.ang)) {
|
||||
/* ray comes out from the material into air */
|
||||
traflag &= ~RAY_INSIDE;
|
||||
new_traflag &= ~RAY_INSIDE;
|
||||
}
|
||||
else {
|
||||
/* total internal reflection (ray stays inside the material) */
|
||||
@@ -799,14 +802,14 @@ static void traceray(ShadeInput *origshi, ShadeResult *origshr, short depth, con
|
||||
else {
|
||||
if (refraction(refract, shi.vn, shi.view, shi.ang)) {
|
||||
/* ray goes in to the material from air */
|
||||
traflag |= RAY_INSIDE;
|
||||
new_traflag |= RAY_INSIDE;
|
||||
}
|
||||
else {
|
||||
/* total external reflection (ray doesn't enter the material) */
|
||||
reflection(refract, shi.vn, shi.view, shi.vn);
|
||||
}
|
||||
}
|
||||
traceray(origshi, origshr, depth-1, shi.co, refract, tracol, shi.obi, shi.vlr, traflag);
|
||||
traceray(origshi, origshr, depth-1, shi.co, refract, tracol, shi.obi, shi.vlr, new_traflag);
|
||||
}
|
||||
else
|
||||
traceray(origshi, origshr, depth-1, shi.co, shi.view, tracol, shi.obi, shi.vlr, 0);
|
||||
@@ -840,7 +843,7 @@ static void traceray(ShadeInput *origshi, ShadeResult *origshr, short depth, con
|
||||
float ref[3];
|
||||
|
||||
reflection_simple(ref, shi.vn, shi.view);
|
||||
traceray(origshi, origshr, depth-1, shi.co, ref, mircol, shi.obi, shi.vlr, 0);
|
||||
traceray(origshi, origshr, depth-1, shi.co, ref, mircol, shi.obi, shi.vlr, traflag);
|
||||
|
||||
f1= 1.0f-f;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user