mirror of
https://github.com/OpenMW/openmw.git
synced 2025-02-23 23:09:44 +00:00
Merge branch 'next' of https://github.com/zinnschlag/openmw into terrain_next
This commit is contained in:
commit
e04ef38a5c
2 changed files with 79 additions and 74 deletions
|
@ -318,7 +318,10 @@ void RenderingManager::sunDisable()
|
||||||
|
|
||||||
void RenderingManager::setSunDirection(const Ogre::Vector3& direction)
|
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);
|
mSkyManager->setSunDirection(direction);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -167,6 +167,8 @@ Moon::Moon( const String& textureName,
|
||||||
"{ \n"
|
"{ \n"
|
||||||
" float4 tex = tex2D(texture, uv); \n"
|
" float4 tex = tex2D(texture, uv); \n"
|
||||||
" oColor = float4(emissive.xyz,1) * tex2D(texture, uv) * float4(1,1,1,diffuse.a); \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->setSource(outStream2.str());
|
||||||
fshader->load();
|
fshader->load();
|
||||||
|
@ -276,7 +278,7 @@ void SkyManager::ModVertexAlpha(Entity* ent, unsigned int meshType)
|
||||||
*((uint32*)currentVertex) = tmpR | (tmpG << 8) | (tmpB << 16) | (tmpA << 24);
|
*((uint32*)currentVertex) = tmpR | (tmpG << 8) | (tmpB << 16) | (tmpA << 24);
|
||||||
|
|
||||||
// Move to the next vertex
|
// Move to the next vertex
|
||||||
pData+=vertex_size;
|
pData = static_cast<unsigned char *> (pData) + vertex_size;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Unlock
|
// Unlock
|
||||||
|
|
Loading…
Reference in a new issue