c# - MonoGame Shader - 2MGFX cant compile in SM4 -
c# - MonoGame Shader - 2MGFX cant compile in SM4 -
i trying compile 3 .fx custom shader files monogame sample project, tryting running windows phone.
the gaussianblur.fx file is:
// pixel shader applies 1 dimensional gaussian blur filter. // used twice bloom postprocess, first // blur horizontally, , 1 time again blur vertically. sampler texturesampler : register(s0); #define sample_count 15 float2 sampleoffsets[sample_count]; float sampleweights[sample_count]; float4 pixelshaderfunction(float2 texcoord : texcoord0) : color0 { float4 c = 0; // combine number of weighted image filter taps. (int = 0; < sample_count; i++) { c += tex2d(texturesampler, texcoord + sampleoffsets[i]) * sampleweights[i]; } homecoming c; } technique gaussianblur { pass pass1 { pixelshader = compile ps_4_0_level_9_1 pixelshaderfunction(); } }
i trying compile using mg2fx.exe - cloned latest monogame develop repo , built 2mgfx project x64|release
the command run - 2mgfx.exe gaussianblur.fx guassianblur.mgfx
******* can compile if utilize ps_2_0 - ps_4_0_level_9_1 fais compile, saying error x3523: dx9-style intrinsics disabled when not in dx9 compatibility mode. , ps_4_0 fails invalid profile ''. pixel shader 'pixelshaderfunction' must sm 3.0 or lower!
i have no thought how set work ps_4_0 - building 2mgfx incorrectly? did open project , press build.
next, tryng take files , load them calling
gaussianblureffect = game.content.load<effect>("shaders/gaussianblur.mgfx");
i setting mgfx file content
but when seek load it, exception stating:
system.exception: mgfx effect wrong profile platform!
i assuming need loaded in ps_4_0 first, question how can 2mgfx recognize this? 1 time have built mgfx file using 2mgfx, can load normal .xnb file.
c# monogame
Comments
Post a Comment