Implemented rim_light and rim_power shader parameters, enabling outlining of objects on a per-model basis.

Will need to later refactor to allow for a more scalable means of adding per-model shader attributes.

--HG--
branch : nfb
This commit is contained in:
2013-12-05 01:09:31 -08:00
parent c7948ea314
commit 79abdd98d0
26 changed files with 156 additions and 50 deletions

View File

@@ -51,7 +51,7 @@
class KRModel : public KRNode {
public:
KRModel(KRScene &scene, std::string instance_name, std::string model_name, std::string light_map, float lod_min_coverage, bool receives_shadow, bool faces_camera);
KRModel(KRScene &scene, std::string instance_name, std::string model_name, std::string light_map, float lod_min_coverage, bool receives_shadow, bool faces_camera, KRVector3 rim_color = KRVector3::Zero(), float rim_power = 0.0f);
virtual ~KRModel();
virtual std::string getElementName();
@@ -61,6 +61,11 @@ public:
virtual KRAABB getBounds();
void setRimColor(const const KRVector3 &rim_color);
void setRimPower(float rim_power);
KRVector3 getRimColor();
float getRimPower();
private:
std::vector<KRMesh *> m_models;
unordered_map<KRMesh *, std::vector<KRBone *> > m_bones; // Outer std::map connects model to set of bones
@@ -78,6 +83,10 @@ private:
KRMat4 m_boundsCachedMat;
KRAABB m_boundsCached;
KRVector3 m_rim_color;
float m_rim_power;
};