|
|
@@ -8,10 +8,10 @@
|
|
|
#include "RsrcPtr.h"
|
|
|
#include "ModelPatch.h"
|
|
|
#include "RenderableNode.h"
|
|
|
+#include "MaterialRuntime.h"
|
|
|
|
|
|
|
|
|
class Material;
|
|
|
-class MaterialRuntime;
|
|
|
|
|
|
|
|
|
/// Inherited by ModelPatchNode and SkinPatchNode. It contains common code, the derived classes are responsible to
|
|
|
@@ -19,6 +19,14 @@ class MaterialRuntime;
|
|
|
class PatchNode: public RenderableNode
|
|
|
{
|
|
|
public:
|
|
|
+ /// Passed as parameter in setUserDefVar
|
|
|
+ enum MaterialType
|
|
|
+ {
|
|
|
+ MT_COLOR_PASS,
|
|
|
+ MT_DEPTH_PASS,
|
|
|
+ MT_BOTH
|
|
|
+ };
|
|
|
+
|
|
|
PatchNode(const ModelPatch& modelPatch, SceneNode* parent);
|
|
|
|
|
|
/// Do nothing
|
|
|
@@ -38,6 +46,10 @@ class PatchNode: public RenderableNode
|
|
|
const Vao& getCpVao() const {return cpVao;}
|
|
|
const Vao& getDpVao() const {return dpVao;}
|
|
|
uint getVertIdsNum() const {return rsrc.getMesh().getVertIdsNum();}
|
|
|
+
|
|
|
+ /// @todo
|
|
|
+ template<typename Type>
|
|
|
+ void setUserDefVar(MaterialType mt, const char* name, const Type& value);
|
|
|
/// @}
|
|
|
|
|
|
protected:
|
|
|
@@ -52,4 +64,19 @@ class PatchNode: public RenderableNode
|
|
|
};
|
|
|
|
|
|
|
|
|
+template<typename Type>
|
|
|
+void PatchNode::setUserDefVar(MaterialType mt, const char* name, const Type& value)
|
|
|
+{
|
|
|
+ if(mt == MT_COLOR_PASS || mt == MT_BOTH)
|
|
|
+ {
|
|
|
+ cpMtlRun->setUserDefVar(name, value);
|
|
|
+ }
|
|
|
+
|
|
|
+ if(mt == MT_DEPTH_PASS || mt == MT_BOTH)
|
|
|
+ {
|
|
|
+ dpMtlRun->setUserDefVar(name, value);
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
#endif
|