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