我们正在为我们的游戏开发人工智能,目前正在开发检测系统。如何从网格中读取lightprobe插值数据?如果在阴影中,AI需要更长的时间和更近的距离才能检测到玩家
编辑:https://docs.unity3d.com/ScriptReference/LightProbes.GetInterpolatedProbe.html
发布于 2018-02-03 23:39:28
好的,最好的方法是使用GetInterpolatedProbe
你叫它像这样
SphericalHarmonicsL2 probe;
LightProbes.GetInterpolatedProbe(Target.position, renderer, out probe);确保该位置不在网格内,因为实时阴影会影响结果
然后,您可以查询SphericalHarmonicsL2正在做什么
Vector3[] directions = {
new Vector3(0, -1, 0.0f)
};
var colors = new Color[1];
probe.Evaluate(directions, colors);在上面的示例中,您将从向上的方向获取该点的颜色。上面的示例会产生垃圾,请确保在实际示例中重用数组
https://stackoverflow.com/questions/48598540
复制相似问题