[SOLVED] cvex_bsdf doesn't work for me

   3841   3   1
User Avatar
Member
176 posts
Joined: May 2006
Offline
I'm trying create henyeygreenstein phase bsdf using cvex_bsdf() without any luck…
henyeygreenstein_eval and henyeygreenstein_sample functions avialable in houdini/vex/CVex directory in both compiled and vfl form, they already imported as shoptypes in standard houdini/otls/OPlibShopVMantra.otl
but this construction in surface shader:
$f = cvex_bsdf(“henyeygreenstein_eval”, “henyeygreenstein_sample”, “label”, “”, “phase”, 0.5);
doesn't work. No errors, just rendering black image.

If i change it to this (which i dont know where coming from):
$f = henyeygreenstein(0.5,“label”,“”);
Everything works as expected.

Please provide any working example of cvex_bsdf usage!
Edited by - May 4, 2014 15:37:38
User Avatar
Member
4262 posts
Joined: July 2005
Offline
You need to provide a label, it can't be blank otherwise it won't run.

$f = cvex_bsdf(“henyeygreenstein_eval”, “henyeygreenstein_sample”,
“label”, “volume”, “phase”, 0.5);

For example here is one of the ones we use in production-
$f = cvex_bsdf(
“ggx_eval”,
“ggx_sample”,
“label”, “reflect”,
“ng”, $tnN,
“alpha”, $alpha);


There is a builtin heneygreenstein which is why the second example you provided works.
if(coffees<2,round(float),float)
User Avatar
Member
176 posts
Joined: May 2006
Offline
Thanks a lot, it works now!
User Avatar
Member
4262 posts
Joined: July 2005
Offline
If you want to do custom component labels you'll need to do the following-

cvex ggx_eval (
// required
vector u = 0;
vector v = 0;
int bounces = 0;
export vector eval = 0;
export vector refl = 0.5;
export float pdf = 0;
// args
int bouncemasklabels = 0;
vector ng = 0;
float alpha = 0.1;
) {

if (bounces & bouncemasklabels) {
….
}
}


surface blah(…, string label = “reflect”) {

f = cvex_bsdf(
“ggx_eval”,
“ggx_sample”,
“label”, label,
“bouncemasklabels”, bouncemask(label),
“ng”, tnN,
“alpha”, alpha);


That way if you need to have extra component labels in addition to coat, diffuse, reflect etc your cvex shader will support it.
if(coffees<2,round(float),float)
  • Quick Links