mirror of
https://github.com/ncblakely/GiantsTools
synced 2024-12-05 02:53:08 +01:00
53 lines
1.2 KiB
HLSL
53 lines
1.2 KiB
HLSL
//--------------------------------------------------------------------------------------
|
|
// Sky.fx
|
|
|
|
// Experimental sky shader. Does nothing currently.
|
|
//--------------------------------------------------------------------------------------
|
|
|
|
#include "../fxh/Transform.fxh"
|
|
|
|
shared WorldTransforms g_WorldTransforms;
|
|
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 )
|
|
{
|
|
oPosition = mul(iPosition, g_WorldTransforms.WorldViewProjection);
|
|
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;
|
|
}
|
|
}
|
|
|