using Monogame 3.6 a shader with the following form:
#if OPENGL
#define SV_POSITION POSITION
#define VS_SHADERMODEL vs_3_0
#define PS_SHADERMODEL ps_3_0
#else
#define VS_SHADERMODEL vs_4_0_level_9_1
#define PS_SHADERMODEL ps_4_0_level_9_1
#endif
Texture2D RoadTexture;
Texture2D TerrainTexture;
Texture2D MaskTexture;
SamplerState Sampler;
With a DESKTOPGL build the effect.Parameters key ends up being "Sampler+TerrainTexture" etc.
With a windows/directx build it ends up being "TerrainTexture"
This is because of a limitation in GLSL and the implementation of MojoShader. The issue is that the newer HLSL syntax seperates sampler and texture state, while in GLSL (and the old HLSL syntax) the texture is part of the sampler state. I.e. there is no distinction between texture and sampler. Because you can use 1 sampler to sample different textures in HLSL the different combinations of texture+sampler need a seperate sampler in GLSL. So MojoShader creates a Texture+SamplerState sampler for each used combination in HLSL. I think it makes sense from the perspective of MojoShader to keep the naming rules consistent regardless of whether there are actually conflicts in translating to GLSL.
That said, MG could abstract this away for the user... Worth thinking about!
Most helpful comment
That said, MG could abstract this away for the user... Worth thinking about!