Skip to content

Commit

Permalink
Remove demo dependence on project settings, add icon
Browse files Browse the repository at this point in the history
  • Loading branch information
TokisanGames committed Jul 8, 2024
1 parent 1d646d3 commit 24ac018
Show file tree
Hide file tree
Showing 9 changed files with 56 additions and 104 deletions.
10 changes: 0 additions & 10 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,16 +99,6 @@ jobs:
run: |
cp '${{ github.workspace }}/README.md' '${{ github.workspace }}/LICENSE.txt' ${{ github.workspace }}/project/addons/terrain_3d/
# - name: Upload Package
# uses: Wandalen/wretry.action@master
# with:
# action: actions/upload-artifact@v3
# attempt_limit: 3
# attempt_delay: 1000
# with: |
# name: ${{ github.event.repository.name }}
# path: ${{ github.workspace }}/project/

- name: Upload Package
uses: actions/upload-artifact@v4
with:
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ A high performance, editable terrain system for Godot 4.
* Can be accessed by GDScript, C#, and any language Godot supports
* Geometric Clipmap Mesh Terrain, as used in The Witcher 3. See [System Architecture](https://terrain3d.readthedocs.io/en/stable/docs/system_architecture.html)
* Up to 16k x 16k in 1k regions (imagine multiple islands without paying for 16k^2 vram)
* Up to 10 Levels of Detail (LODs)
* Up to 32 texture sets using albedo, normal, roughness, height
* Up to 10 Levels of Detail (LODs)
* Foliage instancing with generated or custom meshes
* Sculpting, holes, texture painting, texture detiling, painting colors and wetness
* Supports importing heightmaps from [HTerrain](https://github.com/Zylann/godot_heightmap_plugin/), WorldMachine, Unity, Unreal and any tool that can export a heightmap (raw/r16/exr/+). See [importing data](https://terrain3d.readthedocs.io/en/stable/docs/import_export.html)

Expand Down
2 changes: 1 addition & 1 deletion doc/docs/mobile_web.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ As of Terrain3D 0.9.1 and Godot 4.2, iOS is reported to work with the following

* Use textures that Godot imports (converts) such as PNG or TGA, not DDS.
* Enable `Project Settings/Rendering/Textures/VRAM Compression/Import ETC2 ASTC`.
* Set `Project Settings/Application/Config/Icon` to `res://icon.svg`.
* Set `Project Settings/Application/Config/Icon` to a valid file (eg `res://icon.png` or svg).
* The Terrain3D release includes iOS builds, however they aren't signed and may not work.
* If needed, build the iOS library and make sure the binaries are placed where identified in `terrain.gdextension`:
```
Expand Down
30 changes: 16 additions & 14 deletions project/demo/src/Player.gd
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ extends CharacterBody3D
func _physics_process(p_delta) -> void:
var direction: Vector3 = get_camera_relative_input()
var h_veloc: Vector2 = Vector2(direction.x, direction.z) * MOVE_SPEED
if Input.is_action_pressed("sprint"):
if Input.is_key_pressed(KEY_SHIFT):
h_veloc *= 2
velocity.x = h_veloc.x
velocity.z = h_veloc.y
Expand All @@ -38,17 +38,17 @@ func _physics_process(p_delta) -> void:
# Returns the input vector relative to the camera. Forward is always the direction the camera is facing
func get_camera_relative_input() -> Vector3:
var input_dir: Vector3 = Vector3.ZERO
if Input.is_action_pressed("left"):
if Input.is_key_pressed(KEY_A): # Left
input_dir -= %Camera3D.global_transform.basis.x
if Input.is_action_pressed("right"):
if Input.is_key_pressed(KEY_D): # Right
input_dir += %Camera3D.global_transform.basis.x
if Input.is_action_pressed("forward"):
if Input.is_key_pressed(KEY_W): # Forward
input_dir -= %Camera3D.global_transform.basis.z
if Input.is_action_pressed("backward"):
if Input.is_key_pressed(KEY_S): # Backward
input_dir += %Camera3D.global_transform.basis.z
if Input.is_action_pressed("up"):
if Input.is_key_pressed(KEY_E): # Up
velocity.y += JUMP_SPEED + MOVE_SPEED*.016
if Input.is_action_pressed("down"):
if Input.is_key_pressed(KEY_Q): # Down
velocity.y -= JUMP_SPEED + MOVE_SPEED*.016
if Input.is_key_pressed(KEY_KP_ADD) or Input.is_key_pressed(KEY_EQUAL):
MOVE_SPEED = clamp(MOVE_SPEED + .5, 5, 9999)
Expand All @@ -65,12 +65,14 @@ func _input(p_event: InputEvent) -> void:
MOVE_SPEED = clamp(MOVE_SPEED - 5, 5, 9999)

elif p_event is InputEventKey:
if p_event.pressed and p_event.keycode == KEY_V:
first_person = ! first_person
if p_event.pressed and p_event.keycode == KEY_G:
gravity_enabled = ! gravity_enabled
if p_event.pressed and p_event.keycode == KEY_C:
collision_enabled = ! collision_enabled
if p_event.pressed:
if p_event.keycode == KEY_V:
first_person = ! first_person
elif p_event.keycode == KEY_G:
gravity_enabled = ! gravity_enabled
elif p_event.keycode == KEY_C:
collision_enabled = ! collision_enabled

elif p_event.is_action_released("down") or p_event.is_action_released("up"):
# Else if up/down released
elif p_event.keycode == KEY_Q or p_event.keycode == KEY_E:
velocity.y = 0
Binary file added project/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
36 changes: 36 additions & 0 deletions project/icon.png.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
[remap]

importer="texture"
type="CompressedTexture2D"
uid="uid://h68cek51vakm"
path.bptc="res://.godot/imported/icon.png-487276ed1e3a0c39cad0279d744ee560.bptc.ctex"
path.astc="res://.godot/imported/icon.png-487276ed1e3a0c39cad0279d744ee560.astc.ctex"
metadata={
"imported_formats": ["s3tc_bptc", "etc2_astc"],
"vram_texture": true
}

[deps]

source_file="res://icon.png"
dest_files=["res://.godot/imported/icon.png-487276ed1e3a0c39cad0279d744ee560.bptc.ctex", "res://.godot/imported/icon.png-487276ed1e3a0c39cad0279d744ee560.astc.ctex"]

[params]

compress/mode=2
compress/high_quality=true
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=2
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1
1 change: 0 additions & 1 deletion project/icon.svg

This file was deleted.

37 changes: 0 additions & 37 deletions project/icon.svg.import

This file was deleted.

41 changes: 1 addition & 40 deletions project/project.godot
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ config_version=5
config/name="Terrain3D"
run/main_scene="res://demo/Demo.tscn"
config/features=PackedStringArray("4.2")
config/icon="res://icon.svg"
config/icon="res://icon.png"

[display]

Expand All @@ -27,45 +27,6 @@ enabled=PackedStringArray("res://addons/terrain_3d/plugin.cfg")

import/blender/enabled=false

[input]

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)
]
}
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)
]
}
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)
]
}
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)
]
}
up={
"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":69,"key_label":0,"unicode":101,"echo":false,"script":null)
, 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":32,"key_label":0,"unicode":32,"echo":false,"script":null)
]
}
down={
"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":81,"key_label":0,"unicode":113,"echo":false,"script":null)
]
}
sprint={
"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":4194325,"key_label":0,"unicode":0,"echo":false,"script":null)
]
}

[layer_names]

3d_physics/layer_1="Environment"
Expand Down

0 comments on commit 24ac018

Please sign in to comment.