Skip to content

Commit 70c3880

Browse files
committed
rp: move emissive color to material converter
1 parent 8f29a95 commit 70c3880

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

Runtime/MaterialConverter.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ public class MaterialConverter : IMaterialConverter
5353
private static readonly int DiffusionProfileAsset = Shader.PropertyToID("_DiffusionProfileAsset");
5454
private static readonly int DiffusionProfileHash = Shader.PropertyToID("_DiffusionProfileHash");
5555
private static readonly int MaterialID = Shader.PropertyToID("_MaterialID");
56+
private static readonly int EmissiveColor = Shader.PropertyToID("_EmissiveColor");
5657

5758
#endregion
5859

@@ -211,6 +212,16 @@ public void SetMaterialType(Material material, MaterialType materialType)
211212
material.SetFloat(MaterialID, (int)materialType);
212213
}
213214

215+
public void SetEmissiveColor(MaterialPropertyBlock propBlock, Color color)
216+
{
217+
propBlock.SetColor(EmissiveColor, color);
218+
}
219+
220+
public Color? GetEmissiveColor(Material material)
221+
{
222+
return material.GetColor(EmissiveColor);
223+
}
224+
214225
private static Vector4 ConvertGUIDToVector4(string guid)
215226
{
216227
Vector4 vector;

0 commit comments

Comments
 (0)