diff --git a/apps/openmw/mwrender/renderingmanager.cpp b/apps/openmw/mwrender/renderingmanager.cpp index 797e3c400a..7b58a80d76 100644 --- a/apps/openmw/mwrender/renderingmanager.cpp +++ b/apps/openmw/mwrender/renderingmanager.cpp @@ -310,7 +310,10 @@ void RenderingManager::sunDisable() void RenderingManager::setSunDirection(const Ogre::Vector3& direction) { - if (mSun) mSun->setDirection(Vector3(direction.x, -direction.z, direction.y)); + // direction * -1 (because 'direction' is camera to sun vector and not sun to camera), + // then convert from MW to ogre coordinates (swap y,z and make y negative) + if (mSun) mSun->setDirection(Vector3(-direction.x, -direction.z, direction.y)); + mSkyManager->setSunDirection(direction); } diff --git a/apps/openmw/mwrender/sky.cpp b/apps/openmw/mwrender/sky.cpp index 448050240b..23d99b6cd6 100644 --- a/apps/openmw/mwrender/sky.cpp +++ b/apps/openmw/mwrender/sky.cpp @@ -167,6 +167,8 @@ Moon::Moon( const String& textureName, "{ \n" " float4 tex = tex2D(texture, uv); \n" " oColor = float4(emissive.xyz,1) * tex2D(texture, uv) * float4(1,1,1,diffuse.a); \n" + " float bump = pow((1-diffuse.a),4); \n" + " oColor.rgb += float3(bump, bump, bump)*0.5; \n" "}"; fshader->setSource(outStream2.str()); fshader->load();