Update custom pass to global custom pass
This commit is contained in:
22
Runtime/HDRP/UTSMeshRenderer.cs
Normal file
22
Runtime/HDRP/UTSMeshRenderer.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
using UnityEngine;
|
||||
|
||||
[ExecuteInEditMode]
|
||||
public class UTSMeshRenderer : MonoBehaviour
|
||||
{
|
||||
private const string Shader_Prop_Object_Center_Name = "_ObjectCenterPositionWS";
|
||||
|
||||
public Material material;
|
||||
|
||||
public Transform objectCenter;
|
||||
|
||||
private void Update()
|
||||
{
|
||||
if (material == null)
|
||||
return;
|
||||
|
||||
if (objectCenter != null)
|
||||
{
|
||||
material.SetVector(Shader_Prop_Object_Center_Name, objectCenter.position);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user