Okay, the issue I had didn’t exist, so I am converting the thread to the real issue. If SHADER_API_D3D11 is defined, worldPos is not filled in the standard shader. Here is a simple shader that will show the issue.
Add the material to an object, and try changing _Pos. You will see that it applies the same value to the whole object, when it should actually show a spherical gradient from _Pos.
Can you make a simple shader that outputs one color if SHADER_API_D3D11 is defined and another if it’s not? Then you can at least check whether this is set and when.
Okay, I finally fixed it. But it doesn’t make any sense.
Following your last reply, I wrote a small shader doing a poor blend between two color, in the exact same multi_compile. No issue. So I start adding the features of my shader one by one, thoroughly testing each time. Until there is pretty much everything, and it breaks. I decide to only push one point in my structured buffer, and I drive it from script thanks to a transform I have in my scene. And here, I realize that when I approach the position (1,0,0), I have my effect, kind of, but the same value is applied to everything. Takes me a while to really understand what’s going on. in my code, I replace IN.worldPos by an hardcoded value, say, (-1,2,5), and when I test the effect, I have the exact same result.
So basically, for some reason, if I define SHADER_API_D3D11, IN.worldPos contains a default value of (1,0,0). For now, I got it working by creating my custom vertex position by defining it in my own custom vertex shader. I think it’s not the best looking solution, but for now it works.
I will write a shader to see if I can reproduce the issue in a smaller scale, and fill a bug report if necessary. Thanks for your help.
edit : updated the first message to reflect the real issue