2012-07-06 10:31:48 +02:00
|
|
|
#include "core.h"
|
|
|
|
|
|
|
|
#ifdef SH_VERTEX_SHADER
|
|
|
|
|
|
|
|
SH_BEGIN_PROGRAM
|
2012-07-11 09:08:55 +02:00
|
|
|
shUniform(float4x4, wvp) @shAutoConstant(wvp, worldviewproj_matrix)
|
2012-07-09 20:14:07 +02:00
|
|
|
|
2013-02-04 18:03:03 +01:00
|
|
|
shOutput(float, alphaFade)
|
2012-07-06 10:31:48 +02:00
|
|
|
|
|
|
|
SH_START_PROGRAM
|
|
|
|
{
|
|
|
|
shOutputPosition = shMatrixMult(wvp, shInputPosition);
|
2013-02-04 18:03:03 +01:00
|
|
|
alphaFade = shInputPosition.z < 150.0 ? 0.0 : 1.0;
|
2012-07-06 10:31:48 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
#else
|
|
|
|
|
|
|
|
SH_BEGIN_PROGRAM
|
2013-02-04 18:03:03 +01:00
|
|
|
shInput(float, alphaFade)
|
2012-07-11 09:08:55 +02:00
|
|
|
shUniform(float4, atmosphereColour) @shSharedParameter(atmosphereColour)
|
2013-02-25 18:29:11 +01:00
|
|
|
shUniform(float4, horizonColour) @shSharedParameter(horizonColour, horizonColour)
|
2012-07-06 10:31:48 +02:00
|
|
|
|
|
|
|
SH_START_PROGRAM
|
|
|
|
{
|
2013-02-25 18:29:11 +01:00
|
|
|
shOutputColour(0) = alphaFade * atmosphereColour + (1.f - alphaFade) * horizonColour;
|
2012-07-06 10:31:48 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|