no sun glare in the reflection

actorid
scrawl 13 years ago
parent 393530e671
commit ec3fe1ef00

@ -47,6 +47,9 @@ enum VisibilityFlags
RV_Sky = 64, RV_Sky = 64,
// Sun glare (not visible in reflection)
RV_Glare = 128,
RV_Map = RV_Terrain + RV_Statics + RV_StaticsSmall + RV_Misc + RV_Water, RV_Map = RV_Terrain + RV_Statics + RV_StaticsSmall + RV_Misc + RV_Water,
/// \todo markers (normally hidden) /// \todo markers (normally hidden)

@ -60,6 +60,11 @@ Vector3 BillboardObject::getPosition() const
return Vector3(p.x, -p.z, p.y); return Vector3(p.x, -p.z, p.y);
} }
void BillboardObject::setVisibilityFlags(int flags)
{
mBBSet->setVisibilityFlags(flags);
}
void BillboardObject::setColour(const ColourValue& pColour) void BillboardObject::setColour(const ColourValue& pColour)
{ {
mMaterial->getTechnique(0)->getPass(0)->setSelfIllumination(pColour); mMaterial->getTechnique(0)->getPass(0)->setSelfIllumination(pColour);
@ -421,6 +426,7 @@ void SkyManager::create()
mSun->setRenderQueue(RQG_SkiesEarly+4); mSun->setRenderQueue(RQG_SkiesEarly+4);
mSunGlare = new BillboardObject("textures\\tx_sun_flash_grey_05.dds", 3, Vector3(0.4, 0.4, 0.4), mRootNode); mSunGlare = new BillboardObject("textures\\tx_sun_flash_grey_05.dds", 3, Vector3(0.4, 0.4, 0.4), mRootNode);
mSunGlare->setRenderQueue(RQG_SkiesLate); mSunGlare->setRenderQueue(RQG_SkiesLate);
mSunGlare->setVisibilityFlags(RV_Glare);
HighLevelGpuProgramManager& mgr = HighLevelGpuProgramManager::getSingleton(); HighLevelGpuProgramManager& mgr = HighLevelGpuProgramManager::getSingleton();

@ -36,24 +36,25 @@ namespace MWRender
BillboardObject(); BillboardObject();
virtual ~BillboardObject() {} virtual ~BillboardObject() {}
void setColour(const Ogre::ColourValue& pColour); void setColour(const Ogre::ColourValue& pColour);
void setPosition(const Ogre::Vector3& pPosition); void setPosition(const Ogre::Vector3& pPosition);
void setVisible(const bool visible); void setVisible(const bool visible);
void setRenderQueue(unsigned int id); void setRenderQueue(unsigned int id);
void setVisibilityFlags(int flags);
void setSize(const float size); void setSize(const float size);
Ogre::Vector3 getPosition() const; Ogre::Vector3 getPosition() const;
void setVisibility(const float visibility); void setVisibility(const float visibility);
Ogre::SceneNode* getNode(); Ogre::SceneNode* getNode();
protected: protected:
virtual void init(const Ogre::String& textureName, virtual void init(const Ogre::String& textureName,
const float size, const float size,
const Ogre::Vector3& position, const Ogre::Vector3& position,
Ogre::SceneNode* rootNode); Ogre::SceneNode* rootNode);
Ogre::SceneNode* mNode; Ogre::SceneNode* mNode;
Ogre::MaterialPtr mMaterial; Ogre::MaterialPtr mMaterial;
Ogre::BillboardSet* mBBSet; Ogre::BillboardSet* mBBSet;
@ -71,9 +72,9 @@ namespace MWRender
const Ogre::Vector3& position, const Ogre::Vector3& position,
Ogre::SceneNode* rootNode Ogre::SceneNode* rootNode
); );
virtual ~Moon() {} virtual ~Moon() {}
enum Phase enum Phase
{ {
Phase_New = 0, Phase_New = 0,
@ -85,20 +86,20 @@ namespace MWRender
Phase_WaningHalf, Phase_WaningHalf,
Phase_WaningCrescent Phase_WaningCrescent
}; };
enum Type enum Type
{ {
Type_Masser = 0, Type_Masser = 0,
Type_Secunda Type_Secunda
}; };
void setPhase(const Phase& phase); void setPhase(const Phase& phase);
void setType(const Type& type); void setType(const Type& type);
void setSkyColour(const Ogre::ColourValue& colour); void setSkyColour(const Ogre::ColourValue& colour);
Phase getPhase() const; Phase getPhase() const;
unsigned int getPhaseInt() const; unsigned int getPhaseInt() const;
private: private:
Type mType; Type mType;
Phase mPhase; Phase mPhase;

@ -139,14 +139,13 @@ Vector3 Water::getSceneNodeCoordinates(int gridX, int gridY)
void Water::preRenderTargetUpdate(const RenderTargetEvent& evt) void Water::preRenderTargetUpdate(const RenderTargetEvent& evt)
{ {
mWater->setVisible(false);
//mOldCameraFarClip = mCamera->getFarClipDistance(); //mOldCameraFarClip = mCamera->getFarClipDistance();
//if (mReflectDistance != 0) //if (mReflectDistance != 0)
// mCamera->setFarClipDistance(mReflectDistance); // mCamera->setFarClipDistance(mReflectDistance);
if (evt.source == mReflectionTarget) if (evt.source == mReflectionTarget)
{ {
mWater->setVisible(false);
Vector3 pos = mCamera->getRealPosition(); Vector3 pos = mCamera->getRealPosition();
pos.y = mTop*2 - pos.y; pos.y = mTop*2 - pos.y;
mSky->setSkyPosition(pos); mSky->setSkyPosition(pos);

Loading…
Cancel
Save