Closed DaedalusGame closed 3 years ago
For now I've disabled Error Reporting in Options > Text Editor > HLSL > Advanced
HLSL Tools does support the newer Sample
methods on objects like Texture2D
. Can you paste the declaration of your texture here, as well as your call to Sample
?
Ah right, i probably should've posted that to begin with.
Declaration (https://github.com/DaedalusGame/RogueTower/blob/90f11c539c1c68209f4d4458447e9e7b0cac9614/RogueTower/Content/effects.fx#L15):
texture2D texture_main : register(t0);
texture2D texture_map : register(t1);
SamplerState sampler_main;
float4 color = texture_main.Sample(sampler_main, input.TextureCoordinates) * input.Color;
I'll admit that I'm rather amateurish at writing HLSL, and I think monogame's HLSL might have some aberrations (internally they can compile shaders to both HLSL and GLSL).
Oops, I'm really sorry for the long delay! I think this could be fixed by changing your texture declarations to use Texture2D
instead of texture2D
. If I recall correctly, MonoGame's effect compiler does allow that. Please let me know if that doesn't fix the issue.
My current version is 1.1.300 and texture2D appears to be missing the newer Sample methods, because HLSLTools fills my errorlog with
HLSL0031 Type 'texture' does not have a method 'Sample(SamplerState, float2)'.
I tried to suppress the error but to no effect, is there any other solution to this?