Skip to content

Commit

Permalink
Merge pull request #340 from umasteeringgroup/develop
Browse files Browse the repository at this point in the history
32bit mesh fix
  • Loading branch information
Jaimi authored Jan 5, 2021
2 parents e4276f3 + 7778faa commit 5c57fdc
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace UMA
public class UmaAboutWindow : EditorWindow
{
public static string umaVersion { get { return _version; } }
private static readonly string _version = "2.11.2";
private static readonly string _version = "2.11.3;
private string windowTitle = "UMA About";
private string wikiLink = "http://umadocs.secretanorak.com/doku.php";
private string githubLink = "https://github.com/umasteeringgroup";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -623,6 +623,10 @@ public void ApplyDataToUnityMesh(SkinnedMeshRenderer renderer, UMASkeleton skele
CreateTransforms(skeleton);

Mesh mesh = new Mesh();//renderer.sharedMesh;
#if UMA_32BITBUFFERS
mesh.indexFormat = UnityEngine.Rendering.IndexFormat.UInt32;
#endif

#if UNITY_EDITOR
if (UnityEditor.PrefabUtility.IsAddedComponentOverride(renderer))
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ public class UMASimpleLOD : MonoBehaviour
public int CurrentLOD { get { return _currentLOD - lodOffset; } }
private int _currentLOD = -1;
private float lastDist = 0.0f;
private float NextTime = 0.0f;
[Tooltip("How much time must pass before this is checked again. Default = 0.5 seconds")]
public float MinCheck = 0.5f;
[Tooltip("Random Variance in time (added to MinCheck) so that everything doesn't trigger at the same time. Default = 0.25 seconds")]
public float CheckRange = 0.25f;

private DynamicCharacterAvatar _avatar;
private UMAData _umaData;
Expand Down Expand Up @@ -102,10 +107,19 @@ public void CharacterBegun(UMAData umaData)

public void Update()
{

if (!initialized)
return;

PerformLodCheck();
if (Time.time > NextTime)
{
PerformLodCheck();
NextTime = Time.time + MinCheck;
if (CheckRange > 0.0f)
{
NextTime += UnityEngine.Random.Range(0.0f, CheckRange);
}
}
}

private void PerformLodCheck()
Expand Down Expand Up @@ -151,11 +165,8 @@ private void PerformLodCheck()
}
if (_currentLOD != currentLevel)
{
if (Mathf.Abs(cameraDistance - lastDist) > BufferZone)
{
lastDist = cameraDistance;
_currentLOD = currentLevel;
}
}

if (atlasResolutionScale < maxReductionf)
Expand Down
2 changes: 1 addition & 1 deletion UMAProject/Assets/UMA/InternalDataStore/AssetVersion.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<asset>
<name>UMA 2</name>
<author>UMA Steering Group</author>
<version>2.11.A4</version>
<version>2.11.3</version>
<notes>
-Update bone builder
-URP, HDRP Compatibility
Expand Down
Binary file not shown.
5 changes: 4 additions & 1 deletion UMAProject/Assets/UMA/Whats New in UMA.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
Whats new in 2.11.2
Whats new in 2.11.3
Fixed issue where 32 bit meshes were corrupted.
Fixed issue where LOD system could "thrash" and flipflop LOD levels.
Added time and random variation to LOD test so all checks do not happen on the same frame.

Bugfix release
Expression player fixes - now works in Edit Mode
Expand Down

0 comments on commit 5c57fdc

Please sign in to comment.