forked from mirror/openmw-tes3mp
no sun glare in the reflection
This commit is contained in:
parent
393530e671
commit
ec3fe1ef00
4 changed files with 22 additions and 13 deletions
|
@ -47,6 +47,9 @@ enum VisibilityFlags
|
|||
|
||||
RV_Sky = 64,
|
||||
|
||||
// Sun glare (not visible in reflection)
|
||||
RV_Glare = 128,
|
||||
|
||||
RV_Map = RV_Terrain + RV_Statics + RV_StaticsSmall + RV_Misc + RV_Water,
|
||||
|
||||
/// \todo markers (normally hidden)
|
||||
|
|
|
@ -60,6 +60,11 @@ Vector3 BillboardObject::getPosition() const
|
|||
return Vector3(p.x, -p.z, p.y);
|
||||
}
|
||||
|
||||
void BillboardObject::setVisibilityFlags(int flags)
|
||||
{
|
||||
mBBSet->setVisibilityFlags(flags);
|
||||
}
|
||||
|
||||
void BillboardObject::setColour(const ColourValue& pColour)
|
||||
{
|
||||
mMaterial->getTechnique(0)->getPass(0)->setSelfIllumination(pColour);
|
||||
|
@ -421,6 +426,7 @@ void SkyManager::create()
|
|||
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->setRenderQueue(RQG_SkiesLate);
|
||||
mSunGlare->setVisibilityFlags(RV_Glare);
|
||||
|
||||
|
||||
HighLevelGpuProgramManager& mgr = HighLevelGpuProgramManager::getSingleton();
|
||||
|
|
|
@ -36,24 +36,25 @@ namespace MWRender
|
|||
BillboardObject();
|
||||
|
||||
virtual ~BillboardObject() {}
|
||||
|
||||
|
||||
void setColour(const Ogre::ColourValue& pColour);
|
||||
void setPosition(const Ogre::Vector3& pPosition);
|
||||
void setVisible(const bool visible);
|
||||
void setRenderQueue(unsigned int id);
|
||||
void setVisibilityFlags(int flags);
|
||||
void setSize(const float size);
|
||||
Ogre::Vector3 getPosition() const;
|
||||
|
||||
|
||||
void setVisibility(const float visibility);
|
||||
|
||||
|
||||
Ogre::SceneNode* getNode();
|
||||
|
||||
|
||||
protected:
|
||||
virtual void init(const Ogre::String& textureName,
|
||||
const float size,
|
||||
const Ogre::Vector3& position,
|
||||
Ogre::SceneNode* rootNode);
|
||||
|
||||
|
||||
Ogre::SceneNode* mNode;
|
||||
Ogre::MaterialPtr mMaterial;
|
||||
Ogre::BillboardSet* mBBSet;
|
||||
|
@ -71,9 +72,9 @@ namespace MWRender
|
|||
const Ogre::Vector3& position,
|
||||
Ogre::SceneNode* rootNode
|
||||
);
|
||||
|
||||
|
||||
virtual ~Moon() {}
|
||||
|
||||
|
||||
enum Phase
|
||||
{
|
||||
Phase_New = 0,
|
||||
|
@ -85,20 +86,20 @@ namespace MWRender
|
|||
Phase_WaningHalf,
|
||||
Phase_WaningCrescent
|
||||
};
|
||||
|
||||
|
||||
enum Type
|
||||
{
|
||||
Type_Masser = 0,
|
||||
Type_Secunda
|
||||
};
|
||||
|
||||
|
||||
void setPhase(const Phase& phase);
|
||||
void setType(const Type& type);
|
||||
void setSkyColour(const Ogre::ColourValue& colour);
|
||||
|
||||
|
||||
Phase getPhase() const;
|
||||
unsigned int getPhaseInt() const;
|
||||
|
||||
|
||||
private:
|
||||
Type mType;
|
||||
Phase mPhase;
|
||||
|
|
|
@ -139,14 +139,13 @@ Vector3 Water::getSceneNodeCoordinates(int gridX, int gridY)
|
|||
|
||||
void Water::preRenderTargetUpdate(const RenderTargetEvent& evt)
|
||||
{
|
||||
mWater->setVisible(false);
|
||||
|
||||
//mOldCameraFarClip = mCamera->getFarClipDistance();
|
||||
//if (mReflectDistance != 0)
|
||||
// mCamera->setFarClipDistance(mReflectDistance);
|
||||
|
||||
if (evt.source == mReflectionTarget)
|
||||
{
|
||||
mWater->setVisible(false);
|
||||
Vector3 pos = mCamera->getRealPosition();
|
||||
pos.y = mTop*2 - pos.y;
|
||||
mSky->setSkyPosition(pos);
|
||||
|
|
Loading…
Reference in a new issue