Ok, I've tried this yesterday. *Something* worked - but I'm not yet sure about it.
I've replaced my previous view space to world space conversion with this:
float3 world_pos = mul( m_v2w, view_pos ).xyz + camera_pos
Indeed the engine seems to pass some value for m_v2w after adding it to my HLSL shader code:
uniform float3x4 m_v2w;
However the result is strange. I have this debug code to check whether the transformation is correct:
if (distance(world_pos, check_pos) < 1.0)
This is supposed to render a red sphere 1 meter around the spot whose world space coordinate I want to check against (check_pos). That worked well before (when using the code in my initial post), but as mentioned only under specific conditions (within a limited camera position and direction range).
NOW the result is completely different. Instead of rendering a sphere around the check position, regardless of the camera position, the shader renders now a red circle around the player if and only if he is within 1 meter from the check position !?
The good news is that the circle stays there regardless of the camera direction - this wasn't the case before. But how to interpret the new result I don't know. My first thought was that adding the camera position to the transformation formula might not be necessary anymore and cause this output, as the new result is obviously depending on the players / camera position:
float3 world_pos = mul( m_v2w, view_pos ).xyz
But removing that camera_pos part from the code doesn't help either as there will be nothing rendered at all at the check position.
Edited by Meltac, 14 August 2014 - 02:28 AM.