@monobeginner wrote:
Hey, I'm trying to create cross-platform game. My shaders running fine on Windows Phone, but it won't compile for Android. Here is shortened source code:
float Shift; float MaxShift; float ExtraShiftScaleFactor; struct VertexShaderOutput { float4 position : SV_POSITION; float4 color : COLOR; float2 texCoords : TEXCOOR; }; sampler TextureSampler; // Input color (which comes from vertex shader output) - color specified in SpriteBatch.Draw() method. float4 PixelShaderFunction(VertexShaderOutput input) : COLOR { const float4 originalColor = tex2D(TextureSampler, input.texCoords) * input.color; float4 newColor = tex2D(TextureSampler, float2(input.texCoords.x + sin(input.texCoords.x * Shift * ExtraShiftScaleFactor)*0.01, input.texCoords.y + sin(input.texCoords.y * Shift * ExtraShiftScaleFactor)*0.01)) * input.color; return newColor; } technique Technique1 { pass Pass1 { PixelShader = compile ps_4_0_level_9_1 PixelShaderFunction(); } }
Any idea what's wrong ? MGCB says that:
DX9-style intrinsics are disabled when not in dx9 compatibility mode.I tried to change tex2D(...) to something like:
const float4 originalColor = texture2d,Sample(TextureSampler, input.texCoords) * input.color;
Also changed shader output from COLOR TO SV_Target, but finally I faced other problem (Content Processor unexpected failure)
Posts: 4
Participants: 2