some fixes

actorid
scrawl 13 years ago
parent 41791ccaa2
commit acc5c3bbbf

@ -57,6 +57,8 @@ BillboardObject::BillboardObject( const String& textureName,
mMaterial = sh::Factory::getInstance().createMaterialInstance ("BillboardMaterial"+StringConverter::toString(bodyCount), material); mMaterial = sh::Factory::getInstance().createMaterialInstance ("BillboardMaterial"+StringConverter::toString(bodyCount), material);
mMaterial->setProperty("texture", sh::makeProperty<sh::StringValue>(new sh::StringValue(textureName))); mMaterial->setProperty("texture", sh::makeProperty<sh::StringValue>(new sh::StringValue(textureName)));
sh::Factory::getInstance().getMaterialInstance ("BillboardMaterial"+StringConverter::toString(bodyCount))->setListener(this);
mBBSet->setMaterialName("BillboardMaterial"+StringConverter::toString(bodyCount)); mBBSet->setMaterialName("BillboardMaterial"+StringConverter::toString(bodyCount));
bodyCount++; bodyCount++;
@ -66,6 +68,16 @@ BillboardObject::BillboardObject()
{ {
} }
void BillboardObject::requestedConfiguration (sh::MaterialInstance* m, const std::string& configuration)
{
}
void BillboardObject::createdConfiguration (sh::MaterialInstance* m, const std::string& configuration)
{
setVisibility(mVisibility);
setColour(mColour);
}
void BillboardObject::setVisible(const bool visible) void BillboardObject::setVisible(const bool visible)
{ {
mBBSet->setVisible(visible); mBBSet->setVisible(visible);
@ -78,6 +90,7 @@ void BillboardObject::setSize(const float size)
void BillboardObject::setVisibility(const float visibility) void BillboardObject::setVisibility(const float visibility)
{ {
mVisibility = visibility;
Ogre::MaterialPtr m = static_cast<sh::OgreMaterial*>(mMaterial->getMaterial ())->getOgreMaterial (); Ogre::MaterialPtr m = static_cast<sh::OgreMaterial*>(mMaterial->getMaterial ())->getOgreMaterial ();
for (int i=0; i<m->getNumTechniques(); ++i) for (int i=0; i<m->getNumTechniques(); ++i)
{ {
@ -110,6 +123,7 @@ void BillboardObject::setVisibilityFlags(int flags)
void BillboardObject::setColour(const ColourValue& pColour) void BillboardObject::setColour(const ColourValue& pColour)
{ {
mColour = pColour;
Ogre::MaterialPtr m = static_cast<sh::OgreMaterial*>(mMaterial->getMaterial ())->getOgreMaterial (); Ogre::MaterialPtr m = static_cast<sh::OgreMaterial*>(mMaterial->getMaterial ())->getOgreMaterial ();
for (int i=0; i<m->getNumTechniques(); ++i) for (int i=0; i<m->getNumTechniques(); ++i)
{ {
@ -117,7 +131,6 @@ void BillboardObject::setColour(const ColourValue& pColour)
if (t->getNumPasses ()) if (t->getNumPasses ())
t->getPass(0)->setSelfIllumination (pColour); t->getPass(0)->setSelfIllumination (pColour);
} }
//mMaterial->getTechnique(0)->getPass(0)->setSelfIllumination(pColour);
} }
void BillboardObject::setRenderQueue(unsigned int id) void BillboardObject::setRenderQueue(unsigned int id)

@ -27,7 +27,7 @@ namespace Ogre
namespace MWRender namespace MWRender
{ {
class BillboardObject class BillboardObject : public sh::MaterialInstanceListener
{ {
public: public:
BillboardObject( const Ogre::String& textureName, BillboardObject( const Ogre::String& textureName,
@ -38,6 +38,9 @@ namespace MWRender
); );
BillboardObject(); BillboardObject();
void requestedConfiguration (sh::MaterialInstance* m, const std::string& configuration);
void createdConfiguration (sh::MaterialInstance* m, const std::string& configuration);
virtual ~BillboardObject() {} virtual ~BillboardObject() {}
void setColour(const Ogre::ColourValue& pColour); void setColour(const Ogre::ColourValue& pColour);
@ -53,7 +56,8 @@ namespace MWRender
Ogre::SceneNode* getNode(); Ogre::SceneNode* getNode();
protected: protected:
float mVisibility;
Ogre::ColourValue mColour;
Ogre::SceneNode* mNode; Ogre::SceneNode* mNode;
sh::MaterialInstance* mMaterial; sh::MaterialInstance* mMaterial;
Ogre::BillboardSet* mBBSet; Ogre::BillboardSet* mBBSet;

@ -181,7 +181,6 @@ namespace MWWorld
playerphysics->ps.viewangles.y = yawQuat.getYaw().valueDegrees() *-1 + 90; playerphysics->ps.viewangles.y = yawQuat.getYaw().valueDegrees() *-1 + 90;
Ogre::Quaternion quat = yawNode->getOrientation();
Ogre::Vector3 dir1(iter->second.x,iter->second.z,-iter->second.y); Ogre::Vector3 dir1(iter->second.x,iter->second.z,-iter->second.y);
pm_ref.rightmove = -iter->second.x; pm_ref.rightmove = -iter->second.x;

@ -29,8 +29,6 @@
{ {
shOutputColour(0) = colourPassthrough * atmosphereColour; shOutputColour(0) = colourPassthrough * atmosphereColour;
shOutputColour(0) = float3(0,0,0,1);
#if MRT #if MRT
shOutputColour(1) = float4(1,1,1,1); shOutputColour(1) = float4(1,1,1,1);
#endif #endif

@ -43,7 +43,7 @@
float4 albedo = shSample(diffuseMap1, scrolledUV) * (1-cloudBlendFactor) + shSample(diffuseMap2, scrolledUV) * cloudBlendFactor; float4 albedo = shSample(diffuseMap1, scrolledUV) * (1-cloudBlendFactor) + shSample(diffuseMap2, scrolledUV) * cloudBlendFactor;
shOutputColour(0) = colourPassthrough * float4(cloudColour, 1) * albedo * float4(1,1,1, cloudOpacity); shOutputColour(0) = colourPassthrough * float4(cloudColour, 1) * albedo * float4(1,1,1, cloudOpacity);
shOutputColour(0) = float3(0,0,0,1);
#if MRT #if MRT
shOutputColour(1) = float4(1,1,1,1); shOutputColour(1) = float4(1,1,1,1);
#endif #endif

Loading…
Cancel
Save