Skip to content

Commit

Permalink
Merge pull request #1012 from wave-harmonic/misc/edit-mode-queries
Browse files Browse the repository at this point in the history
Re-enable height queries in edit mode
  • Loading branch information
daleeidd authored May 3, 2022
2 parents fe794c7 + bc01d9e commit 1203189
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
7 changes: 6 additions & 1 deletion crest/Assets/Crest/Crest/Scripts/OceanRenderer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,10 @@ public enum SurfaceSelfIntersectionFixMode
bool _followSceneCamera = true;
#pragma warning restore 414

[Tooltip("Whether height queries are enabled in edit mode."), SerializeField]
bool _heightQueries = true;


[Header("Server Settings")]
[Tooltip("Emulate batch mode which models running without a display (but with a GPU available). Equivalent to running standalone build with -batchmode argument."), SerializeField]
bool _forceBatchMode = false;
Expand Down Expand Up @@ -1021,7 +1025,8 @@ void RunUpdate()
#if UNITY_EDITOR
// Issue #630 - seems to be a terrible memory leak coming from creating async gpu readbacks. We don't rely on queries in edit mode AFAIK
// so knock this out.
if (EditorApplication.isPlaying)
// This was marked as resolved by Unity and confirmed fixed by forum posts.
if (_heightQueries || EditorApplication.isPlaying)
#endif
{
CollisionProvider?.UpdateQueries();
Expand Down
9 changes: 9 additions & 0 deletions docs/about/history.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,14 @@ Release Notes
|version|
---------

Changed
^^^^^^^
.. bullet_list::

- Re-enable height queries in edit-mode which allows several height based components to work in edit-mode.
They can still be disabled with the new *Height Queries* toggle on the *Ocean Renderer*.


Fixed
^^^^^
.. bullet_list::
Expand All @@ -25,6 +33,7 @@ Fixed
- Fix several material and mesh memory leaks and reference leaks.
- Fix several *Texture2D* and *RenderTexture* memory and reference leaks.
- Fix excessively long build times when no *Underwater Renderer* is present in scene.
- Fix *Underwater Renderer* not working with varying water level.

.. only:: birp

Expand Down

0 comments on commit 1203189

Please sign in to comment.