Skip to content

Commit

Permalink
v0.511 Hotfix1
Browse files Browse the repository at this point in the history
  • Loading branch information
ozonexo3 committed Nov 22, 2017
1 parent 018d127 commit 8b7e52a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Assets/GFX/Terrain/TerrainShader.mat
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ Material:
- _DepthLevel: 1.5
- _GeneratingNormal: 0
- _Grid: 0
- _GridCamDist: 1.6312336
- _GridCamDist: 4.054913
- _GridScale: 102.4
- _HideSplat0: 0
- _HideSplat1: 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public class PropObject
public BluePrint BP;


public PropGameObject CreatePropGameObject(Vector3 position, Quaternion rotation, Vector3 scale)
public PropGameObject CreatePropGameObject(Vector3 position, Quaternion rotation, Vector3 scale, bool AllowFarLod = true)
{

PropGameObject NewProp = GameObject.Instantiate(PropsInfo.Current.PropObjectPrefab, PropsInfo.Current.PropsParent).GetComponent<PropGameObject>();
Expand All @@ -39,7 +39,7 @@ public PropGameObject CreatePropGameObject(Vector3 position, Quaternion rotation
{
NewProp.Mf1.gameObject.SetActive(false);
}
bool Lod2Exist = BP.LODs.Length > 2 && BP.LODs[2].Mesh != null;
bool Lod2Exist = AllowFarLod && BP.LODs.Length > 2 && BP.LODs[2].Mesh != null;
if (Lod2Exist)
{
NewProp.Mf2.sharedMesh = BP.LODs[2].Mesh;
Expand Down Expand Up @@ -67,13 +67,13 @@ public PropGameObject CreatePropGameObject(Vector3 position, Quaternion rotation
{
Vector3 bs = BP.LODs[1].Mesh.bounds.size;
DeltaSize = Mathf.Max(scale.x * bs.x, scale.y * bs.y, scale.z * bs.z);
Lods[1].screenRelativeTransitionHeight = DeltaSize / DecalsInfo.FrustumHeightAtDistance(25);
Lods[1].screenRelativeTransitionHeight = DeltaSize / DecalsInfo.FrustumHeightAtDistance(20);
}
if (Lod2Exist)
{
Vector3 bs = BP.LODs[2].Mesh.bounds.size;
DeltaSize = Mathf.Max(scale.x * bs.x, scale.y * bs.y, scale.z * bs.z);
Lods[2].screenRelativeTransitionHeight = DeltaSize / DecalsInfo.FrustumHeightAtDistance(60);
Lods[2].screenRelativeTransitionHeight = DeltaSize / DecalsInfo.FrustumHeightAtDistance(55);
}


Expand Down
4 changes: 3 additions & 1 deletion Assets/Scripts/UI/Tools/PropsInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,8 @@ public IEnumerator LoadProps()
int Count = Props.Count;
LoadedCount = 0;

bool AllowFarLod = Count < 10000;

for (int i = 0; i < Count; i++)
{
bool NewProp = false;
Expand Down Expand Up @@ -214,7 +216,7 @@ public IEnumerator LoadProps()
AllPropsTypes[GroupId].PropObject.CreatePropGameObject(
ScmapEditor.ScmapPosToWorld(Props[i].Position),
MassMath.QuaternionFromRotationMatrix(Props[i].RotationX, Props[i].RotationY, Props[i].RotationZ),
Props[i].Scale
Props[i].Scale, AllowFarLod
)
);

Expand Down

0 comments on commit 8b7e52a

Please sign in to comment.