From d87edec03bd49d59bec0e5e2701c89c2164a2b95 Mon Sep 17 00:00:00 2001 From: soupday <79094830+soupday@users.noreply.github.com> Date: Mon, 29 Jul 2024 08:06:41 +0100 Subject: [PATCH] 1.6.3 --- CHANGELOG.md | 10 +++ Editor/Compute/RLBakeShader.compute | 27 ++++-- Editor/ComputeBake.cs | 32 ++++++- Editor/Importer.cs | 22 +++-- Editor/MeshUtil.cs | 105 ++++++++++++---------- Editor/Pipeline.cs | 2 +- Editor/Shader/CustomHairShaderGUI.cs | 17 ++++ Editor/WrinkleManagerBSLookup.cs | 20 +++++ Editor/WrinkleManagerBSLookup.cs.meta | 11 +++ README.md | 14 +-- Runtime/WrinkleManager.cs | 7 +- Textures/RL_DummyTex_Flow.png | Bin 0 -> 5596 bytes Textures/RL_DummyTex_Flow.png.meta | 121 ++++++++++++++++++++++++++ package.json | 2 +- 14 files changed, 318 insertions(+), 72 deletions(-) create mode 100644 Editor/WrinkleManagerBSLookup.cs create mode 100644 Editor/WrinkleManagerBSLookup.cs.meta create mode 100644 Textures/RL_DummyTex_Flow.png create mode 100644 Textures/RL_DummyTex_Flow.png.meta diff --git a/CHANGELOG.md b/CHANGELOG.md index cb44a10..ccc4bf0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,9 +1,19 @@ Changelog ========= +### 1.6.3 +- Wrinkle manager update Blend shape indices button. +- Wrinkle system setup will look for wrinkle masks in Assets as well as packages. (If tools installed into assets and not with package manager) +- Wrinkle system added to URP shader graph shaders. +- Anisotropic highlights added to URP shader graph hair shaders. +- Mesh extraction checks for duplicate blend shape names. +- URP Amplify hair shaders support for Forward+ additional lights. +- URP Amplify shaders recompiled for ASE-1.9.6 (Fixes URP17 issues). + ### 1.6.2 - URP Amplify shader fix for when there is no main light. - Work around to intermittent CC4 specular export issue when exporting with 'Bake diffuse maps from skin color' option (which is enabled by default now). +- Fix to physics assignment when shared materials count does not match submesh count. ### 1.6.1 - Magica Cloth 2 support for hair physics. diff --git a/Editor/Compute/RLBakeShader.compute b/Editor/Compute/RLBakeShader.compute index f890d94..5e500de 100644 --- a/Editor/Compute/RLBakeShader.compute +++ b/Editor/Compute/RLBakeShader.compute @@ -61,6 +61,8 @@ #pragma kernel RLChannelPackLinear #pragma kernel RLChannelPackSymmetryLinear +#pragma multi_compile _ _MAC_OS + // Defines // #define SAMPLE(tex,coord) tex.SampleLevel (sampler##tex,coord, 0) @@ -351,6 +353,8 @@ float4 LinearTosRGB(float4 In) { #ifdef UNITY_COLORSPACE_GAMMA return In; +#elif _MAC_OS + return In; #else float3 sRGBLo = In.xyz * 12.92; float3 sRGBHi = (pow(max(abs(In.xyz), 1.192092896e-07), float3(1.0 / 2.4, 1.0 / 2.4, 1.0 / 2.4)) * 1.055) - 0.055; @@ -804,7 +808,8 @@ void RLHeadMask(uint3 id : SV_DispatchThreadID) float metallic = mask.r; float ao = INVERTED_SCALE(mask.g, aoStrength) * cavityAO; - float detailMask = mask.b * subsurfaceFlattenNormals; + //float detailMask = mask.b * subsurfaceFlattenNormals; + float detailMask = mask.b; float smoothness = lerp(smoothnessMin, smoothnessMax, pow(mask.a, smoothnessPower)); smoothness = saturate((1.0 + smoothnessMod + microSmoothnessMod) * smoothness); float4 packed = float4(metallic, ao, detailMask, smoothness); @@ -864,7 +869,8 @@ void RLSkinMask(uint3 id : SV_DispatchThreadID) float metallic = mask.r; float ao = INVERTED_SCALE(mask.g, aoStrength); - float detailMask = mask.b * subsurfaceFlattenNormals; + //float detailMask = mask.b * subsurfaceFlattenNormals; + float detailMask = mask.b; float smoothness = lerp(smoothnessMin, smoothnessMax, pow(mask.a, smoothnessPower)); smoothness = saturate((1.0 + smoothnessMod + microSmoothnessMod) * smoothness); float4 packed = float4(metallic, ao, detailMask, smoothness); @@ -887,7 +893,8 @@ void RLHeadMetallicGloss(uint3 id : SV_DispatchThreadID) float metallic = mask.r; float ao = INVERTED_SCALE(mask.g, aoStrength) * cavityAO; - float detailMask = mask.b * subsurfaceFlattenNormals; + //float detailMask = mask.b * subsurfaceFlattenNormals; + float detailMask = mask.b; float smoothness = lerp(smoothnessMin, smoothnessMax, pow(mask.a, smoothnessPower)); smoothness = saturate((1.0 + smoothnessMod + microSmoothnessMod) * smoothness); float4 packed = float4(metallic, metallic, metallic, smoothness); @@ -909,7 +916,8 @@ void RLSkinMetallicGloss(uint3 id : SV_DispatchThreadID) float metallic = mask.r; float ao = INVERTED_SCALE(mask.g, aoStrength); - float detailMask = mask.b * subsurfaceFlattenNormals; + //float detailMask = mask.b * subsurfaceFlattenNormals; + float detailMask = mask.b; float smoothness = lerp(smoothnessMin, smoothnessMax, pow(mask.a, smoothnessPower)); smoothness = saturate((1.0 + smoothnessMod + microSmoothnessMod) * smoothness); float4 packed = float4(metallic, metallic, metallic, smoothness); @@ -989,11 +997,13 @@ void RLHeadNormal(uint3 id : SV_DispatchThreadID) float3 normalBlend = SAMPLE_NORMAL(NormalBlend, uv); float microScatteringMultiplier = HeadScatterMask(uv) * subsurfaceScale; float subsurface = SAMPLE(Subsurface, uv).y * microScatteringMultiplier; - float subsurfaceFlattenNormals = saturate(1.0 - (subsurface * subsurface * sssNormalSoften)); + float subsurfaceFlattenNormals = saturate(1.0 - (subsurface * subsurface * sssNormalSoften)); float3 mn, bn, on; - NormalStrength_float3(normal, normalStrength * subsurfaceFlattenNormals, mn); - NormalStrength_float3(normalBlend, normalBlendStrength * subsurfaceFlattenNormals, bn); + //NormalStrength_float3(normal, normalStrength * subsurfaceFlattenNormals, mn); + //NormalStrength_float3(normalBlend, normalBlendStrength * subsurfaceFlattenNormals, bn); + NormalStrength_float3(normal, normalStrength, mn); + NormalStrength_float3(normalBlend, normalBlendStrength, bn); NormalBlend_float3(mn, bn, on); Result[id.xy] = PackNormal(on); @@ -1011,7 +1021,8 @@ void RLSkinNormal(uint3 id : SV_DispatchThreadID) float subsurfaceFlattenNormals = saturate(1.0 - (subsurface * subsurface * sssNormalSoften)); float3 ns; - NormalStrength_float3(normal, normalStrength * subsurfaceFlattenNormals, ns); + //NormalStrength_float3(normal, normalStrength * subsurfaceFlattenNormals, ns); + NormalStrength_float3(normal, normalStrength, ns); Result[id.xy] = PackNormal(ns); } diff --git a/Editor/ComputeBake.cs b/Editor/ComputeBake.cs index 3b7dd5e..b516f8f 100644 --- a/Editor/ComputeBake.cs +++ b/Editor/ComputeBake.cs @@ -1562,10 +1562,11 @@ private Material BakeHairMaterial(Material mat, string sourceName, firstPass = null; secondPass = null; - bool useAmplify = characterInfo.BakeCustomShaders && mat.shader.name.iContains("/Amplify/"); + bool useAmplify = characterInfo.BakeCustomShaders && mat.shader.name.iContains("/Amplify/"); bool useTessellation = characterInfo.BuiltFeatureTessellation; bool useWrinkleMaps = characterInfo.BuiltFeatureWrinkleMaps; bool useDigitalHuman = characterInfo.BakeCustomShaders && mat.shader.name.iEndsWith("_DH"); + float diffuseAO = (useAmplify || (IS_URP && CUSTOM_SHADERS)) ? 0f : aoOccludeAll; Texture2D bakedBaseMap = diffuse; Texture2D bakedMaskMap = mask; @@ -1577,7 +1578,7 @@ private Material BakeHairMaterial(Material mat, string sourceName, if (enableColor) { bakedBaseMap = BakeHairDiffuseMap(diffuse, blend, id, root, mask, - diffuseStrength, alphaPower, alphaRemap, aoStrength, (useAmplify ? 0f : aoOccludeAll), + diffuseStrength, alphaPower, alphaRemap, aoStrength, diffuseAO, rootColor, rootColorStrength, endColor, endColorStrength, globalStrength, invertRootMap, baseColorStrength, highlightBlend, highlightAColor, highlightADistribution, highlightAOverlapEnd, @@ -1590,7 +1591,7 @@ private Material BakeHairMaterial(Material mat, string sourceName, else { bakedBaseMap = BakeHairDiffuseMap(diffuse, blend, mask, - diffuseStrength, alphaPower, alphaRemap, aoStrength, (useAmplify ? 0f : aoOccludeAll), + diffuseStrength, alphaPower, alphaRemap, aoStrength, diffuseAO, blendStrength, vertexBaseColor, vertexColorStrength, sourceName + "_BaseMap"); } @@ -1620,6 +1621,7 @@ private Material BakeHairMaterial(Material mat, string sourceName, Action SetCustom = (bakeMat) => { bakeMat.SetFloatIf("_AOOccludeAll", aoOccludeAll); + Debug.Log("AO Occlude All = " + aoOccludeAll); bakeMat.SetTextureIf("_FlowMap", flow); bakeMat.SetFloatIf("_FlowMapFlipGreen", flowMapFlipGreen); bakeMat.SetFloatIf("_Translucency", translucency); @@ -1914,6 +1916,12 @@ public Texture2D BakeChannelPackLinear(string folder, int kernel = bakeShader.FindKernel("RLChannelPackLinear"); bakeTarget.Create(bakeShader, kernel); + + if (Application.platform == RuntimePlatform.OSXEditor) + bakeShader.EnableKeyword("_MAC_OS"); + else + bakeShader.DisableKeyword("_MAC_OS"); + bakeShader.SetTexture(kernel, "RedChannel", redChannel); bakeShader.SetTexture(kernel, "GreenChannel", greenChannel); bakeShader.SetTexture(kernel, "BlueChannel", blueChannel); @@ -1950,6 +1958,12 @@ public Texture2D BakeChannelPackSymmetryLinear(string folder, int kernel = bakeShader.FindKernel("RLChannelPackSymmetryLinear"); bakeTarget.Create(bakeShader, kernel); + + if (Application.platform == RuntimePlatform.OSXEditor) + bakeShader.EnableKeyword("_MAC_OS"); + else + bakeShader.DisableKeyword("_MAC_OS"); + bakeShader.SetTexture(kernel, "RedChannelL", redChannelL); bakeShader.SetTexture(kernel, "GreenChannelL", greenChannelL); bakeShader.SetTexture(kernel, "BlueChannelL", blueChannelL); @@ -2193,6 +2207,12 @@ private Texture2D BakeHeadDiffuseMap(Texture2D diffuse, Texture2D blend, Texture int kernel = bakeShader.FindKernel("RLHeadDiffuse"); bakeTarget.Create(bakeShader, kernel); + + if (Application.platform == RuntimePlatform.OSXEditor) + bakeShader.EnableKeyword("_MAC_OS"); + else + bakeShader.DisableKeyword("_MAC_OS"); + bakeShader.SetTexture(kernel, "Diffuse", diffuse); bakeShader.SetTexture(kernel, "ColorBlend", blend); bakeShader.SetTexture(kernel, "CavityAO", cavityAO); @@ -2432,6 +2452,12 @@ private Texture2D BakeHeadSubsurfaceMap(Texture2D subsurface, int kernel = bakeShader.FindKernel(kernelName); bakeTarget.Create(bakeShader, kernel); + + if (Application.platform == RuntimePlatform.OSXEditor) + bakeShader.EnableKeyword("_MAC_OS"); + else + bakeShader.DisableKeyword("_MAC_OS"); + bakeShader.SetTexture(kernel, "Subsurface", subsurface); bakeShader.SetTexture(kernel, "NMUILMask", NMUIL); bakeShader.SetTexture(kernel, "CFULCMask", CFULC); diff --git a/Editor/Importer.cs b/Editor/Importer.cs index 8da5523..ed2aa3a 100644 --- a/Editor/Importer.cs +++ b/Editor/Importer.cs @@ -2040,8 +2040,9 @@ private void ConnectHQHairMaterial(GameObject obj, string sourceName, Material s mat.SetFloatIf("_BlendStrength", Mathf.Clamp01(matJson.GetFloatValue("Textures/Blend/Strength") / 100f)); mat.SetColorIf("_VertexBaseColor", Util.LinearTosRGB(matJson.GetColorValue("Custom Shader/Variable/VertexGrayToColor"))); mat.SetFloatIf("_VertexColorStrength", 1f * matJson.GetFloatValue("Custom Shader/Variable/VertexColorStrength")); - mat.SetFloatIf("_BaseColorStrength", 1f * matJson.GetFloatValue("Custom Shader/Variable/BaseColorMapStrength")); + mat.SetFloatIf("_BaseColorStrength", 1f * matJson.GetFloatValue("Custom Shader/Variable/BaseColorMapStrength")); mat.SetFloatIf("_DiffuseStrength", 1f * matJson.GetFloatValue("Custom Shader/Variable/Diffuse Strength")); + diffuseColor = Util.LinearTosRGB(matJson.GetColorValue("Diffuse Color")); mat.SetColorIf("_DiffuseColor", diffuseColor); @@ -2077,13 +2078,24 @@ private void ConnectHQHairMaterial(GameObject obj, string sourceName, Material s mat.SetFloatIf("_RimTransmissionIntensity", 0.75f * specMapStrength * Mathf.Pow(rimTransmission, 0.5f)); mat.SetFloatIf("_FlowMapFlipGreen", 1f - matJson.GetFloatValue("Custom Shader/Variable/TangentMapFlipGreen")); - mat.SetFloatIf("_SpecularShiftMin", + mat.SetFloatIf("_SpecularShiftMin", + matJson.GetFloatValue("Custom Shader/Variable/BlackColor Reflection Offset Z")); + mat.SetFloatIf("_SpecularShiftMax", + matJson.GetFloatValue("Custom Shader/Variable/WhiteColor Reflection Offset Z")); + } + else if (RP == RenderPipeline.URP && !USE_AMPLIFY_SHADER) + { + mat.SetFloatIf("_DiffuseStrength", 1.15f * matJson.GetFloatValue("Custom Shader/Variable/Diffuse Strength")); + mat.SetFloatIf("_SmoothnessMin", 0f); + mat.SetFloatIf("_SpecularMultiplier", Mathf.Lerp(0.1f, 0.5f, specMapStrength * specStrength)); + mat.SetFloatIf("_FlowMapFlipGreen", 1f - matJson.GetFloatValue("Custom Shader/Variable/TangentMapFlipGreen")); + mat.SetFloatIf("_SpecularShiftMin", matJson.GetFloatValue("Custom Shader/Variable/BlackColor Reflection Offset Z")); mat.SetFloatIf("_SpecularShiftMax", - matJson.GetFloatValue("Custom Shader/Variable/WhiteColor Reflection Offset Z")); + matJson.GetFloatValue("Custom Shader/Variable/WhiteColor Reflection Offset Z")); } else - { + { if (USE_AMPLIFY_SHADER) { SetFloatPowerRange(mat, "_SmoothnessMin", smoothnessStrength, 0f, smoothnessMax, smoothnessPowerMod); @@ -2097,7 +2109,7 @@ private void ConnectHQHairMaterial(GameObject obj, string sourceName, Material s matJson.GetFloatValue("Custom Shader/Variable/WhiteColor Reflection Offset Z")); } else - { + { mat.SetFloatIf("_SmoothnessMin", Util.CombineSpecularToSmoothness(specMapStrength * specStrength, smoothnessStrength)); } } diff --git a/Editor/MeshUtil.cs b/Editor/MeshUtil.cs index c4d8980..d365eff 100644 --- a/Editor/MeshUtil.cs +++ b/Editor/MeshUtil.cs @@ -21,6 +21,7 @@ using UnityEngine.Rendering; using System.IO; using System.Collections.Generic; +using UnityEngine.AI; namespace Reallusion.Import { @@ -324,18 +325,20 @@ public static void PruneBlendShapes(Object obj) for (int i = 0; i < srcMesh.blendShapeCount; i++) { string name = srcMesh.GetBlendShapeName(i); - - int frameCount = srcMesh.GetBlendShapeFrameCount(i); - for (int f = 0; f < frameCount; f++) + if (dstMesh.GetBlendShapeIndex(name) == -1) { - float frameWeight = srcMesh.GetBlendShapeFrameWeight(i, f); - srcMesh.GetBlendShapeFrameVertices(i, f, deltaVerts, deltaNormals, deltaTangents); + int frameCount = srcMesh.GetBlendShapeFrameCount(i); + for (int f = 0; f < frameCount; f++) + { + float frameWeight = srcMesh.GetBlendShapeFrameWeight(i, f); + srcMesh.GetBlendShapeFrameVertices(i, f, deltaVerts, deltaNormals, deltaTangents); - Vector3 deltaSum = Vector3.zero; - for (int d = 0; d < srcMesh.vertexCount; d++) deltaSum += deltaVerts[d]; + Vector3 deltaSum = Vector3.zero; + for (int d = 0; d < srcMesh.vertexCount; d++) deltaSum += deltaVerts[d]; - if (deltaSum.magnitude > 0.1f) - dstMesh.AddBlendShapeFrame(name, frameWeight, deltaVerts, deltaNormals, deltaTangents); + if (deltaSum.magnitude > 0.1f) + dstMesh.AddBlendShapeFrame(name, frameWeight, deltaVerts, deltaNormals, deltaTangents); + } } } } @@ -394,13 +397,15 @@ public static Mesh CopyMesh(Mesh srcMesh) for (int i = 0; i < srcMesh.blendShapeCount; i++) { string name = srcMesh.GetBlendShapeName(i); - - int frameCount = srcMesh.GetBlendShapeFrameCount(i); - for (int f = 0; f < frameCount; f++) + if (dstMesh.GetBlendShapeIndex(name) == -1) { - float frameWeight = srcMesh.GetBlendShapeFrameWeight(i, f); - srcMesh.GetBlendShapeFrameVertices(i, f, bufVerts, bufNormals, bufTangents); - dstMesh.AddBlendShapeFrame(name, frameWeight, bufVerts, bufNormals, bufTangents); + int frameCount = srcMesh.GetBlendShapeFrameCount(i); + for (int f = 0; f < frameCount; f++) + { + float frameWeight = srcMesh.GetBlendShapeFrameWeight(i, f); + srcMesh.GetBlendShapeFrameVertices(i, f, bufVerts, bufNormals, bufTangents); + dstMesh.AddBlendShapeFrame(name, frameWeight, bufVerts, bufNormals, bufTangents); + } } } } @@ -471,13 +476,15 @@ public static void ReverseTriangleOrder(Object obj) for (int i = 0; i < srcMesh.blendShapeCount; i++) { string name = srcMesh.GetBlendShapeName(i); - - int frameCount = srcMesh.GetBlendShapeFrameCount(i); - for (int f = 0; f < frameCount; f++) + if (dstMesh.GetBlendShapeIndex(name) == -1) { - float frameWeight = srcMesh.GetBlendShapeFrameWeight(i, f); - srcMesh.GetBlendShapeFrameVertices(i, f, bufVerts, bufNormals, bufTangents); - dstMesh.AddBlendShapeFrame(name, frameWeight, bufVerts, bufNormals, bufTangents); + int frameCount = srcMesh.GetBlendShapeFrameCount(i); + for (int f = 0; f < frameCount; f++) + { + float frameWeight = srcMesh.GetBlendShapeFrameWeight(i, f); + srcMesh.GetBlendShapeFrameVertices(i, f, bufVerts, bufNormals, bufTangents); + dstMesh.AddBlendShapeFrame(name, frameWeight, bufVerts, bufNormals, bufTangents); + } } } } @@ -839,23 +846,29 @@ public static Mesh ExtractSubMesh(Mesh srcMesh, int index) for (int i = 0; i < srcMesh.blendShapeCount; i++) { string name = srcMesh.GetBlendShapeName(i); - - int frameCount = srcMesh.GetBlendShapeFrameCount(i); - for (int f = 0; f < frameCount; f++) + if (newMesh.GetBlendShapeIndex(name) == -1) { - float frameWeight = srcMesh.GetBlendShapeFrameWeight(i, f); - srcMesh.GetBlendShapeFrameVertices(i, f, bufVerts, bufNormals, bufTangents); - for (int vertIndex = 0; vertIndex < maxVerts; vertIndex++) + int frameCount = srcMesh.GetBlendShapeFrameCount(i); + for (int f = 0; f < frameCount; f++) { - int remappedIndex = remapping[vertIndex]; - if (remappedIndex >= 0) + float frameWeight = srcMesh.GetBlendShapeFrameWeight(i, f); + srcMesh.GetBlendShapeFrameVertices(i, f, bufVerts, bufNormals, bufTangents); + for (int vertIndex = 0; vertIndex < maxVerts; vertIndex++) { - frameVerts[remappedIndex] = bufVerts[vertIndex]; - frameNormals[remappedIndex] = bufNormals[vertIndex]; - frameTangents[remappedIndex] = bufTangents[vertIndex]; + int remappedIndex = remapping[vertIndex]; + if (remappedIndex >= 0) + { + frameVerts[remappedIndex] = bufVerts[vertIndex]; + frameNormals[remappedIndex] = bufNormals[vertIndex]; + frameTangents[remappedIndex] = bufTangents[vertIndex]; + } } + newMesh.AddBlendShapeFrame(name, frameWeight, frameVerts, frameNormals, frameTangents); } - newMesh.AddBlendShapeFrame(name, frameWeight, frameVerts, frameNormals, frameTangents); + } + else + { + Util.LogWarn("Blend shape: " + name + " has duplicate name, already exists in mesh!"); } } } @@ -1005,23 +1018,25 @@ public static Mesh RemoveSubMeshes(Mesh srcMesh, List indices) for (int i = 0; i < srcMesh.blendShapeCount; i++) { string name = srcMesh.GetBlendShapeName(i); - - int frameCount = srcMesh.GetBlendShapeFrameCount(i); - for (int f = 0; f < frameCount; f++) + if (newMesh.GetBlendShapeIndex(name) == -1) { - float frameWeight = srcMesh.GetBlendShapeFrameWeight(i, f); - srcMesh.GetBlendShapeFrameVertices(i, f, bufVerts, bufNormals, bufTangents); - for (int vertIndex = 0; vertIndex < maxVerts; vertIndex++) + int frameCount = srcMesh.GetBlendShapeFrameCount(i); + for (int f = 0; f < frameCount; f++) { - int remappedIndex = remapping[vertIndex]; - if (remappedIndex >= 0) + float frameWeight = srcMesh.GetBlendShapeFrameWeight(i, f); + srcMesh.GetBlendShapeFrameVertices(i, f, bufVerts, bufNormals, bufTangents); + for (int vertIndex = 0; vertIndex < maxVerts; vertIndex++) { - frameVerts[remappedIndex] = bufVerts[vertIndex]; - frameNormals[remappedIndex] = bufNormals[vertIndex]; - frameTangents[remappedIndex] = bufTangents[vertIndex]; + int remappedIndex = remapping[vertIndex]; + if (remappedIndex >= 0) + { + frameVerts[remappedIndex] = bufVerts[vertIndex]; + frameNormals[remappedIndex] = bufNormals[vertIndex]; + frameTangents[remappedIndex] = bufTangents[vertIndex]; + } } + newMesh.AddBlendShapeFrame(name, frameWeight, frameVerts, frameNormals, frameTangents); } - newMesh.AddBlendShapeFrame(name, frameWeight, frameVerts, frameNormals, frameTangents); } } } diff --git a/Editor/Pipeline.cs b/Editor/Pipeline.cs index f6b263a..47563be 100644 --- a/Editor/Pipeline.cs +++ b/Editor/Pipeline.cs @@ -40,7 +40,7 @@ public enum MaterialQuality { None, Default, High, Baked } public static class Pipeline { - public const string VERSION = "1.6.2"; + public const string VERSION = "1.6.3"; #if HDRP_10_5_0_OR_NEWER // version diff --git a/Editor/Shader/CustomHairShaderGUI.cs b/Editor/Shader/CustomHairShaderGUI.cs index 483ecaf..f936b21 100644 --- a/Editor/Shader/CustomHairShaderGUI.cs +++ b/Editor/Shader/CustomHairShaderGUI.cs @@ -102,6 +102,23 @@ private bool SetFloatIfSourcesAgree(Material from, string prop) } } + if (prop == "BOOLEAN_ANISOTROPIC") + { + for (int i = 0; i < sources.Length; i++) + { + if (value == 1f) + { + if (pass1[i]) pass1[i].EnableKeyword("BOOLEAN_ANISOTROPIC_ON"); + if (pass2[i]) pass2[i].EnableKeyword("BOOLEAN_ANISOTROPIC_ON"); + } + else + { + if (pass1[i]) pass1[i].DisableKeyword("BOOLEAN_ANISOTROPIC_ON"); + if (pass2[i]) pass2[i].DisableKeyword("BOOLEAN_ANISOTROPIC_ON"); + } + } + } + return true; } diff --git a/Editor/WrinkleManagerBSLookup.cs b/Editor/WrinkleManagerBSLookup.cs new file mode 100644 index 0000000..84b255a --- /dev/null +++ b/Editor/WrinkleManagerBSLookup.cs @@ -0,0 +1,20 @@ + +using UnityEngine; +using UnityEditor; +using Reallusion.Import; + +[CustomEditor(typeof(WrinkleManager))] +public class WrinkleManagerEditor : Editor +{ + public override void OnInspectorGUI() + { + base.OnInspectorGUI(); // Draw the default inspector + + WrinkleManager wrinkleManager = (WrinkleManager)target; + + if (GUILayout.Button("Update BlendShape Indices")) + { + wrinkleManager.UpdateBlendShapeIndices(); // Assuming this is a public method + } + } +} diff --git a/Editor/WrinkleManagerBSLookup.cs.meta b/Editor/WrinkleManagerBSLookup.cs.meta new file mode 100644 index 0000000..ab61be1 --- /dev/null +++ b/Editor/WrinkleManagerBSLookup.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 49168bcfa4eeda746964dd6f33e8c74c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/README.md b/README.md index e7daf7b..1f3f126 100644 --- a/README.md +++ b/README.md @@ -17,25 +17,25 @@ Links [HDRP Version](https://github.com/soupday/cc_unity_tools_HDRP) Note: There are two verions of the HDRP package -- [**CC Unity Tools HDRP10**](https://github.com/soupday/cc_unity_tools_HDRP/releases/tag/1.6.2.HDRP10) for Unity 2020.3+ -- [**CC Unity Tools HDRP12**](https://github.com/soupday/cc_unity_tools_HDRP/releases/tag/1.6.2.HDRP12) for Unity 2021.2+ +- [**CC Unity Tools HDRP10**](https://github.com/soupday/cc_unity_tools_HDRP/releases/tag/1.6.3.HDRP10) for Unity 2020.3+ +- [**CC Unity Tools HDRP12**](https://github.com/soupday/cc_unity_tools_HDRP/releases/tag/1.6.3.HDRP12) for Unity 2021.2+ The main repository contains the HDRP10 version. See the releases page for the HDRP12 version. [URP Version](https://github.com/soupday/cc_unity_tools_URP) Note: There are four verions of the URP package -- [**CC Unity Tools URP10**](https://github.com/soupday/cc_unity_tools_URP/releases/tag/1.6.2.URP10) for Unity 2020.3+ -- [**CC Unity Tools URP12**](https://github.com/soupday/cc_unity_tools_URP/releases/tag/1.6.2.URP12) for Unity 2021.2+ -- [**CC Unity Tools URP14**](https://github.com/soupday/cc_unity_tools_URP/releases/tag/1.6.2.URP14) for Unity 2022.3+ -- [**CC Unity Tools URP15**](https://github.com/soupday/cc_unity_tools_URP/releases/tag/1.6.2.URP15) for Unity 2023.1+ +- [**CC Unity Tools URP10**](https://github.com/soupday/cc_unity_tools_URP/releases/tag/1.6.3.URP10) for Unity 2020.3+ +- [**CC Unity Tools URP12**](https://github.com/soupday/cc_unity_tools_URP/releases/tag/1.6.3.URP12) for Unity 2021.2+ +- [**CC Unity Tools URP14**](https://github.com/soupday/cc_unity_tools_URP/releases/tag/1.6.3.URP14) for Unity 2022.3+ +- [**CC Unity Tools URP15**](https://github.com/soupday/cc_unity_tools_URP/releases/tag/1.6.3.URP15) for Unity 2023.1+ The main repository contains the URP10 version. See the releases page for the URP12/14/15 version. [3D/Built-in Version](https://github.com/soupday/cc_unity_tools_3D) The built-in pipeline version is for Unity 2019.4 and upwards. -- [**CC Unity Tools 3D**](https://github.com/soupday/cc_unity_tools_3D/releases/tag/1.6.2) for Unity 2019.4+ +- [**CC Unity Tools 3D**](https://github.com/soupday/cc_unity_tools_3D/releases/tag/1.6.3) for Unity 2019.4+ How it works ============ diff --git a/Runtime/WrinkleManager.cs b/Runtime/WrinkleManager.cs index ee78be3..14d8440 100644 --- a/Runtime/WrinkleManager.cs +++ b/Runtime/WrinkleManager.cs @@ -594,8 +594,11 @@ public void BuildConfig(Dictionary props = null, float over UpdateBlendShapeIndices(); } - - private void UpdateBlendShapeIndices() + + /// + /// Update the blend shape indices for the wrinkle configurations. + /// + public void UpdateBlendShapeIndices() { if (skinnedMeshRenderer && headMaterial) { diff --git a/Textures/RL_DummyTex_Flow.png b/Textures/RL_DummyTex_Flow.png new file mode 100644 index 0000000000000000000000000000000000000000..1bd5321a113adc62366eb3c5be4ada112b9cae0c GIT binary patch literal 5596 zcmeHLd0Z3M7EVAG5f#)Hm#8sPTwt;Xk~|_p2oNO@7HhzDGMT_gk_nT6L?|MPTT!0i zTDPawQl-=`PX(kcjYX@)ij-fUuPsFDpv%$k9&ux*sM*xJr%1x)~Oixqn~%l?kyRqw)*&! zyfPUlcX&=k{^T6*{n~vEeuqsR_ojv&iMVf7Ty)u!(faiRk2xiGkECyJKBB0u`jGK< z<%gCFto&)pwg1$=Ul^Pztan3JSq68tHJxp&3R2`qet9wU#^2xY-rhcASie5XgqDnzdmn@4x3y{RE!M>^foQ3{IRmVDjL5E zXVrgK8ur3>HTm|3>obvHZ3xa-XJ=1xP)s$P*9+$QDM`TAvW{e2kA-N-$6~7;) zvBlzVH}K1^Cag7{TlT|yCsv-lIU!j0Wr1>ndrSBl>8#P@!H*J_uUQix{LATe=qW~! zSID~oh4e+c?E#9T;=3VruTDQ*2_3o*Wz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V?d00001 diff --git a/Textures/RL_DummyTex_Flow.png.meta b/Textures/RL_DummyTex_Flow.png.meta new file mode 100644 index 0000000..54f4b96 --- /dev/null +++ b/Textures/RL_DummyTex_Flow.png.meta @@ -0,0 +1,121 @@ +fileFormatVersion: 2 +guid: 5a64e3ddb10bbe34193f8307639ee61b +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 12 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + sRGBTexture: 0 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + vTOnly: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 1 + aniso: 1 + mipBias: 0 + wrapU: 0 + wrapV: 0 + wrapW: 0 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 0 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + ignorePngGamma: 0 + applyGammaDecoding: 0 + cookieLightType: 1 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: WebGL + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/package.json b/package.json index 5958b01..3cf50fc 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "com.soupday.cc3_unity_tools", - "version": "1.6.2", + "version": "1.6.3", "displayName": "CC/iC Unity Tools HDRP", "description": "Unity importer for Character Creator 3 & 4 and iClone 7 and 8.", "unity": "2020.3",