Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #if OPENGL
- #define SV_POSITION POSITION
- #define VS_SHADERMODEL vs_3_0
- #define PS_SHADERMODEL ps_3_0
- #else
- #define VS_SHADERMODEL vs_4_0_level_9_1
- #define PS_SHADERMODEL ps_4_0_level_9_1
- #endif
- float4 pColor;
- float pAmount;
- matrix WorldViewProjection;
- sampler s0;
- struct VertexShaderInput
- {
- float4 Position : POSITION0;
- float4 Color : COLOR0;
- };
- struct VertexShaderOutput
- {
- float4 Position : SV_POSITION;
- float4 Color : COLOR0;
- float2 TextureCoordinates : TEXCOORD0;
- };
- VertexShaderOutput MainVS(in VertexShaderInput input)
- {
- VertexShaderOutput output = (VertexShaderOutput) 0;
- output.Position = mul(input.Position, WorldViewProjection);
- output.Color = input.Color;
- return output;
- }
- float4 MainPS(VertexShaderOutput input) : COLOR
- {
- float4 finalColor = tex2D(s0, input.TextureCoordinates);
- return lerp(finalColor, pColor * finalColor.a, pAmount);
- }
- technique BasicColorDrawing
- {
- pass P0
- {
- PixelShader = compile PS_SHADERMODELMainPS();
- }
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement