mirror of
https://github.com/vrm-c/UniVRM.git
synced 2026-08-28 05:44:48 -05:00
rename URP to Urp
This commit is contained in:
@@ -12,7 +12,7 @@ namespace UniGLTF
|
||||
{
|
||||
public override void OnImportAsset(AssetImportContext ctx)
|
||||
{
|
||||
Import(this, ctx, m_reverseAxis.ToAxes(), m_useURPMaterial);
|
||||
Import(this, ctx, m_reverseAxis.ToAxes(), m_useUrpMaterial);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace UniGLTF
|
||||
{
|
||||
public override void OnImportAsset(AssetImportContext ctx)
|
||||
{
|
||||
Import(this, ctx, m_reverseAxis.ToAxes(), m_useURPMaterial);
|
||||
Import(this, ctx, m_reverseAxis.ToAxes(), m_useUrpMaterial);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,13 +21,13 @@ namespace UniGLTF
|
||||
public ScriptedImporterAxes m_reverseAxis = default;
|
||||
|
||||
[SerializeField]
|
||||
public bool m_useURPMaterial;
|
||||
public bool m_useUrpMaterial;
|
||||
|
||||
static IMaterialDescriptorGenerator GetMaterialGenerator(bool useURPMaterial)
|
||||
static IMaterialDescriptorGenerator GetMaterialGenerator(bool useUrpMaterial)
|
||||
{
|
||||
if (useURPMaterial)
|
||||
if (useUrpMaterial)
|
||||
{
|
||||
return new GltfURPMaterialDescriptorGenerator();
|
||||
return new GltfUrpMaterialDescriptorGenerator();
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -41,7 +41,7 @@ namespace UniGLTF
|
||||
/// <param name="scriptedImporter"></param>
|
||||
/// <param name="context"></param>
|
||||
/// <param name="reverseAxis"></param>
|
||||
protected static void Import(ScriptedImporter scriptedImporter, AssetImportContext context, Axes reverseAxis, bool useURPMaterial)
|
||||
protected static void Import(ScriptedImporter scriptedImporter, AssetImportContext context, Axes reverseAxis, bool useUrpMaterial)
|
||||
{
|
||||
#if VRM_DEVELOP
|
||||
Debug.Log("OnImportAsset to " + scriptedImporter.assetPath);
|
||||
@@ -62,7 +62,7 @@ namespace UniGLTF
|
||||
.Where(x => x.Value != null)
|
||||
.ToDictionary(kv => new SubAssetKey(kv.Value.GetType(), kv.Key.name), kv => kv.Value);
|
||||
|
||||
IMaterialDescriptorGenerator materialGenerator = GetMaterialGenerator(useURPMaterial);
|
||||
IMaterialDescriptorGenerator materialGenerator = GetMaterialGenerator(useUrpMaterial);
|
||||
|
||||
using (var loader = new ImporterContext(data, extractedObjects, materialGenerator: materialGenerator))
|
||||
{
|
||||
|
||||
@@ -14,7 +14,7 @@ namespace UniGLTF
|
||||
{
|
||||
public override void OnImportAsset(AssetImportContext ctx)
|
||||
{
|
||||
Import(this, ctx, m_reverseAxis.ToAxes(), m_useURPMaterial);
|
||||
Import(this, ctx, m_reverseAxis.ToAxes(), m_useUrpMaterial);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ namespace UniGLTF
|
||||
///
|
||||
/// see: https://github.com/Unity-Technologies/Graphics/blob/v7.5.3/com.unity.render-pipelines.universal/Editor/UniversalRenderPipelineMaterialUpgrader.cs#L354-L379
|
||||
/// </summary>
|
||||
public static class GltfPbrURPMaterialImporter
|
||||
public static class GltfPbrUrpMaterialImporter
|
||||
{
|
||||
public const string ShaderName = "Universal Render Pipeline/Lit";
|
||||
|
||||
|
||||
@@ -8,13 +8,13 @@ namespace UniGLTF
|
||||
/// <summary>
|
||||
/// GLTF の MaterialImporter
|
||||
/// </summary>
|
||||
public sealed class GltfURPMaterialDescriptorGenerator : IMaterialDescriptorGenerator
|
||||
public sealed class GltfUrpMaterialDescriptorGenerator : IMaterialDescriptorGenerator
|
||||
{
|
||||
public MaterialDescriptor Get(GltfData data, int i)
|
||||
{
|
||||
if (!GltfUnlitMaterialImporter.TryCreateParam(data, i, out var param))
|
||||
{
|
||||
if (!GltfPbrURPMaterialImporter.TryCreateParam(data, i, out param))
|
||||
if (!GltfPbrUrpMaterialImporter.TryCreateParam(data, i, out param))
|
||||
{
|
||||
// fallback
|
||||
#if VRM_DEVELOP
|
||||
|
||||
@@ -4,10 +4,10 @@ using VRMShaders;
|
||||
|
||||
namespace VRM
|
||||
{
|
||||
public sealed class VRMURPMaterialDescriptorGenerator : IMaterialDescriptorGenerator
|
||||
public sealed class VRMUrpMaterialDescriptorGenerator : IMaterialDescriptorGenerator
|
||||
{
|
||||
readonly glTF_VRM_extensions m_vrm;
|
||||
public VRMURPMaterialDescriptorGenerator(glTF_VRM_extensions vrm)
|
||||
public VRMUrpMaterialDescriptorGenerator(glTF_VRM_extensions vrm)
|
||||
{
|
||||
m_vrm = vrm;
|
||||
}
|
||||
@@ -19,7 +19,7 @@ namespace VRM
|
||||
if (!GltfUnlitMaterialImporter.TryCreateParam(data, i, out MaterialDescriptor matDesc))
|
||||
{
|
||||
// pbr "Standard" to "Universal Render Pipeline/Lit"
|
||||
if (!GltfPbrURPMaterialImporter.TryCreateParam(data, i, out matDesc))
|
||||
if (!GltfPbrUrpMaterialImporter.TryCreateParam(data, i, out matDesc))
|
||||
{
|
||||
// fallback
|
||||
#if VRM_DEVELOP
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace UniVRM10
|
||||
if (!GltfUnlitMaterialImporter.TryCreateParam(data, i, out MaterialDescriptor matDesc))
|
||||
{
|
||||
// pbr
|
||||
if (!GltfPbrURPMaterialImporter.TryCreateParam(data, i, out matDesc))
|
||||
if (!GltfPbrUrpMaterialImporter.TryCreateParam(data, i, out matDesc))
|
||||
{
|
||||
// fallback
|
||||
#if VRM_DEVELOP
|
||||
|
||||
Reference in New Issue
Block a user