Skip to content

Commit

Permalink
1.4.2
Browse files Browse the repository at this point in the history
OSX and linux file path support.
Model Import settings adjusted.
Mesh Tools only enabled on prefabs instances.
Bake material replace fix.
Eye occlusion shaders factor in color alpha channel.
  • Loading branch information
soupday committed Dec 12, 2022
1 parent 3239223 commit 05fa5e6
Show file tree
Hide file tree
Showing 17 changed files with 717 additions and 279 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
Changelog
=========

### v 1.4.2
- OSX and Linux file path support.
- Tweaked character model importer settings for better normal import and blend shape normal generation. Should reduce mesh smoothing issues.
- Disabled Menu Mesh Tools when not working on a generated prefab. (The tools cannot operate directly on an FBX)
- Fixed Bake not replacing materials with baked versions.
- Eye Occlusion shaders factor in Occlusion Color alpha value.

### v 1.4.1
- Traditional material glossiness fix.
- High poly (sub-division) hair mesh extraction fix.
Expand Down
6 changes: 3 additions & 3 deletions Editor/Compute/RLBakeShader.compute
Original file line number Diff line number Diff line change
Expand Up @@ -1448,7 +1448,7 @@ float EyeOcclusionGradient(float2 uv)
float alpha2 = saturate(smoothstep(eoTop2Min, eoTop2Max, y) * eoOcclusionStrength2);
float edge2 = ((1.0 - eoTearDuctPosition) * eoTearDuctWidth) + eoTearDuctPosition;
float tearDuctMask = (1.0 - smoothstep(eoTearDuctPosition, edge2, x));
return pow(max(alpha1, alpha2) * tearDuctMask, eoOcclusionPower);
return pow(saturate(max(alpha1, alpha2) * tearDuctMask), eoOcclusionPower);
}

[numthreads(1, 1, 1)]
Expand All @@ -1458,8 +1458,8 @@ void RLEyeOcclusionDiffuse(uint3 id : SV_DispatchThreadID)

float4 alpha = EyeOcclusionGradient(uv);
//float4 color = sRGBToLinearApprox(eoEyeOcclusionColor);
float4 color = eoEyeOcclusionColor * alpha;
color.a = alpha;
// premultiply
float4 color = eoEyeOcclusionColor * alpha;

Result[id.xy] = color;
}
Expand Down
25 changes: 13 additions & 12 deletions Editor/ComputeBake.cs
Original file line number Diff line number Diff line change
Expand Up @@ -372,25 +372,26 @@ public void BakeMaterials()
if (sourceName.iEndsWith("_2nd_Pass")) continue;

bakedMaterial = BakeHairMaterial(sharedMat, sourceName, out firstPass, out secondPass);
}

if (firstPass && secondPass)
if (firstPass && secondPass)
{
ReplaceMaterial(sharedMat, firstPass);
// Get the 2nd pass shared material
foreach (Material secondPassMat in renderer.sharedMaterials)
{
ReplaceMaterial(sharedMat, firstPass);
// Get the 2nd pass shared material
foreach (Material secondPassMat in renderer.sharedMaterials)
if (secondPassMat != sharedMat && secondPassMat.name.iEndsWith("_2nd_Pass"))
{
if (secondPassMat != sharedMat && secondPassMat.name.iEndsWith("_2nd_Pass"))
{
ReplaceMaterial(secondPassMat, secondPass);
}
ReplaceMaterial(secondPassMat, secondPass);
}
}
else if (bakedMaterial)
{
ReplaceMaterial(sharedMat, bakedMaterial);
}
}
else if (bakedMaterial)
{
ReplaceMaterial(sharedMat, bakedMaterial);
}
}

}
}
}
Expand Down
2 changes: 1 addition & 1 deletion Editor/ImporterMenu.cs
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ public static void DoTest()
{
CharacterInfo ci = ImporterWindow.Current.Character;
ComputeBake baker = new ComputeBake(ci.Fbx, ci);
Texture2D gradient = baker.BakeGradientMap("Assets\\Test", "Gradient");
Texture2D gradient = baker.BakeGradientMap("Assets" + Path.DirectorySeparatorChar + "Test", "Gradient");
}
*/
}
Expand Down
Loading

0 comments on commit 05fa5e6

Please sign in to comment.