Skip to content

Commit

Permalink
Added the reflection depth and subdivs parameters to the standalone p…
Browse files Browse the repository at this point in the history
…lugin too.
  • Loading branch information
vkoylazov committed Oct 10, 2016
1 parent 1e9386e commit f6a7e98
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions std_plugin/vray_brdfalsurface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ struct BRDFAlSurface: SimpleBSDF<MyBaseBSDF> {
TextureFloatInterface *sssWeight[3];
TextureInterface *sssColor[3];
TextureFloatInterface *sssRadius[3];

int reflectMaxDepth;
int reflectSubdivs;
int sssSubdivs;
};

#define BRDFAlSurface_PluginID PluginID(LARGE_CONST(2016082656))
Expand Down Expand Up @@ -93,6 +97,10 @@ BRDFAlSurface_Params::BRDFAlSurface_Params(void) {
addParamTextureFloat("sss3_weight", defaultSSSWeight3, -1, "Weight of the third SSS component", "minValue=(0), maxValue=(10), softMinValue=(0), softMaxValue=(1)");
addParamTexture("sss3_color", defaultSSSColor3, -1, "Color of the third SSS component");
addParamTextureFloat("sss3_radius", defaultSSSRadius3, -1, "Radius for the third SSS component. Larger values cause light to go deeper into the surface");

addParamInt("reflect_max_depth", defaultReflectMaxDepth, -1, "Maximum depth for reflections; set to -1 to use the global depth");
addParamInt("reflect_subdivs", defaultReflectSubdivs, -1, "Subdivs for sampling reflections when local subdivs are enabled");
addParamInt("sss_subdivs", defaultSSSSubdivs, -1, "Subdivs for sampling SSS when local subdivs are enabled");
}

BRDFAlSurface::BRDFAlSurface(VRayPluginDesc *pluginDesc):SimpleBSDF<MyBaseBSDF>(pluginDesc) {
Expand Down Expand Up @@ -141,6 +149,10 @@ BRDFAlSurface::BRDFAlSurface(VRayPluginDesc *pluginDesc):SimpleBSDF<MyBaseBSDF>(
paramList->setParamCache("sss3_color", &sssColor[2]);
paramList->setParamCache("sss3_radius", &sssRadius[2]);

paramList->setParamCache("reflect_max_depth", &reflectMaxDepth);
paramList->setParamCache("reflect_subdivs", &reflectSubdivs);
paramList->setParamCache("sss_subdivs", &sssSubdivs);

// We only have a bump texture, and it is multiplied by the bumpMult, so set the
// bumpMult to 1.0 here.
bumpParams.bumpMult=1.0f;
Expand Down Expand Up @@ -284,9 +296,9 @@ void BRDFAlSurface::initBSDF(const VRayContext &rc, MyBaseBSDF *bsdf, VR::BSDFFl

params.renderChannels=NULL;

params.reflectMaxDepth=defaultReflectMaxDepth;
params.reflectSubdivs=defaultReflectSubdivs;
params.sssSubdivs=defaultSSSSubdivs;
params.reflectMaxDepth=reflectMaxDepth;
params.reflectSubdivs=reflectSubdivs;
params.sssSubdivs=sssSubdivs;

params.normalizeWeights();

Expand Down

0 comments on commit f6a7e98

Please sign in to comment.