Hey all!
I am a pretty long time MonoGame user but have been focusing on iOS. I am now in the process of porting a game over to Android, specifically Amazon FireTV.
I am having more problems than I would have thought trying the get my lighting effect compiled over on the latest MonoGame branch. The code for the fx file is below:
sampler s0;
texture lightMask;
sampler lightSampler = sampler_state
{
Texture = <lightMask>;
MinFilter = Linear;
MagFilter = Linear;
MipFilter = Linear;
AddressU = Clamp;
AddressV = Clamp;
};
float4 PixelShaderFunction(float2 coords: TEXCOORD0) : COLOR0
{
float4 color = tex2D(s0, coords);
float4 lightColor = tex2D(lightSampler, coords);
color *= 1 + lightColor * 3;
if (1 == 2)
{
if(lightColor.r == 0 && lightColor.g == 0 && lightColor.b == 0)
{
color.r /= 8;
color.g /= 8;
color.b /= 8;
}
}
return color;
}
float4 PixelShaderFunctionDarkLevels(float2 coords: TEXCOORD0) : COLOR0
{
float4 color = tex2D(s0, coords);
float4 lightColor = tex2D(lightSampler, coords);
if(lightColor.r == 0 && lightColor.g == 0 && lightColor.b == 0)
{
color *= 0.15f;
}
else
{
color *= .5f;
}
color *= 1 + lightColor * 4;
return color;
}
float4 PixelShaderFunctionDarkLevels2(float2 coords: TEXCOORD0) : COLOR0
{
float4 color = tex2D(s0, coords);
float4 lightColor = tex2D(lightSampler, coords);
if(lightColor.r == 0 && lightColor.g == 0 && lightColor.b == 0)
{
color *= 0.02f;
}
else
{
color *= .5f;
}
color *= 1 + lightColor * 4;
return color;
}
technique Technique1
{
pass Pass1
{
PixelShader = compile ps_2_0 PixelShaderFunction();
}
pass Pass2
{
PixelShader = compile ps_2_0 PixelShaderFunctionDarkLevels();
}
pass Pass3
{
PixelShader = compile ps_2_0 PixelShaderFunctionDarkLevels2();
}
}
I tried using the 2MGFX utility to create a mgfx file to read in but keep running into errors about a missing libmojoshader_64.dll file which exists in the directory. I am also attempting this on a 64bit version of windows7.
Does anyone have any ideas what my issue is? Or could someone compile this code for me targeting Android?
Thanks!!
Jon