Quantcast
Channel: Community | MonoGame - Latest topics
Viewing all articles
Browse latest Browse all 6821

Shader Question [solved]

$
0
0

@Phoenix_Feder wrote:

I have a basic Problem using shader.
I'm new to shader and I want to understand the basics.
I got plenty tutorials to read but no one seems to work with monogame. (won't compile or blank screen)
So my question is what do I wrong?

I started with a shader where input = output.

sampler s0;

float4 PixelShaderFunction(float2 coord : TEXCOORD0) : COLOR0
{
	float4 color = tex2D(s0, coord);
	return color;
}


technique
{
    pass P0
    {
        PixelShader = compile ps_4_0_level_9_3 PixelShaderFunction();
    }
}

and I Draw with:

spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, null, null, null, _AlphaShader);

spriteBatch.Draw(_Planet, new Vector2(0, 0), Color.White);

spriteBatch.End();

But there is no output. I have a blank screen.
This seems like a noob-question, I just want to understand how this works and why I can't get a shader to work.

return float4(1, 0, 0, 1); works for the test (red square where the image is)

Thank you

Posts: 18

Participants: 3

Read full topic


Viewing all articles
Browse latest Browse all 6821

Trending Articles