//Vertex Shader: Output.Position = mul(inPos, matWorldViewProj); Output.Position2D = Output.Position; //Pixel Shader depth = ((PSIn.Position2D.z-0)/maxDepth); //maxdepth = camera.clip_far
float4x4 matMtl : matWorldViewProjInv; //Pixel Shader //compute world position float4 vp = float4(inTex.xy * float2(2, -2) - float2(1, -1), depth, 1); float4 v = mul(vp, matMtl); float3 position = v.xyz/v.w; //calculate ROUGH normals from position float3 normal = cross(ddx(position),ddy(position));
Gamestudio download | Zorro platform | shop | Data Protection Policy
oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de