As the title says I would like to recover the original distance from a distance based depth map. I understand that the code used to generate the map is located in distanceMapPass.as but I have a hard time finding the code necessary to revert from the tex component back to the original distance.
Anyone can help with this?
code = “dp3 ft2.z, v0.xyz, v0.xyz \n” +
“mul ft0, fc0, ft2.z \n” +
“frc ft0, ft0 \n” +
“mul ft1, ft0.yzww, fc1 \n”;
if (_alphaThreshold > 0) {
code += “tex ft3, v1, fs0 <2d,”+filter+”,”+wrap+”>\n” +
“sub ft3.w, ft3.w, fc2.x\n” +
“kil ft3.w\n”;
}
code += “sub oc, ft0, ft1 \n”;