world: added grass and sky
This commit is contained in:
parent
42de0ed122
commit
a89b4ad168
3 changed files with 41 additions and 6 deletions
9
Shaders/SkyShader.gdshader
Normal file
9
Shaders/SkyShader.gdshader
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
shader_type sky;
|
||||
uniform vec3 skyColor : source_color;
|
||||
uniform vec3 horizonColor : source_color;
|
||||
|
||||
void sky() {
|
||||
float col = clamp(EYEDIR.y / 0.05, 0.0, 1.0);
|
||||
vec3 finalColor = mix(horizonColor,skyColor,col);
|
||||
COLOR = finalColor;
|
||||
}
|
||||
BIN
Textures/grass.jpeg
Normal file
BIN
Textures/grass.jpeg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 16 KiB |
38
main.tscn
38
main.tscn
|
|
@ -1,19 +1,40 @@
|
|||
[gd_scene load_steps=9 format=3 uid="uid://eiaw4xbs3suk"]
|
||||
[gd_scene load_steps=16 format=3 uid="uid://eiaw4xbs3suk"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://qb8cbljxgnub" path="res://world/killbrick.tscn" id="1_h2yge"]
|
||||
[ext_resource type="PackedScene" uid="uid://cfceg80unq0pe" path="res://player/player.tscn" id="1_ig7tw"]
|
||||
[ext_resource type="PackedScene" uid="uid://bcmrj6qkemrll" path="res://world/radiohead_cube.tscn" id="2_0xm2m"]
|
||||
[ext_resource type="Texture2D" uid="uid://bphpvjajrptpy" path="res://Textures/grass.jpeg" id="2_272bh"]
|
||||
[ext_resource type="PackedScene" uid="uid://of6tq8gpjxtu" path="res://gears/gear_pickup.tscn" id="3_lquwl"]
|
||||
[ext_resource type="PackedScene" uid="uid://bafl8q0r61xrg" path="res://gears/gear.tscn" id="4_7mycd"]
|
||||
[ext_resource type="Shader" uid="uid://c1fjj72syvy7l" path="res://Shaders/SkyShader.gdshader" id="7_272bh"]
|
||||
|
||||
[sub_resource type="BoxShape3D" id="BoxShape3D_7dm0k"]
|
||||
size = Vector3(100, 2, 100)
|
||||
size = Vector3(1000, 2, 1000)
|
||||
|
||||
[sub_resource type="BoxMesh" id="BoxMesh_ig7tw"]
|
||||
size = Vector3(100, 2, 100)
|
||||
size = Vector3(1000, 2, 1000)
|
||||
|
||||
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_ig7tw"]
|
||||
albedo_color = Color(0.49454, 0.79, 0.4424, 1)
|
||||
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_272bh"]
|
||||
albedo_color = Color(0, 1, 0, 1)
|
||||
albedo_texture = ExtResource("2_272bh")
|
||||
uv1_scale = Vector3(300, 300, 300)
|
||||
|
||||
[sub_resource type="ShaderMaterial" id="ShaderMaterial_272bh"]
|
||||
shader = ExtResource("7_272bh")
|
||||
shader_parameter/skyColor = Color(0.4991548, 0.59654385, 0.98058206, 1)
|
||||
shader_parameter/horizonColor = Color(0.64705884, 0.6901961, 0.8509804, 1)
|
||||
|
||||
[sub_resource type="Sky" id="Sky_7mycd"]
|
||||
sky_material = SubResource("ShaderMaterial_272bh")
|
||||
|
||||
[sub_resource type="Environment" id="Environment_7mycd"]
|
||||
background_mode = 2
|
||||
sky = SubResource("Sky_7mycd")
|
||||
sky_rotation = Vector3(6.2831855, 0, 0)
|
||||
|
||||
[sub_resource type="CameraAttributesPractical" id="CameraAttributesPractical_272bh"]
|
||||
|
||||
[sub_resource type="Compositor" id="Compositor_5vw27"]
|
||||
|
||||
[node name="Main" type="Node3D"]
|
||||
|
||||
|
|
@ -26,7 +47,7 @@ shape = SubResource("BoxShape3D_7dm0k")
|
|||
|
||||
[node name="MeshInstance3D" type="MeshInstance3D" parent="Baseplate"]
|
||||
mesh = SubResource("BoxMesh_ig7tw")
|
||||
surface_material_override/0 = SubResource("StandardMaterial3D_ig7tw")
|
||||
surface_material_override/0 = SubResource("StandardMaterial3D_272bh")
|
||||
|
||||
[node name="DirectionalLight3D" type="DirectionalLight3D" parent="."]
|
||||
transform = Transform3D(0.7071068, -0.49999994, 0.49999994, 0, 0.7071067, 0.7071067, -0.7071068, -0.49999994, 0.49999994, 50, 50, 50)
|
||||
|
|
@ -52,3 +73,8 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -12, 2, -21)
|
|||
|
||||
[node name="Gear" parent="GearPickup" instance=ExtResource("4_7mycd")]
|
||||
transform = Transform3D(1, 0, 0, 0, -0.012967386, 0.9999159, 0, -0.9999159, -0.012967386, 0, 0.5, 0)
|
||||
|
||||
[node name="WorldEnvironment" type="WorldEnvironment" parent="."]
|
||||
environment = SubResource("Environment_7mycd")
|
||||
camera_attributes = SubResource("CameraAttributesPractical_272bh")
|
||||
compositor = SubResource("Compositor_5vw27")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue