Fix Large Terrain Performance Issues #10

Merged
kayomn merged 5 commits from large-terrain-performance-fix into main 2023-01-23 21:32:19 +01:00
Owner

While this closes #3 , this also resolves another issue that has not currently been raised regarding the overhead of real-time editing DynamicTerrainInstance3Ds with a large size.

Performance drops significantly because of how a large texture has to be re-uploaded to the GPU, causing a sync point, every frame.

This PR aims to address the problem by using ViewportTextures over ImageTextures for the real-time editing of the terrain map texture used by the terrain instance.

This also subsequently retires the use of DynamicTerrainInstance3D in favor of a new interface for editing the terrain map in real-time called MapEditorTerrainData.

While this closes #3 ~~, this also resolves another issue that has not currently been raised regarding the overhead of real-time editing `DynamicTerrainInstance3D`s with a large size.~~ ~~Performance drops significantly because of how a large texture has to be re-uploaded to the GPU, causing a sync point, every frame.~~ ~~This PR aims to address the problem by using `ViewportTextures` over `ImageTextures` for the real-time editing of the terrain map texture used by the terrain instance.~~ ~~This also subsequently retires the use of `DynamicTerrainInstance3D` in favor of a new interface for editing the terrain map in real-time called `MapEditorTerrainData`.~~
kayomn changed title from Fix Large Terrain Performance Issues to WIP: Fix Large Terrain Performance Issues 2023-01-23 00:04:31 +01:00
kayomn self-assigned this 2023-01-23 00:04:39 +01:00
kayomn added this to the Editor Iteration 1 milestone 2023-01-23 00:04:42 +01:00
Author
Owner

A better and less-disruptive solution would actually be to use RenderingServer.texture_2d_update_partial(), however that won't happen until https://github.com/godotengine/godot/issues/65762 is resolved.

Narrowing down the focus of this PR to just being about closing #3.

A better and less-disruptive solution would actually be to use `RenderingServer.texture_2d_update_partial()`, however that won't happen until https://github.com/godotengine/godot/issues/65762 is resolved. Narrowing down the focus of this PR to just being about closing #3.
kayomn added 2 commits 2023-01-23 19:29:02 +01:00
kayomn added 1 commit 2023-01-23 21:16:39 +01:00
kayomn changed title from WIP: Fix Large Terrain Performance Issues to Fix Large Terrain Performance Issues 2023-01-23 21:18:00 +01:00
kayomn reviewed 2023-01-23 21:24:41 +01:00
@ -0,0 +12,4 @@
##
##
##
var size := Vector2i.ONE:
Author
Owner

Missing doc comment.

Missing doc comment.
kayomn marked this conversation as resolved
@ -0,0 +39,4 @@
##
##
##
func get_texture() -> void:
Author
Owner

Missing doc comment.

Missing doc comment.
kayomn marked this conversation as resolved
@ -6,1 +5,4 @@
const _SHADER := preload("res://terrain/terrain.gdshader")
enum PaintSlot {
Author
Owner

Is this enum used anywhere anymore?

Is this enum used anywhere anymore?
kayomn marked this conversation as resolved
kayomn added 1 commit 2023-01-23 21:29:54 +01:00
kayomn added 1 commit 2023-01-23 21:31:37 +01:00
kayomn merged commit 9cd33db1dd into main 2023-01-23 21:32:19 +01:00
kayomn deleted branch large-terrain-performance-fix 2023-01-23 21:32:19 +01:00
Sign in to join this conversation.
No reviewers
No Label
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: protectorate/game#10
No description provided.