Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes to work with Unity 2020. #1

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Assets/Terrain Align/Editor/Scripts/MeshProjector.cs
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ private void Init()
renderTextureDescriptions.Add(new RenderTextureDescription(RenderTextureIDs.meshHeight, GraphicsFormat.R16_UNorm, true));
renderTextureDescriptions.Add(new RenderTextureDescription(RenderTextureIDs.combinedHeightMap, GraphicsFormat.R16_UNorm, true));
renderTextureDescriptions.Add(new RenderTextureDescription(RenderTextureIDs.heightMapCurrent, GraphicsFormat.R16_UNorm, true));
renderTextureDescriptions.Add(new RenderTextureDescription(RenderTextureIDs.cameraDepthRT, GraphicsFormat.DepthAuto, false));
renderTextureDescriptions.Add(new RenderTextureDescription(RenderTextureIDs.cameraDepthRT, GraphicsFormat.None, false));

// create RT handles
m_rtCollection = new RTHandleCollection();
Expand Down Expand Up @@ -174,7 +174,7 @@ public Projector CreateProjector()
break;

default:
throw new ArgumentOutOfRangeException( "Unsupported direction: " + settings.direction);
throw new ArgumentOutOfRangeException( "Unsupported direction: " + settings.direction);
}


Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/// This class is based on the Unity Technologies Terrain Tools.
/// License:
///
/// Terrain Tools copyright � 2020 Unity Technologies ApS
///
/// Terrain Tools copyright � 2020 Unity Technologies ApS
/// Licensed under the Unity Companion License for Unity-dependent projects--see Unity Companion License.
/// Unless expressly provided otherwise, the Software under this license is made available strictly on an �AS IS� BASIS WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED. Please review the license for details on these and other terms and conditions.
/// Unless expressly provided otherwise, the Software under this license is made available strictly on an �AS IS� BASIS WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED. Please review the license for details on these and other terms and conditions.
///
/// https://docs.unity3d.com/Packages/com.unity.terrain-tools@3.0/license/LICENSE.html
///
Expand Down Expand Up @@ -67,7 +67,7 @@ public RTHandle this[ string name ]
m_Handles[ m_NameToHash[ name ] ] = value;
}
}

/// <summary>
/// RTHandleCollection constructor
/// </summary>
Expand Down Expand Up @@ -113,7 +113,7 @@ public bool ContainsRTHandle( string name )
{
return m_NameToHash.ContainsKey( name );
}

/// <summary>
/// Check to see if a RTHandle with the provided hash value exists already
/// <param name="hash">The hash or integer value used to identify a RTHandle in this RTHandleCollection</param>
Expand Down Expand Up @@ -141,6 +141,11 @@ public void GatherRTHandles( int width, int height, int depth = 0 )
foreach( int key in m_Hashes )
{
var desc = new RenderTextureDescriptor( width, height, m_Formats[ key ], depth );
if (m_Formats[key] == GraphicsFormat.None)
{
desc.colorFormat = RenderTextureFormat.Depth;
desc.depthBufferBits = 32;
}
m_Handles[ key ] = RTUtils.GetNewHandle( desc );
m_Handles[ key ].RT.Create();
}
Expand Down Expand Up @@ -224,7 +229,7 @@ public void Dispose()
public virtual void Dispose(bool dispose)
{
if(m_Disposed) return;

if(!dispose) return;

ReleaseRTHandles();
Expand Down