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

My shader works on windows but not on Android?

$
0
0

@nebosite wrote:

I'm new to pixel shaders and I've created this very simple stencil shader that works as expected when run from a windows desktop client, but not on Android. Any idea what I am doing wrong?

Here's the code for the shader:

Texture2D TextureBase;
sampler2D TextureSamplerBase = sampler_state
{
	Texture = <TextureBase>;
};

Texture2D Texture;
sampler2D TextureSampler = sampler_state
{
	Texture = <Texture>;
};

struct VertexShaderOutput
{
	float4 Position : TEXCOORD1;
	float4 Color : COLOR0;
	float2 TextureCordinate : TEXCOORD0;
};

float4 StencilShader(VertexShaderOutput input) : COLOR0
{
	float4 stencilColor = tex2D(TextureSampler, input.TextureCordinate);
	float4 baseColor = tex2D(TextureSamplerBase, input.TextureCordinate);

	return float4(baseColor.rgb, stencilColor.a);
}

technique StencilTechnique
{
	pass Pass0
	{
#if HLSL
		PixelShader = compile ps_4_0_level_9_3 StencilShader();
#else
		PixelShader = compile ps_2_0 StencilShader();
#endif
	}
}

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 6821

Trending Articles