浏览代码

Add a featheringWidth getter/setter/

/1.5-preview
John Sietsma 6 年前
当前提交
1fc57bb0
共有 1 个文件被更改,包括 7 次插入1 次删除
  1. 8
      Assets/Scripts/ARFeatheredPlaneMeshVisualizer.cs

8
Assets/Scripts/ARFeatheredPlaneMeshVisualizer.cs


[RequireComponent(typeof(ARPlaneMeshVisualizer), typeof(MeshRenderer), typeof(ARPlane))]
public class ARFeatheredPlaneMeshVisualizer : MonoBehaviour
{
float featheringWidth
{
get { return m_FeatheringWidth; }
set { m_FeatheringWidth = value; }
}
[Tooltip("The width of the texture feathering (in world units).")]
[SerializeField]
float m_FeatheringWidth = 0.2f;

// Remap the UV so that a UV of "1" marks the feathering boudary.
// The ratio of featherBoundaryDistance/edgeDistance is the same as featherUV/edgeUV.
// Rearrange to get the edge UV.
float uvMapping = vertexDist / (vertexDist - m_FeatheringWidth);
float uvMapping = vertexDist / (vertexDist - featheringWidth);
uv.x = uvMapping;
// All the UV mappings will be different. In the shader we need to know the UV value we need to fade out by.

正在加载...
取消
保存