Hello all monogame community ! I ask help here just how to compiling my fx vertex shader to windows ? I asked at gamedev here : http://gamedev.stackexchange.com/questions/86783/monogame-vertex-shader-loading-problem
But anyone seems interested to answer me…
So I’m asking here just how to get simply working my vertex shader I’m pretty sure it’s not really hard … Thank you
EDIT : Ok i GOT news , I uninstall monogame and install the latest dev version of November 4 2014, I succesfull compiling my shader :
sampler TextureSampler : register(s0); float2 ViewportSize; float4x4 ScrollMatrix;
void SpriteVertexShader(inout float4 color : COLOR0, inout float2 texCoord : TEXCOORD0, inout float4 position : POSITION0) { // Half pixel offset for correct texel centering. position.xy -= 0.5;
// Viewport adjustment.
position.xy = position.xy / ViewportSize;
position.xy *= float2(2, -2);
position.xy -= float2(1, -1);
// Transform our texture coordinates to account for camera
texCoord = mul(float4(texCoord.xy, 0, 1), ScrollMatrix).xy;
}
technique SpriteBatch { pass { VertexShader = compile vs_4_0_level_9_1 SpriteVertexShader(); } }
i got a xnb file that i try to load with content.load(…) It work, but then when I want to use it within my spriteBatch Begin, it throw me sharpDX error : HRESULT: [0x80070057], Module: [General], ApiCode: [E_INVALIDARG/Invalid Arguments], Message: Incorrect par…
my SpriteBatch Begin: spriteBatch.Begin(SpriteSortMode.Deferred, null, SamplerState.LinearWrap, null, null, InfiniteBG);