So I’ve been trying to get a shader running on iOS for the last few days, its a basic shader for normal maps. I can get my shaders to compile fine but no matter what I do I cant get the shader to recognise my normal map texture.
If I do something like this:
Texture2D<float4> xNormalMap;
sampler Sampler
{
Texture = <xNormalMap>;
};
and set the texture like this:
normalmapEffect.Parameters["xNormalMap"].SetValue(tex);
Then I just get thrown a null reference, all my other parameters are recognised fine but not textures. When I print a list of the parameters to the console it shows the only ones missing are textures.
If I set it like this instead:
normalmapEffect.Parameters["Sampler"].SetValue(tex);
Then the project will run but the texture will be plain black with no effect.
I’ve also tried to convert the XNA SpriteEffects Sample which has a very basic shader for normal maps with the exact same issues:
http://xbox.create.msdn.com/en-US/education/catalog/sample/sprite_effects
Anyone have any ideas why this might be? Is it a MonoGame issue? Im using the latest develop branch.