1
0
mirror of https://github.com/ncblakely/GiantsTools synced 2024-11-22 22:25:37 +01:00
GiantsTools/Shaders/fx/Sky.fx

53 lines
1.2 KiB
HLSL
Raw Normal View History

2020-08-11 21:08:49 +02:00
//--------------------------------------------------------------------------------------
// Sky.fx
// Experimental sky shader. Does nothing currently.
//--------------------------------------------------------------------------------------
2020-12-01 02:40:33 +01:00
#include "../fxh/Transform.fxh"
shared WorldTransforms g_WorldTransforms;
2020-08-11 21:08:49 +02:00
float intensityThreshold = 1.f;
float colorMultiplier = 1.f;
texture g_SkyTexture;
sampler g_SkyTextureSampler =
sampler_state
{
Texture = <g_SkyTexture>;
MipFilter = LINEAR;
MinFilter = LINEAR;
MagFilter = LINEAR;
};
void RenderSceneVS(
float3 iPosition : POSITION,
float2 iTexCoord0 : TEXCOORD0,
out float4 oPosition : POSITION,
out float4 oColor0 : COLOR0,
out float2 oTexCoord0 : TEXCOORD0 )
{
2020-12-01 02:40:33 +01:00
oPosition = mul(iPosition, g_WorldTransforms.WorldViewProjection);
2020-08-11 21:08:49 +02:00
oColor0 = float4(1, 1, 1, 1);
oTexCoord0 = iTexCoord0;
}
float4 RenderScenePS(
float4 iColor : COLOR,
float2 iTexCoord0 : TEXCOORD0) : COLOR0
{
return tex2D(g_SkyTextureSampler, iTexCoord0);
}
technique RenderWithPixelShader
{
pass Pass0
{
VertexShader = compile vs_1_1 RenderSceneVS();
PixelShader = compile ps_2_0 RenderScenePS();
ZEnable = FALSE;
ZWriteEnable = FALSE;
}
}