Skip to content

Commit

Permalink
Support for Godot 4.3 (#121)
Browse files Browse the repository at this point in the history
  • Loading branch information
spimort authored Aug 16, 2024
1 parent 28a2a6c commit cf421a6
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 10 deletions.
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<br>
</h1>

<h4 align="center">A minimal Terrain heightmap editor for <a href="https://godotengine.org/" target="_blank">Godot engine 4.2</a></h4>
<h4 align="center">A minimal Terrain heightmap editor for <a href="https://godotengine.org/" target="_blank">Godot engine 4.3</a></h4>

<p align="center">
<a href="https://godotengine.org/">
Expand Down Expand Up @@ -36,6 +36,12 @@ I'm happy to share it with the community but it's possible that some features th
<br>
I'm gonna be happy to accept PR for new features if it fits.

## Godot 4.2 and lower (4.x)

Starting with Godot 4.3, a breaking change has been introduced in the engine (see [this post from the Godot Team](https://godotengine.org/article/introducing-reverse-z/)). This forces TerraBrush to adapt to the new requirements.

This breaking change impacts the water shader used in the plugin. If you are still using a version before Godot 4.3, you should stick to a version of TerraBrush before 0.8.0-alpha.

## Key Features

* **Sculpt** - Sculpt your terrain with a heightmap
Expand Down
2 changes: 1 addition & 1 deletion TerraBrush.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Godot.NET.Sdk/4.2.2">
<Project Sdk="Godot.NET.Sdk/4.3.0">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework Condition=" '$(GodotTargetPlatform)' == 'android' ">net7.0</TargetFramework>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,10 @@ float fresnel(float amount, vec3 normal, vec3 view) {
}

float edge(float depth) {
depth = 2.0 * depth - 1.0;
return Near * Far / (Far + depth * (Near - Far));
// Invert the depth value
depth = 1.0 - depth;
depth = 2.0 * depth - 1.0;
return Near * Far / (Far + depth * (Near - Far));
}

void calculateWaterVertex(
Expand Down
2 changes: 1 addition & 1 deletion addons/terrabrush/plugin.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
name="TerraBrush"
description=""
author="spimort"
version="0.7.3-alpha"
version="0.8.0-alpha"
script="Plugin.cs"
10 changes: 5 additions & 5 deletions project.godot
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ config_version=5

config/name="TerraBrush"
run/main_scene="res://Demo.tscn"
config/features=PackedStringArray("4.2", "C#", "Forward Plus")
config/features=PackedStringArray("4.3", "C#", "Forward Plus")
config/icon="res://terrabrush.png"

[display]
Expand All @@ -31,22 +31,22 @@ enabled=PackedStringArray("res://addons/terrabrush/plugin.cfg")

left={
"deadzone": 0.5,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":65,"key_label":0,"unicode":97,"echo":false,"script":null)
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":65,"key_label":0,"unicode":97,"location":0,"echo":false,"script":null)
]
}
right={
"deadzone": 0.5,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":68,"key_label":0,"unicode":100,"echo":false,"script":null)
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":68,"key_label":0,"unicode":100,"location":0,"echo":false,"script":null)
]
}
forward={
"deadzone": 0.5,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":87,"key_label":0,"unicode":119,"echo":false,"script":null)
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":87,"key_label":0,"unicode":119,"location":0,"echo":false,"script":null)
]
}
backward={
"deadzone": 0.5,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":83,"key_label":0,"unicode":115,"echo":false,"script":null)
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":83,"key_label":0,"unicode":115,"location":0,"echo":false,"script":null)
]
}

Expand Down

0 comments on commit cf421a6

Please sign in to comment.