@Andrew_O_Bannon wrote:
float Percentage;
sampler TextureSampler: register(s0);
- float4 PixelShaderFunction(float2 Tex: TEXCOORD0) : COLOR0
- {
- float4 Color = tex2D(TextureSampler, Tex);
- float r = Color.r;
- float g = Color.g;
- float b = Color.b;
- Color.rgb = dot(Color.rgb, float3(0.7 * Percentage, 0.59 * Percentage, 0.11 * Percentage));
- r = r - (r - Color.rgb) * Percentage;
- g = g - (g - Color.rgb) * Percentage;
- b = b - (b - Color.rgb) * Percentage;
- Color.r = r;
- Color.g = g;
Color.b = b;
return Color;
}
technique tech
- {
- pass Pass1
- {
- PixelShader = compile ps_4_0_level_9_1
- PixelShaderFunction();
- }
- }
I've been knocking around shaders in monogame and found this example. but it shows me a warning
"warning x3206 (13,2 - 37) implicit truncation of vector type
"warning x3206 (14,2 - 38) implicit truncation of vector type
"warning x3206 (15,2 - 37) implicit truncation of vector type"
Posts: 3
Participants: 2