Hello Everyone,
I want to visualize a 3D Texture with the help of Ray Marching.
Now a Problem has occurred i am not able to handle.
So here is the Problem, at the edges it gets distorted.
In general, it is like a lupe.
Things in the volume that are further back, become larger.
This is how I build my Ray:
v2f vert (appdata v)
{
v2f o;
o.vertex = mul(UNITY_MATRIX_MVP, v.vertex);
o.wPos = v.vertex.xyz + 0.5;
return o;
}
Ray r;
r.position = i.wPos;
r.direction = normalize(i.wPos - _WorldSpaceCameraPos);
At least i get the color with:
tex3D(_MainTex, currentPos);
Could someone please help me?