// SPDX-FileCopyrightText: 2024 Unity Technologies and the glTFast authors // SPDX-License-Identifier: Apache-2.0 using System; using UnityEngine; #if USING_HDRP using UnityEngine.Rendering.HighDefinition; #endif namespace GLTFast.Materials { /// /// Holds static material property identifiers. /// public static class MaterialProperty { /// Shader property ID for property alphaCutoff public static readonly int AlphaCutoff = Shader.PropertyToID("alphaCutoff"); /// Shader property ID for property baseColorTexture public static readonly int BaseColor = Shader.PropertyToID("baseColorFactor"); /// Shader property ID for property baseColorTexture public static readonly int BaseColorTexture = Shader.PropertyToID("baseColorTexture"); /// Shader property ID for property baseColorTexture_Rotation public static readonly int BaseColorTextureRotation = Shader.PropertyToID("baseColorTexture_Rotation"); /// Shader property ID for property baseColorTexture_ST public static readonly int BaseColorTextureScaleTransform = Shader.PropertyToID("baseColorTexture_ST"); /// Shader property ID for property baseColorTexture_texCoord public static readonly int BaseColorTextureTexCoord = Shader.PropertyToID("baseColorTexture_texCoord"); /// Shader property ID for property _Cull public static readonly int Cull = Shader.PropertyToID("_Cull"); /// Shader property ID for property _CullMode public static readonly int CullMode = Shader.PropertyToID("_CullMode"); /// Shader property ID for property _DstBlend public static readonly int DstBlend = Shader.PropertyToID("_DstBlend"); /// Shader property ID for property diffuseFactor public static readonly int DiffuseFactor = Shader.PropertyToID("diffuseFactor"); /// Shader property ID for property diffuseTexture public static readonly int DiffuseTexture = Shader.PropertyToID("diffuseTexture"); /// Shader property ID for property diffuseTexture_ST public static readonly int DiffuseTextureScaleTransform = Shader.PropertyToID("diffuseTexture_ST"); /// Shader property ID for property diffuseTexture_Rotation public static readonly int DiffuseTextureRotation = Shader.PropertyToID("diffuseTexture_Rotation"); /// Shader property ID for property diffuseTexture_texCoord public static readonly int DiffuseTextureTexCoord = Shader.PropertyToID("diffuseTexture_texCoord"); /// Shader property ID for property emissiveFactor public static readonly int EmissiveFactor = Shader.PropertyToID("emissiveFactor"); /// Shader property ID for property emissiveTexture public static readonly int EmissiveTexture = Shader.PropertyToID("emissiveTexture"); /// Shader property ID for property emissiveTexture_Rotation public static readonly int EmissiveTextureRotation = Shader.PropertyToID("emissiveTexture_Rotation"); /// Shader property ID for property emissiveTexture_ST public static readonly int EmissiveTextureScaleTransform = Shader.PropertyToID("emissiveTexture_ST"); /// Shader property ID for property emissiveTexture_texCoord public static readonly int EmissiveTextureTexCoord = Shader.PropertyToID("emissiveTexture_texCoord"); /// Shader property ID for property glossinessFactor public static readonly int GlossinessFactor = Shader.PropertyToID("glossinessFactor"); /// Shader property ID for property normalTexture public static readonly int NormalTexture = Shader.PropertyToID("normalTexture"); /// Shader property ID for property normalTexture_Rotation public static readonly int NormalTextureRotation = Shader.PropertyToID("normalTexture_Rotation"); /// Shader property ID for property normalTexture_ST public static readonly int NormalTextureScaleTransform = Shader.PropertyToID("normalTexture_ST"); /// Shader property ID for property normalTexture_texCoord public static readonly int NormalTextureTexCoord = Shader.PropertyToID("normalTexture_texCoord"); /// Shader property ID for property normalTexture_scale public static readonly int NormalTextureScale = Shader.PropertyToID("normalTexture_scale"); /// Shader property ID for property metallicFactor public static readonly int Metallic = Shader.PropertyToID("metallicFactor"); /// Shader property ID for property metallicRoughnessTexture public static readonly int MetallicRoughnessMap = Shader.PropertyToID("metallicRoughnessTexture"); /// Shader property ID for property metallicRoughnessTexture_ST public static readonly int MetallicRoughnessMapScaleTransform = Shader.PropertyToID("metallicRoughnessTexture_ST"); /// Shader property ID for property metallicRoughnessTexture_Rotation public static readonly int MetallicRoughnessMapRotation = Shader.PropertyToID("metallicRoughnessTexture_Rotation"); /// Shader property ID for property metallicRoughnessTexture_texCoord public static readonly int MetallicRoughnessMapTexCoord = Shader.PropertyToID("metallicRoughnessTexture_texCoord"); /// Shader property ID for property _Mode public static readonly int Mode = Shader.PropertyToID("_Mode"); /// Shader property ID for property occlusionTexture public static readonly int OcclusionTexture = Shader.PropertyToID("occlusionTexture"); /// Shader property ID for property occlusionTexture_strength public static readonly int OcclusionTextureStrength = Shader.PropertyToID("occlusionTexture_strength"); /// Shader property ID for property occlusionTexture_Rotation public static readonly int OcclusionTextureRotation = Shader.PropertyToID("occlusionTexture_Rotation"); /// Shader property ID for property occlusionTexture_ST public static readonly int OcclusionTextureScaleTransform = Shader.PropertyToID("occlusionTexture_ST"); /// Shader property ID for property occlusionTexture_texCoord public static readonly int OcclusionTextureTexCoord = Shader.PropertyToID("occlusionTexture_texCoord"); /// Shader property ID for property roughnessFactor public static readonly int RoughnessFactor = Shader.PropertyToID("roughnessFactor"); /// Shader property ID for property specularFactor public static readonly int SpecularFactor = Shader.PropertyToID("specularFactor"); /// Shader property ID for property specularGlossinessTexture public static readonly int SpecularGlossinessTexture = Shader.PropertyToID("specularGlossinessTexture"); /// Shader property ID for property specularGlossinessTexture_ST public static readonly int SpecularGlossinessTextureScaleTransform = Shader.PropertyToID("specularGlossinessTexture_ST"); // TODO: Support in shader! /// Shader property ID for property specularGlossinessTexture_Rotation public static readonly int SpecularGlossinessTextureRotation = Shader.PropertyToID("specularGlossinessTexture_Rotation"); // TODO: Support in shader! /// Shader property ID for property specularGlossinessTexture_texCoord public static readonly int SpecularGlossinessTextureTexCoord = Shader.PropertyToID("specularGlossinessTexture_texCoord"); // TODO: Support in shader! /// Shader property ID for property _SrcBlend public static readonly int SrcBlend = Shader.PropertyToID("_SrcBlend"); /// Shader property ID for property _ZWrite public static readonly int ZWrite = Shader.PropertyToID("_ZWrite"); #if UNITY_SHADER_GRAPH /// Shader property ID for property _AlphaClip public static readonly int AlphaClip = Shader.PropertyToID("_AlphaClip"); /// Shader property ID for property _Surface public static readonly int Surface = Shader.PropertyToID("_Surface"); #endif #if USING_HDRP /// Shader property ID for property _AlphaCutoffEnable public static readonly int AlphaCutoffEnable = Shader.PropertyToID("_AlphaCutoffEnable"); /// Shader property ID for property _DoubleSidedEnable public static readonly int DoubleSidedEnable = Shader.PropertyToID("_DoubleSidedEnable"); #if UNITY_2021_1_OR_NEWER /// Shader property ID for property _EnableBlendModePreserveSpecularLighting public static readonly int EnableBlendModePreserveSpecularLighting = Shader.PropertyToID(HDMaterialProperties.kEnableBlendModePreserveSpecularLighting); #endif /// Shader property ID for property _SurfaceType public static readonly int SurfaceType = Shader.PropertyToID("_SurfaceType"); #endif } }