Last active
August 29, 2015 14:26
-
-
Save linniksergey/19abfd5a94881a6fb0ff to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "math.h" | |
void myDiffuse(vector color, nN, diffuseNoShadowPass, diffusePass, shadowPass; string categories, lightmask) | |
{ | |
diffuseNoShadowPass = {0, 0, 0}; | |
diffusePass = {0, 0, 0}; | |
shadowPass = {0, 0, 0}; | |
illuminance(P, nN, M_PI/2, bouncemask("diffuse"), "categories", categories, "lightmask", lightmask) | |
{ | |
vector _diffuseNoShadowPass = Cl * color * dot(nN, normalize(L)); | |
vector _diffusePass = shadow(_diffuseNoShadowPass); | |
vector _shadowPass = _diffuseNoShadowPass - _diffusePass; | |
storelightexport(getlightname(), "diffusePass", _diffusePass); | |
storelightexport(getlightname(), "diffuseNoShadowPass", _diffuseNoShadowPass); | |
storelightexport(getlightname(), "shadowPass", _shadowPass); | |
diffuseNoShadowPass += _diffuseNoShadowPass; | |
//diffusePass += shadow(diffuseNoShadowPass); | |
diffusePass += _diffusePass; | |
shadowPass += _shadowPass; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment