aboutsummaryrefslogtreecommitdiff
path: root/vrayPlug/plugin/shaveVrayBaseBSDF.h
diff options
context:
space:
mode:
authorBen Marsh <[email protected]>2019-10-22 09:07:59 -0400
committerBen Marsh <[email protected]>2019-10-22 09:07:59 -0400
commitbd0027e737c6512397f841c22786274ed74b927f (patch)
treef7ffbdb8f3741bb7f24635616cc189cba5cb865c /vrayPlug/plugin/shaveVrayBaseBSDF.h
downloadshave-and-a-haircut-bd0027e737c6512397f841c22786274ed74b927f.tar.xz
shave-and-a-haircut-bd0027e737c6512397f841c22786274ed74b927f.zip
Adding Shave-and-a-Haircut 9.6
Diffstat (limited to 'vrayPlug/plugin/shaveVrayBaseBSDF.h')
-rw-r--r--vrayPlug/plugin/shaveVrayBaseBSDF.h137
1 files changed, 137 insertions, 0 deletions
diff --git a/vrayPlug/plugin/shaveVrayBaseBSDF.h b/vrayPlug/plugin/shaveVrayBaseBSDF.h
new file mode 100644
index 0000000..4216b8d
--- /dev/null
+++ b/vrayPlug/plugin/shaveVrayBaseBSDF.h
@@ -0,0 +1,137 @@
+#ifndef _HAIR_VR_BASE_BSDF_H_
+#define _HAIR_VR_BASE_BSDF_H_
+
+// Shave and a Haircut
+// (c) 2019 Epic Games
+// US Patent 6720962
+
+/**********************************************************************
+ *<
+ FILE: shaveVrayBaseBSDF.h ( was HairVrBaseBSDF.h )
+
+ DESCRIPTION: Generic class for BSDFs
+
+ CREATED BY: Vladimir Dubovoy <[email protected]>
+
+ HISTORY: created 09-09-2008 ( as part of 3ds Max + VRay hair shaders)
+ merged 31-03-2010
+
+ *>
+ **********************************************************************/
+
+//#include <max.h> //ShadeContext
+//#include <vraybase.h>
+//#include <vectorbase.h>
+//#include <vrayinterface.h>
+//#include <vrayplugins.h>
+//#include <vraygeom.h>
+
+#include "utils.h"
+#include "vrayplugins.h"
+#include "brdfs.h"
+
+#include "hairAPIvray.h"
+#include "vray3_compat.h"
+
+class shaveVrayBaseBSDF : public IShaveVrayBSDF
+ //public VR::BRDFSampler,
+ //public VR::BSDFSampler
+{
+public:
+ // Initialization
+ void init(const VR::VRayContext &rc,
+ const VR::Color &reflectionColor,
+ const VR::Color &diffuseColor,
+ const VR::Color &ambientColor,
+ const VR::Color &specularTint,
+ const VR::Color &specularTint2,
+ float ambDiff,
+ float specularLevel,
+ float reflectionGlossiness,
+ int subdivs, const VR::Color &transp,
+ const VR::ShadeVec &hairDir,
+ float requiredTransparency,
+ bool cameraVisibility,
+ bool reflVisibility,
+ bool refrVisibility,
+ bool lightVisibility,
+ bool giVisibility,
+ float selfshadow,
+ bool recvshadow) VRAY_OVERRIDE;
+
+ // From BRDFSampler
+ VR::ShadeCol getDiffuseColor(VR::ShadeCol &lightColor) VRAY_OVERRIDE;
+ VR::ShadeCol getLightMult (VR::ShadeCol &lightColor) VRAY_OVERRIDE;
+ VR::ShadeCol getTransparency(const VR::VRayContext &rc) VRAY_OVERRIDE;
+
+ VR::ShadeCol eval(const VR::VRayContext &rc, const VR::ShadeVec &direction,
+ VR::ShadeCol &lightColor, VR::ShadeCol &origLightColor, float probLight, int flags) VRAY_OVERRIDE;
+
+ void traceForward(VR::VRayContext &rc, int doDiffuse) VRAY_OVERRIDE;
+
+ VR::RenderChannelsInfo* getRenderChannels() VRAY_OVERRIDE;
+
+ // From BSDFSampler
+ VR::BRDFSampler *getBRDF(VR::BSDFSide side) VRAY_OVERRIDE;
+protected:
+
+ //const member access
+ inline const VR::ShadeCol& reflect_filter() const {return m_reflect_filter;}
+ inline const VR::ShadeCol& transparency() const {return m_transparency;}
+ inline const VR::ShadeCol& diffuse() const {return m_diffuse;}
+ inline const VR::ShadeCol& ambient() const {return m_ambient;}
+ inline const VR::ShadeCol& spec_tint() const {return m_spec_tint;}
+ inline const VR::ShadeCol& spec_tint2() const {return m_spec_tint2;}
+ inline const VR::ShadeVec& normal() const {return m_normal; }
+ inline const VR::ShadeVec& gnormal() const {return m_gnormal;}
+ inline VR::real glossiness() const {return m_glossiness;}
+ inline bool combineSampling() const {return m_combineSampling;}
+ inline float ambdiff() const {return m_ambdiff;}
+ inline float speclvl() const {return m_speclvl;}
+ inline bool cameraVisibility() const {return m_cameraVisibility;}
+ inline bool lightVisibility() const {return m_lightVisibility;}
+ inline bool giVisibility() const {return m_giVisibility;}
+
+ //member access
+ inline VR::ShadeCol& _reflect_filter() {return m_reflect_filter;}
+ inline VR::ShadeCol& _transparency() {return m_transparency;}
+ inline VR::ShadeCol& _diffuse() {return m_diffuse;}
+ inline VR::ShadeCol& _ambient() {return m_ambient;}
+ inline VR::ShadeCol& _spec_tint() {return m_spec_tint;}
+ inline VR::ShadeCol& _spec_tint2() {return m_spec_tint2;}
+ inline VR::ShadeVec& _normal() {return m_normal; }
+ inline VR::ShadeVec& _gnormal() {return m_gnormal;}
+ inline VR::real& _glossiness() {return m_glossiness;}
+ inline bool& _combineSampling() {return m_combineSampling;}
+ inline float& _ambdiff() {return m_ambdiff;}
+ inline float& _speclvl() {return m_speclvl;}
+ inline bool& _cameraVisibility() {return m_cameraVisibility;}
+ inline bool& _lightVisibility() {return m_lightVisibility;}
+ inline bool& _giVisibility() {return m_giVisibility;}
+
+private:
+ VR::ShadeCol m_reflect_filter;
+ VR::ShadeCol m_transparency;
+ VR::ShadeCol m_diffuse;
+ VR::ShadeCol m_ambient;
+ VR::ShadeCol m_spec_tint;
+ VR::ShadeCol m_spec_tint2;
+ VR::real m_glossiness;
+ float m_ambdiff;
+ float m_speclvl;
+ bool m_combineSampling;
+ bool m_cameraVisibility;
+ bool m_lightVisibility;
+ bool m_giVisibility;
+
+ VR::ShadeVec m_normal;
+ VR::ShadeVec m_gnormal;
+
+ VR::ShadeVec hairDir;
+ float currentTransp;
+ float requiredTransparency;
+ bool isGatherPoint;
+};
+
+#endif //endof_HAIR_VR_BASE_BSDF_H_
+