From c7c69430c907ee71d5dec9f425b33068a831701b Mon Sep 17 00:00:00 2001 From: Mark Hoekveen Date: Sun, 1 Aug 2021 17:42:39 +0200 Subject: [PATCH] Nieuwe zon. Paar files hernoemd --- Planeet.tres | 65 ++++++++++++++++++++++++++++++ Planeet.tscn | 89 +++++++++++++++++++++++++++++++++++++++++ Spatial.tscn | 100 ----------------------------------------------- default_env.tres | 7 ---- icon.png | Bin 3305 -> 0 bytes project.godot | 6 +-- 6 files changed, 155 insertions(+), 112 deletions(-) create mode 100644 Planeet.tres create mode 100644 Planeet.tscn delete mode 100644 Spatial.tscn delete mode 100644 default_env.tres delete mode 100644 icon.png diff --git a/Planeet.tres b/Planeet.tres new file mode 100644 index 0000000..26465be --- /dev/null +++ b/Planeet.tres @@ -0,0 +1,65 @@ +[gd_resource type="ShaderMaterial" load_steps=2 format=2] + +[sub_resource type="Shader" id=1] +resource_local_to_scene = true +code = "shader_type spatial; +varying vec3 world_pos; +uniform vec4 base_color : hint_color; +uniform vec4 cloud_color : hint_color; + +//Van https://github.com/yiwenl/glsl-fbm/blob/master/3d.glsl + +float mod289f(float x){return x - floor(x * (1.0 / 289.0)) * 289.0;} +vec4 mod289v4(vec4 x){return x - floor(x * (1.0 / 289.0)) * 289.0;} +vec4 perm(vec4 x){return mod289v4(((x * 34.0) + 1.0) * x);} + +float noise1(vec3 p){ + vec3 a = floor(p); + vec3 d = p - a; + d = d * d * (3.0 - 2.0 * d); + + vec4 b = a.xxyy + vec4(0.0, 1.0, 0.0, 1.0); + vec4 k1 = perm(b.xyxy); + vec4 k2 = perm(k1.xyxy + b.zzww); + + vec4 c = k2 + a.zzzz; + vec4 k3 = perm(c); + vec4 k4 = perm(c + 1.0); + + vec4 o1 = fract(k3 * (1.0 / 41.0)); + vec4 o2 = fract(k4 * (1.0 / 41.0)); + + vec4 o3 = o2 * d.z + o1 * (1.0 - d.z); + vec2 o4 = o3.yw * d.x + o3.xz * (1.0 - d.x); + + return o4.y * d.y + o4.x * (1.0 - d.y); +} + + +float fbm1(vec3 x, float t) { + float v = 0.0; + float a = 0.5; + vec3 shift = t*vec3(0.1); + for (int i = 0; i < 5; ++i) { + v += a * noise1(x*3.0); + x = x * 2.0 + shift; + a *= 0.5; + } + return v; +} + + +void vertex() { + world_pos = VERTEX; +} + +void fragment() { + ALBEDO = mix(base_color.rgb, cloud_color.rgb, cloud_color.rgb*fbm1(world_pos, TIME)); + ALBEDO = base_color.rgb + cloud_color.rgb*fbm1(world_pos, TIME); +} +" + +[resource] +shader = SubResource( 1 ) +shader_param/base_color = Color( 0.0745098, 0.215686, 0.419608, 1 ) +shader_param/cloud_color = Color( 0.580392, 0.580392, 0.580392, 1 ) diff --git a/Planeet.tscn b/Planeet.tscn new file mode 100644 index 0000000..dfcd620 --- /dev/null +++ b/Planeet.tscn @@ -0,0 +1,89 @@ +[gd_scene load_steps=9 format=2] + +[ext_resource path="res://sky.jpg" type="Texture" id=1] +[ext_resource path="res://Planeet.tres" type="Material" id=2] + +[sub_resource type="SphereMesh" id=1] +radius = 2.0 +height = 4.0 + +[sub_resource type="PanoramaSky" id=2] +panorama = ExtResource( 1 ) + +[sub_resource type="Environment" id=3] +background_mode = 2 +background_sky = SubResource( 2 ) +background_energy = 0.16 +ambient_light_color = Color( 0.262745, 0.262745, 0.262745, 1 ) +ambient_light_energy = 7.54 +auto_exposure_scale = 5.28 +auto_exposure_max_luma = 3.73 +auto_exposure_speed = 48.95 +ss_reflections_enabled = true +dof_blur_far_distance = 29.65 +dof_blur_far_transition = 0.08 +glow_enabled = true +glow_levels/1 = true +glow_levels/3 = false +glow_levels/6 = true +glow_bloom = 0.01 +glow_blend_mode = 0 +glow_bicubic_upscale = true +adjustment_enabled = true +adjustment_saturation = 1.05 + +[sub_resource type="Shader" id=4] +code = "shader_type spatial; +uniform vec4 color : hint_color; +uniform float base_strength : hint_range(1.0, 7.0, 0.1); +varying float real_strength; + +float wave(float t) { + float one = 0.06*cos(t); + float two = 0.03*cos(2.0*t+1.0); + return one+two; +} + +void vertex() { + real_strength = base_strength * wave(TIME); + VERTEX = VERTEX*base_strength; + VERTEX += VERTEX*0.5*wave(TIME); +} + +void fragment() { + EMISSION = color.rgb*base_strength; + EMISSION += EMISSION*wave(TIME)*2.0; + +}" + +[sub_resource type="ShaderMaterial" id=5] +shader = SubResource( 4 ) +shader_param/color = Color( 1, 0.996078, 0.866667, 1 ) +shader_param/base_strength = 4.0 + +[sub_resource type="SphereMesh" id=6] +material = SubResource( 5 ) + +[node name="Planeet" type="Spatial"] + +[node name="Camera" type="Camera" parent="."] +transform = Transform( 0.243869, 0, 0.969808, 0, 1, 0, -0.969808, 0, 0.243869, 6.94895, 0, 7.70599 ) +fov = 66.0 + +[node name="Planeet" type="MeshInstance" parent="."] +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0.00204706, 4.76837e-07, 0.00108433 ) +mesh = SubResource( 1 ) +material/0 = ExtResource( 2 ) + +[node name="Galaxy" type="WorldEnvironment" parent="."] +environment = SubResource( 3 ) + +[node name="Zon" type="MeshInstance" parent="."] +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -72.2436, 4.93426, 30.6297 ) +mesh = SubResource( 6 ) +material/0 = null + +[node name="Zonlamp" type="OmniLight" parent="Zon"] +light_color = Color( 1, 1, 0.956863, 1 ) +omni_range = 265.8 +omni_attenuation = 1.51572 diff --git a/Spatial.tscn b/Spatial.tscn deleted file mode 100644 index 25510d1..0000000 --- a/Spatial.tscn +++ /dev/null @@ -1,100 +0,0 @@ -[gd_scene load_steps=7 format=2] - -[ext_resource path="res://sky.jpg" type="Texture" id=1] - -[sub_resource type="SphereMesh" id=1] -radius = 2.0 -height = 4.0 - -[sub_resource type="Shader" id=5] -code = "shader_type spatial; -varying vec3 world_pos; -uniform vec4 base_color : hint_color; -uniform vec4 cloud_color : hint_color; - -//Van https://github.com/yiwenl/glsl-fbm/blob/master/3d.glsl - -float mod289f(float x){return x - floor(x * (1.0 / 289.0)) * 289.0;} -vec4 mod289v4(vec4 x){return x - floor(x * (1.0 / 289.0)) * 289.0;} -vec4 perm(vec4 x){return mod289v4(((x * 34.0) + 1.0) * x);} - -float noise1(vec3 p){ - vec3 a = floor(p); - vec3 d = p - a; - d = d * d * (3.0 - 2.0 * d); - - vec4 b = a.xxyy + vec4(0.0, 1.0, 0.0, 1.0); - vec4 k1 = perm(b.xyxy); - vec4 k2 = perm(k1.xyxy + b.zzww); - - vec4 c = k2 + a.zzzz; - vec4 k3 = perm(c); - vec4 k4 = perm(c + 1.0); - - vec4 o1 = fract(k3 * (1.0 / 41.0)); - vec4 o2 = fract(k4 * (1.0 / 41.0)); - - vec4 o3 = o2 * d.z + o1 * (1.0 - d.z); - vec2 o4 = o3.yw * d.x + o3.xz * (1.0 - d.x); - - return o4.y * d.y + o4.x * (1.0 - d.y); -} - - -float fbm1(vec3 x, float t) { - float v = 0.0; - float a = 0.5; - vec3 shift = t*vec3(0.1); - for (int i = 0; i < 5; ++i) { - v += a * noise1(x); - x = x * 2.0 + shift; - a *= 0.5; - } - return v; -} - - -void vertex() { - world_pos = VERTEX; -} - -void fragment() { - ALBEDO = smoothstep(base_color.rgb, cloud_color.rgb, cloud_color.rgb*fbm1(world_pos, TIME)); -}" - -[sub_resource type="ShaderMaterial" id=3] -shader = SubResource( 5 ) -shader_param/base_color = Color( 0.0745098, 0.215686, 0.419608, 1 ) -shader_param/cloud_color = Color( 0.580392, 0.580392, 0.580392, 1 ) - -[sub_resource type="PanoramaSky" id=6] -panorama = ExtResource( 1 ) - -[sub_resource type="Environment" id=4] -background_mode = 2 -background_sky = SubResource( 6 ) -background_energy = 0.16 -ambient_light_color = Color( 0.219608, 0.219608, 0.219608, 1 ) -auto_exposure_scale = 5.28 -auto_exposure_max_luma = 3.73 -auto_exposure_speed = 48.95 -ss_reflections_enabled = true - -[node name="Spatial" type="Spatial"] - -[node name="Camera" type="Camera" parent="."] -transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 7.28376 ) - -[node name="MeshInstance" type="MeshInstance" parent="."] -transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0.00204706, 4.76837e-07, 0.00108433 ) -mesh = SubResource( 1 ) -material/0 = SubResource( 3 ) - -[node name="WorldEnvironment" type="WorldEnvironment" parent="."] -environment = SubResource( 4 ) - -[node name="OmniLight" type="OmniLight" parent="."] -transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -4.14577, 4.93426, 5.11091 ) -light_specular = 0.86 -omni_range = 156.6 -omni_attenuation = 2.21914 diff --git a/default_env.tres b/default_env.tres deleted file mode 100644 index 20207a4..0000000 --- a/default_env.tres +++ /dev/null @@ -1,7 +0,0 @@ -[gd_resource type="Environment" load_steps=2 format=2] - -[sub_resource type="ProceduralSky" id=1] - -[resource] -background_mode = 2 -background_sky = SubResource( 1 ) diff --git a/icon.png b/icon.png deleted file mode 100644 index c98fbb601c83c81ec8c22b1dba7d1d57c62b323c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3305 zcmVNc=P)Px>qe(&U$es`gSqKCHF-lq>v1vga#%UF>TTrLR zW%{UNJKZi|Pj@Rc9GyPBD1CamMMf6SL~V^ag9~Vzut^L^0!Tv0LK0FTdnJ`x->EF(MZIP5kY*1-@^egP~7mH>({qi7{6 zQF;bN-XMq~+RzA8lI9AtJuz@PY*+{SP-Gbd@mZ(r*eE&`XO5!C>w#-pcmS28K^qzY zfTGCjor*I@ltgKb03nh#Fh$KpDL=o}gj-g4v6{}ZR1*mvXv?|gEA&Yr#r;Zw*d zUabIx8iHf+WoIO_c11Ba&!34XihSMF&C#YFDjU0)mmbXz3ex!D&t9UYp>;&R%(O(_ z*z^;&A84SWzKiQpqsdQ+Vs?rFS(f?R;c8xg_ft;Roec_~1KsVww}wzq5D}*5x6k|& zf~2A3@L4|ix|Q=L>rnmKE;B3UB=OMQxAK$Ce;LvDp?hwn-{Rn}Uo~U4IXTs4V%MQY zCWULcZFU0R%gbU;_Ef(A#76r1%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!g+OXEk`CeEj}9N zq#Ag1$#jyV_5AjYQg*!mS->;`S^;iU)ih9D+eks)H2z`1RHny;F<^CEwk+}d^k^Ph zl);*XQ|ayL;rZWh=fA(G2#AJz1&r&as9I8S@9m3Owftrb5n*)pTluK^9LHOFIo{G2 zG}l$9R*{<+L2hCsOJ~Lt6Q-rRub*8X{*4{)e}>%=_&DxOFeq1LRia4Yyj*Tyynw>F zxkKf(MiaG0*L|V-^Zhtvg-(-|F0&1rU8bqab*n5TT8~C860O$|6Rt%P1=1(EjIQZ% z;Y^PU2VC*~^2!sG?mbBPS0~0yd-+086)+rHjhfk6>CB$t`o%;=kdYF9NwiKkwbIpN z;_FlOuHQHHSZ&@fUuSI-S*t`DjsiIB z{=1M@JKVC$a8z{2;xCPfRb{~T>uo#5rL4L+z9n`rSUt3Tt nAZ`TZm+q1gPVN84&*%Ra7her>#-hHS00000NkvXXu0mjf|6N@O diff --git a/project.godot b/project.godot index 6483d03..6ca063e 100644 --- a/project.godot +++ b/project.godot @@ -11,12 +11,8 @@ config_version=4 [application] config/name="Gaz" -config/icon="res://icon.png" +run/main_scene="res://Planeet.tscn" [physics] common/enable_pause_aware_picking=true - -[rendering] - -environment/default_environment="res://default_env.tres"