DepthWithColor-D3D.fx问题 [英] DepthWithColor-D3D.fx question
问题描述
我正在查看DepthWithColor-D3D.fx中的代码并且不理解以下转换
  //删除玩家索引信息并转换为米数
  float realDepth = depth / 4000.0;
不应该是
  float realDepth =(深度>>> 3)/ 4000.0;
更改此行后,投影图像变小了很多。不知道如何弥补这一点。是否有可能获得更多额外的解释 如何计算缩放因子和坐标?
非常感谢!
此文件的副本除以8000.0。你确定你的副本说4000.0吗?
float realDepth = depth / 8000.0;
因为右移3和8除以相同,这实际上与以下内容相同:
float realDepth =(depth>> 3)/ 1000.0;
...但它是在一次操作中完成,这应该更快。
约翰
K4W开发
Hi,
I am looking at the code in DepthWithColor-D3D.fx and don't understand the following convertion
// remove player index information and convert to metersfloat realDepth = depth / 4000.0;
Shouldn't it be
float realDepth = (depth >> 3) / 4000.0;
After I change this line the projected image becomes a lot smaller. Not sure how to compensate for this. Is it possible to get some more additional explanation how the scaling factors and coordinates are computed?
Thanks a lot!
My copy of this file has a division by 8000.0. Are you sure your copy says 4000.0?
float realDepth = depth / 8000.0;
Since right-shift by 3 is the same as division by 8, this is effectively the same as:
float realDepth = (depth >> 3) / 1000.0;
...but it is accomplished in one operation, which should be faster.
John
K4W Dev
这篇关于DepthWithColor-D3D.fx问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!