forgot to add files
parent
ad7383be43
commit
cd6e9986b6
@ -0,0 +1,46 @@
|
||||
#include "core.h"
|
||||
|
||||
#define MRT @shGlobalSettingBool(mrt_output)
|
||||
|
||||
#ifdef SH_VERTEX_SHADER
|
||||
|
||||
SH_BEGIN_PROGRAM
|
||||
shUniform(float4x4, wvp) @shAutoConstant(wvp, worldviewproj_matrix)
|
||||
|
||||
shInput(float2, uv0)
|
||||
shOutput(float2, UV)
|
||||
shOutput(float, fade)
|
||||
|
||||
SH_START_PROGRAM
|
||||
{
|
||||
shOutputPosition = shMatrixMult(wvp, shInputPosition);
|
||||
UV = uv0;
|
||||
|
||||
fade = (shInputPosition.z > 50) ? 1 : 0;
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
SH_BEGIN_PROGRAM
|
||||
#if MRT
|
||||
shDeclareMrtOutput(1)
|
||||
#endif
|
||||
|
||||
shInput(float2, UV)
|
||||
shInput(float, fade)
|
||||
|
||||
shSampler2D(diffuseMap)
|
||||
shUniform(float, nightFade) @shSharedParameter(nightFade)
|
||||
|
||||
|
||||
SH_START_PROGRAM
|
||||
{
|
||||
shOutputColour(0) = shSample(diffuseMap, UV) * float4(1,1,1, nightFade * fade);
|
||||
|
||||
|
||||
#if MRT
|
||||
shOutputColour(1) = float4(1,1,1,1);
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif
|
@ -0,0 +1,15 @@
|
||||
shader_set stars_vertex
|
||||
{
|
||||
source stars.shader
|
||||
type vertex
|
||||
profiles_cg vs_2_0 arbvp1
|
||||
profiles_hlsl vs_2_0
|
||||
}
|
||||
|
||||
shader_set stars_fragment
|
||||
{
|
||||
source stars.shader
|
||||
type fragment
|
||||
profiles_cg ps_2_x ps_2_0 ps arbfp1
|
||||
profiles_hlsl ps_2_0
|
||||
}
|
Loading…
Reference in New Issue