📄 sky.fx
字号:
struct VSOut
{
float4 pos: POSITION0;
float3 Tex: TEXCOORD0;
};
float4x4 g_WVP;
texture g_texEnv;
sampler EnvMap = sampler_state
{
Texture = <g_texEnv>;
MinFilter = LINEAR;
MagFilter = LINEAR;
MipFilter = LINEAR;
AddressU = WRAP;
AddressV = WRAP;
};
VSOut VS(float3 posL: POSITION0)
{
VSOut V = (VSOut) 0;
V.pos = mul(float4(posL,1.0f),g_WVP).xyww;
V.Tex = posL;
return V;
}
float4 PS(float3 tex: TEXCOORD0):COLOR
{
return texCUBE(EnvMap,tex);
}
technique Tech
{
pass P0
{
vertexShader = compile vs_2_0 VS();
pixelShader = compile ps_2_0 PS();
//将背景设置为天空,并清空模板缓存和后台缓存
CullMode = None;
ZFunc = Always;
StencilEnable = true;
StencilFunc = Always;
StencilPass = Replace;
StencilRef = 0;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -