aboutsummaryrefslogtreecommitdiff
path: root/vrayPlug/plugin/hairAPIvray.h
blob: aeed420f7cf55c4e9650584e4f131a2d95e9eec1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
#ifndef _HAIR_API_VRAY_H_
#define _HAIR_API_VRAY_H_

// Shave and a Haircut
// (c) 2019 Epic Games
// US Patent 6720962

#include "utils.h"
#include "box.h"
#include "rayserver.h"
#include "vrayplugins.h"
#include "rayserver.h"
#include "geometryclasses.h"
#include "brdfs.h"
#include "brdfpool.h"
#include "vray3_compat.h"

// The following ifdef block is the standard way of creating macros which make exporting 
// from a DLL simpler. All files within this DLL are compiled with the SHAVEVRAYSH_EXPORTS
// symbol defined on the command line. this symbol should not be defined on any project
// that uses this DLL. This way any other project whose source files include this file see 
// SHAVEVRAYSH_API functions as being imported from a DLL, whereas this DLL sees symbols
// defined with this macro as being exported.
#ifdef WIN32
#ifdef SHAVEVRAYSH_EXPORTS
#define SHAVEVRAYSH_API __declspec(dllexport)
#else
#define SHAVEVRAYSH_API __declspec(dllimport)
#endif
#else
#define SHAVEVRAYSH_API
#endif

// Define APIENTRY per platform
#ifndef APIENTRY
# define APIENTRY
#endif

class IShaveVrayBSDF : public VR::BRDFSampler, 
					   public VR::BSDFSampler{
public:
	// Initialization
	virtual 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 selfShadowing,
			  bool  recvShadow) = 0;
};

class IShaveBSDFPool {
public:
	virtual void init(VR::VRayCore *vray) = 0;
	virtual void freeMem() = 0;

	virtual IShaveVrayBSDF* newBRDF(const VR::VRayContext &rc) = 0;
	virtual void deleteBRDF(const VR::VRayContext &rc, IShaveVrayBSDF* bsdf) = 0;
};

#ifdef LINUX
#ifdef __cplusplus
extern "C" {
#endif
#endif
typedef IShaveBSDFPool* (APIENTRY * PFNCREATEBSDFPOOL)();
#ifdef LINUX
#ifdef __cplusplus
}
#endif
#endif

#endif //end of _HAIR_API_VRAY_H_