Cycles OSL: refactoring to remove all dependencies on builtin OSL closures.

These were removed in new OSL versions. We only used these as base classes,
not using them at all simplifies the code a bit.
This commit is contained in:
Brecht Van Lommel
2013-11-29 02:09:24 +01:00
parent aa3933b411
commit 746628e0d0
12 changed files with 80 additions and 202 deletions

View File

@@ -51,24 +51,11 @@ using namespace OSL;
class CubicBSSRDFClosure : public CBSSRDFClosure {
public:
size_t memsize() const { return sizeof(*this); }
const char *name() const { return "bssrdf_cubic"; }
void setup()
CubicBSSRDFClosure()
{
sc.type = CLOSURE_BSSRDF_CUBIC_ID;
sc.data0 = fabsf(average(radius));
}
bool mergeable(const ClosurePrimitive *other) const
{
return false;
}
void print_on(std::ostream &out) const
{
out << name() << " ((" << sc.N[0] << ", " << sc.N[1] << ", " << sc.N[2] << "))";
}
};
ClosureParam *closure_bssrdf_cubic_params()
@@ -96,30 +83,17 @@ ClosureParam *closure_bssrdf_cubic_extended_params()
return params;
}
CLOSURE_PREPARE(closure_bssrdf_cubic_prepare, CubicBSSRDFClosure)
CCLOSURE_PREPARE(closure_bssrdf_cubic_prepare, CubicBSSRDFClosure)
/* Gaussian */
class GaussianBSSRDFClosure : public CBSSRDFClosure {
public:
size_t memsize() const { return sizeof(*this); }
const char *name() const { return "bssrdf_gaussian"; }
void setup()
GaussianBSSRDFClosure()
{
sc.type = CLOSURE_BSSRDF_GAUSSIAN_ID;
sc.data0 = fabsf(average(radius));
}
bool mergeable(const ClosurePrimitive *other) const
{
return false;
}
void print_on(std::ostream &out) const
{
out << name() << " ((" << sc.N[0] << ", " << sc.N[1] << ", " << sc.N[2] << "))";
}
};
ClosureParam *closure_bssrdf_gaussian_params()
@@ -146,7 +120,7 @@ ClosureParam *closure_bssrdf_gaussian_extended_params()
return params;
}
CLOSURE_PREPARE(closure_bssrdf_gaussian_prepare, GaussianBSSRDFClosure)
CCLOSURE_PREPARE(closure_bssrdf_gaussian_prepare, GaussianBSSRDFClosure)
CCL_NAMESPACE_END