mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-04 02:41:19 +00:00
parent
e0d0997409
commit
417f60f467
@ -187,6 +187,8 @@ Moon::Moon( const String& textureName,
|
||||
{
|
||||
setVisibility(1.0);
|
||||
|
||||
mMaterial->setProperty("alphatexture", sh::makeProperty(new sh::StringValue(textureName + "_alpha")));
|
||||
|
||||
mPhase = Moon::Phase_Full;
|
||||
}
|
||||
|
||||
@ -215,9 +217,15 @@ void Moon::setPhase(const Moon::Phase& phase)
|
||||
textureName += ".dds";
|
||||
|
||||
if (mType == Moon::Type_Secunda)
|
||||
{
|
||||
sh::Factory::getInstance ().setTextureAlias ("secunda_texture", textureName);
|
||||
sh::Factory::getInstance ().setTextureAlias ("secunda_texture_alpha", "textures\\tx_mooncircle_full_s.dds");
|
||||
}
|
||||
else
|
||||
{
|
||||
sh::Factory::getInstance ().setTextureAlias ("masser_texture", textureName);
|
||||
sh::Factory::getInstance ().setTextureAlias ("masser_texture_alpha", "textures\\tx_mooncircle_full_m.dds");
|
||||
}
|
||||
|
||||
mPhase = phase;
|
||||
}
|
||||
|
@ -38,16 +38,14 @@ shUniform(float4x4, projection) @shAutoConstant(projection, projection_matrix)
|
||||
|
||||
SH_START_PROGRAM
|
||||
{
|
||||
|
||||
float4 tex = shSample(diffuseMap, UV);
|
||||
|
||||
shOutputColour(0) = float4(materialEmissive.xyz, 1) * tex;
|
||||
|
||||
shOutputColour(0).a = shSample(alphaMap, UV).a * materialDiffuse.a;
|
||||
|
||||
shOutputColour(0).rgb += (1.0-tex.a) * shOutputColour(0).a * atmosphereColour.rgb; //fill dark side of moon with atmosphereColour
|
||||
shOutputColour(0).rgb += (1.0-materialDiffuse.a) * atmosphereColour.rgb; //fade bump
|
||||
float4 phaseTex = shSample(diffuseMap, UV);
|
||||
float4 fullCircleTex = shSample(alphaMap, UV);
|
||||
|
||||
shOutputColour(0).a = max(phaseTex.a, fullCircleTex.a) * materialDiffuse.a;
|
||||
|
||||
shOutputColour(0).xyz = fullCircleTex.xyz * atmosphereColour.xyz;
|
||||
shOutputColour(0).xyz = shLerp(shOutputColour(0).xyz, phaseTex.xyz, phaseTex.a);
|
||||
shOutputColour(0).xyz *= materialEmissive.xyz;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -50,7 +50,7 @@ material openmw_moon
|
||||
|
||||
texture_unit alphaMap
|
||||
{
|
||||
direct_texture textures\tx_secunda_full.dds
|
||||
texture_alias $alphatexture
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user