Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #if defined(PK_VERTEX_SHADER)
- float4x4 matWVP : register(c0);
- struct VS_IN
- {
- float4 ObjPos : POSITION;
- float2 UV : TEXCOORD0;
- float4 Color : COLOR;
- float4 PK_CSColor : TEXCOORD1;
- };
- struct VS_OUT
- {
- float4 Position : SV_POSITION;
- float2 UV : TEXCOORD0;
- float4 Color : COLOR;
- float4 CSColor : TEXCOORD1;
- };
- VS_OUT main(VS_IN In)
- {
- VS_OUT Out;
- Out.Position = mul(matWVP, In.ObjPos);
- Out.UV = In.UV;
- Out.Color = In.Color;
- Out.CSColor = float4(0.0f, 1.0f, 0.0f, 1.0f);//In.PK_CSColor;
- return Out;
- }
- #endif
- //------------------------------------------------
- #if defined(PK_PIXEL_SHADER)
- Texture2D ColorTexture : register(t0);
- SamplerState ColorSampler : register(s0);
- struct PS_IN
- {
- float4 ProjPos : SV_POSITION;
- float2 UV : TEXCOORD0;
- float4 Color : COLOR;
- float4 CSColor : TEXCOORD1;
- };
- float4 main(PS_IN In) : SV_TARGET
- {
- float4 t = ColorTexture.Sample(ColorSampler, In.UV);
- float4 outCol = (In.Color * 0.1 + In.CSColor) * t;
- #if defined(MAT_ADDITIVE_ALPHA)
- outCol *= outCol.w;
- outCol.w = 0.0f;
- #endif
- #if defined(MAT_ADDITIVE_NOALPHA)
- outCol.w = 0.0f;
- #endif
- return outCol;
- }
- #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement