Skip to content

Commit

Permalink
Update demo, webgl shader
Browse files Browse the repository at this point in the history
  • Loading branch information
TokisanGames committed Dec 26, 2024
1 parent a3d6bf5 commit e4ea967
Show file tree
Hide file tree
Showing 9 changed files with 632 additions and 26 deletions.
5 changes: 4 additions & 1 deletion project/demo/Demo.tscn
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
[gd_scene load_steps=12 format=3 uid="uid://chol2xlfbq7cu"]
[gd_scene load_steps=13 format=3 uid="uid://chol2xlfbq7cu"]

[ext_resource type="Script" path="res://demo/src/DemoScene.gd" id="1_k7qca"]
[ext_resource type="PackedScene" uid="uid://d2jihfohphuue" path="res://demo/components/UI.tscn" id="2_nqak5"]
[ext_resource type="PackedScene" uid="uid://dwnhqfjq7v1pq" path="res://demo/components/Borders.tscn" id="3_cw38j"]
[ext_resource type="PackedScene" uid="uid://domhm87hbhbg1" path="res://demo/components/Player.tscn" id="3_ht63y"]
[ext_resource type="PackedScene" uid="uid://djhl3foqkj4e2" path="res://demo/components/Tunnel.tscn" id="3_kdh0b"]
[ext_resource type="PackedScene" uid="uid://bb2lp50sjndus" path="res://demo/components/Environment.tscn" id="3_yqldq"]
[ext_resource type="Shader" path="res://demo/webgl.gdshader" id="7_aubjl"]
[ext_resource type="Terrain3DAssets" uid="uid://dal3jhw6241qg" path="res://demo/data/assets.tres" id="8_g2of2"]

[sub_resource type="Gradient" id="Gradient_vr1m7"]
Expand Down Expand Up @@ -63,6 +64,8 @@ _shader_parameters = {
world_background = 2
auto_shader = true
dual_scaling = true
shader_override_enabled = true
shader_override = ExtResource("7_aubjl")

[node name="Demo" type="Node"]
script = ExtResource("1_k7qca")
Expand Down
10 changes: 4 additions & 6 deletions project/demo/assets/textures/ground037_alb_ht.png.import
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,19 @@
importer="texture"
type="CompressedTexture2D"
uid="uid://ddprscrpsofah"
path.bptc="res://.godot/imported/ground037_alb_ht.png-d854c3c88beba9927351b95063edffa2.bptc.ctex"
path.astc="res://.godot/imported/ground037_alb_ht.png-d854c3c88beba9927351b95063edffa2.astc.ctex"
path="res://.godot/imported/ground037_alb_ht.png-d854c3c88beba9927351b95063edffa2.ctex"
metadata={
"imported_formats": ["s3tc_bptc", "etc2_astc"],
"vram_texture": true
"vram_texture": false
}

[deps]

source_file="res://demo/assets/textures/ground037_alb_ht.png"
dest_files=["res://.godot/imported/ground037_alb_ht.png-d854c3c88beba9927351b95063edffa2.bptc.ctex", "res://.godot/imported/ground037_alb_ht.png-d854c3c88beba9927351b95063edffa2.astc.ctex"]
dest_files=["res://.godot/imported/ground037_alb_ht.png-d854c3c88beba9927351b95063edffa2.ctex"]

[params]

compress/mode=2
compress/mode=3
compress/high_quality=true
compress/lossy_quality=0.7
compress/hdr_compression=1
Expand Down
10 changes: 4 additions & 6 deletions project/demo/assets/textures/ground037_nrm_rgh.png.import
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,19 @@
importer="texture"
type="CompressedTexture2D"
uid="uid://c1ots7w6i0i1q"
path.bptc="res://.godot/imported/ground037_nrm_rgh.png-02372c72ee87f1844ee708d952e43e96.bptc.ctex"
path.astc="res://.godot/imported/ground037_nrm_rgh.png-02372c72ee87f1844ee708d952e43e96.astc.ctex"
path="res://.godot/imported/ground037_nrm_rgh.png-02372c72ee87f1844ee708d952e43e96.ctex"
metadata={
"imported_formats": ["s3tc_bptc", "etc2_astc"],
"vram_texture": true
"vram_texture": false
}

[deps]

source_file="res://demo/assets/textures/ground037_nrm_rgh.png"
dest_files=["res://.godot/imported/ground037_nrm_rgh.png-02372c72ee87f1844ee708d952e43e96.bptc.ctex", "res://.godot/imported/ground037_nrm_rgh.png-02372c72ee87f1844ee708d952e43e96.astc.ctex"]
dest_files=["res://.godot/imported/ground037_nrm_rgh.png-02372c72ee87f1844ee708d952e43e96.ctex"]

[params]

compress/mode=2
compress/mode=3
compress/high_quality=true
compress/lossy_quality=0.7
compress/hdr_compression=1
Expand Down
10 changes: 4 additions & 6 deletions project/demo/assets/textures/rock030_alb_ht.png.import
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,19 @@
importer="texture"
type="CompressedTexture2D"
uid="uid://br7bfxcxh60df"
path.bptc="res://.godot/imported/rock030_alb_ht.png-b99cd41791a717b81a9364ed61908c19.bptc.ctex"
path.astc="res://.godot/imported/rock030_alb_ht.png-b99cd41791a717b81a9364ed61908c19.astc.ctex"
path="res://.godot/imported/rock030_alb_ht.png-b99cd41791a717b81a9364ed61908c19.ctex"
metadata={
"imported_formats": ["s3tc_bptc", "etc2_astc"],
"vram_texture": true
"vram_texture": false
}

[deps]

source_file="res://demo/assets/textures/rock030_alb_ht.png"
dest_files=["res://.godot/imported/rock030_alb_ht.png-b99cd41791a717b81a9364ed61908c19.bptc.ctex", "res://.godot/imported/rock030_alb_ht.png-b99cd41791a717b81a9364ed61908c19.astc.ctex"]
dest_files=["res://.godot/imported/rock030_alb_ht.png-b99cd41791a717b81a9364ed61908c19.ctex"]

[params]

compress/mode=2
compress/mode=3
compress/high_quality=true
compress/lossy_quality=0.7
compress/hdr_compression=1
Expand Down
10 changes: 4 additions & 6 deletions project/demo/assets/textures/rock030_nrm_rgh.png.import
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,19 @@
importer="texture"
type="CompressedTexture2D"
uid="uid://cr72kjil43vgj"
path.bptc="res://.godot/imported/rock030_nrm_rgh.png-2cdb7838da06bcbe8c41800e68b36b1b.bptc.ctex"
path.astc="res://.godot/imported/rock030_nrm_rgh.png-2cdb7838da06bcbe8c41800e68b36b1b.astc.ctex"
path="res://.godot/imported/rock030_nrm_rgh.png-2cdb7838da06bcbe8c41800e68b36b1b.ctex"
metadata={
"imported_formats": ["s3tc_bptc", "etc2_astc"],
"vram_texture": true
"vram_texture": false
}

[deps]

source_file="res://demo/assets/textures/rock030_nrm_rgh.png"
dest_files=["res://.godot/imported/rock030_nrm_rgh.png-2cdb7838da06bcbe8c41800e68b36b1b.bptc.ctex", "res://.godot/imported/rock030_nrm_rgh.png-2cdb7838da06bcbe8c41800e68b36b1b.astc.ctex"]
dest_files=["res://.godot/imported/rock030_nrm_rgh.png-2cdb7838da06bcbe8c41800e68b36b1b.ctex"]

[params]

compress/mode=2
compress/mode=3
compress/high_quality=true
compress/lossy_quality=0.7
compress/hdr_compression=1
Expand Down
12 changes: 12 additions & 0 deletions project/demo/src/CameraManager.gd
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,18 @@ func _input(p_event: InputEvent) -> void:
rotate_camera(p_event.relative)
get_viewport().set_input_as_handled()
return
if p_event is InputEventKey and p_event.is_pressed():
if p_event.pressed:
var camera_angle: Vector2
if p_event.keycode == KEY_LEFT:
camera_angle.x -= 10
if p_event.keycode == KEY_RIGHT:
camera_angle.x += 10
if p_event.keycode == KEY_UP:
camera_angle.y -= 50
if p_event.keycode == KEY_DOWN:
camera_angle.y += 50
rotate_camera(camera_angle)


func rotate_camera(p_relative:Vector2) -> void:
Expand Down
2 changes: 1 addition & 1 deletion project/demo/src/UI.gd
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func _unhandled_key_input(p_event: InputEvent) -> void:
KEY_F11:
toggle_fullscreen()
get_viewport().set_input_as_handled()
KEY_ESCAPE:
KEY_ESCAPE, KEY_QUOTELEFT:
if Input.get_mouse_mode() == Input.MOUSE_MODE_VISIBLE:
Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED)
else:
Expand Down
Loading

0 comments on commit e4ea967

Please sign in to comment.