Files
linguist/samples/HLSL/noise.fx
Erik Faye-Lund 6b001cf861 add support for HLSL/FX
Add support for DirectX HLSL / FX files. The FX files are
just HLSL files with some additional syntax to set
render-states and define multiple shader stages in one file.

Samples are either written by me, or taken from Chromium.
2016-02-19 11:32:46 +01:00

42 lines
616 B
HLSL

float alpha = 1.f;
texture tex;
sampler tex_sampler = sampler_state
{
Texture = (tex);
MipFilter = LINEAR;
MinFilter = LINEAR;
MagFilter = LINEAR;
AddressU = WRAP;
AddressV = WRAP;
};
struct VS_OUTPUT
{
float4 pos : POSITION;
float2 tex : TEXCOORD1;
};
VS_OUTPUT vertex(float4 ipos : POSITION, float2 tex : TEXCOORD0)
{
VS_OUTPUT Out;
Out.pos = ipos;
Out.tex = tex * 2;
return Out;
}
float4 pixel(VS_OUTPUT In) : COLOR
{
return tex2D(tex_sampler, In.tex) * alpha;
}
technique blur_ps_vs_2_0
{
pass P0
{
VertexShader = compile vs_2_0 vertex();
PixelShader = compile ps_2_0 pixel();
}
}