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->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));
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)
{
mBBSet->setVisible(visible);
@ -78,6 +90,7 @@ void BillboardObject::setSize(const float size)
void BillboardObject::setVisibility(const float visibility)
{
mVisibility = visibility;
Ogre::MaterialPtr m = static_cast<sh::OgreMaterial*>(mMaterial->getMaterial ())->getOgreMaterial ();
for (int i=0; i<m->getNumTechniques(); ++i)
{
@ -110,6 +123,7 @@ void BillboardObject::setVisibilityFlags(int flags)
void BillboardObject::setColour(const ColourValue& pColour)
{
mColour = pColour;
Ogre::MaterialPtr m = static_cast<sh::OgreMaterial*>(mMaterial->getMaterial ())->getOgreMaterial ();
for (int i=0; i<m->getNumTechniques(); ++i)
{
@ -117,7 +131,6 @@ void BillboardObject::setColour(const ColourValue& pColour)
if (t->getNumPasses ())
t->getPass(0)->setSelfIllumination (pColour);
}
//mMaterial->getTechnique(0)->getPass(0)->setSelfIllumination(pColour);
}
void BillboardObject::setRenderQueue(unsigned int id)

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

@ -181,16 +181,15 @@ namespace MWWorld
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.forwardmove = -iter->second.y;
pm_ref.upmove = iter->second.z;
pm_ref.rightmove = -iter->second.x;
pm_ref.forwardmove = -iter->second.y;
pm_ref.upmove = iter->second.z;
}
}

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

@ -43,7 +43,7 @@
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) = float3(0,0,0,1);
#if MRT
shOutputColour(1) = float4(1,1,1,1);
#endif

Loading…
Cancel
Save