EDIT modification de l'environment et post processing effets.

This commit is contained in:
osquallo 2020-04-04 11:29:45 +02:00
parent 04fa1488d0
commit 894f4d732c
40 changed files with 75 additions and 12 deletions

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 MiB

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 MiB

View file

@ -2,6 +2,7 @@ shader_type spatial;
render_mode blend_mix,depth_draw_opaque,cull_back,diffuse_burley,specular_schlick_ggx; render_mode blend_mix,depth_draw_opaque,cull_back,diffuse_burley,specular_schlick_ggx;
uniform vec4 albedo : hint_color; uniform vec4 albedo : hint_color;
uniform sampler2D texture_grass : hint_albedo; uniform sampler2D texture_grass : hint_albedo;
uniform sampler2D texture_grass_25 : hint_albedo;
uniform sampler2D texture_grass_height : hint_white; uniform sampler2D texture_grass_height : hint_white;
uniform sampler2D texture_dirt : hint_albedo; uniform sampler2D texture_dirt : hint_albedo;
uniform sampler2D texture_dirt_height : hint_black; uniform sampler2D texture_dirt_height : hint_black;
@ -38,6 +39,7 @@ uniform float angle = 0.0;
varying vec2 base_uv; varying vec2 base_uv;
varying vec2 rotated_uv; varying vec2 rotated_uv;
varying vec2 rotated_uv_mask; varying vec2 rotated_uv_mask;
varying float v_index;
vec2 rotateUVmatrinx(vec2 uv, vec2 pivot, float rotation) vec2 rotateUVmatrinx(vec2 uv, vec2 pivot, float rotation)
{ {
@ -84,12 +86,12 @@ vec3 hsv2rgb(vec3 c)
void vertex() void vertex()
{ {
base_uv=UV*uv1_scale.xy+uv1_offset.xy; base_uv=UV*uv1_scale.xy+uv1_offset.xy;
rotated_uv = rotateUVmatrinx(base_uv, vec2(0.5), (angle)); rotated_uv = rotateUVmatrinx(base_uv, vec2(0.5), (VERTEX.x));
// rotated_uv = base_uv; // rotated_uv = base_uv;
rotated_uv_mask = rotateUVmatrinx(UV, vec2(0.5), (angle)); rotated_uv_mask = rotateUVmatrinx(UV, vec2(0.5), (VERTEX.x+10.0));
// rotated_uv_mask = UV; // rotated_uv_mask = UV;
v_index = mod(VERTEX.x, 10.0);
} }
@ -99,13 +101,22 @@ void fragment()
{ {
// vec2 base_uv = UV; // vec2 base_uv = UV;
vec4 grass_tex = texture(texture_grass,base_uv); vec4 grass_tex = texture(texture_grass,base_uv);
vec4 grass_25_tex = texture(texture_grass_25,base_uv);
vec4 grass_height_tex = texture(texture_grass_height,base_uv); vec4 grass_height_tex = texture(texture_grass_height,base_uv);
vec4 dirt_tex = texture(texture_dirt,base_uv); vec4 dirt_tex = texture(texture_dirt,base_uv);
vec4 dirt_height_tex = texture(texture_dirt_height,base_uv); vec4 dirt_height_tex = texture(texture_dirt_height,base_uv);
vec4 dirt_height_hsv_tex = texture(texture_dirt_height,rotated_uv_mask); vec4 dirt_height_hsv_tex = texture(texture_dirt_height,rotated_uv_mask);
vec4 hsv_mask_tex = texture(texture_hsv_mask,UV); vec4 hsv_mask_tex = texture(texture_hsv_mask,UV);
vec4 hsv2_mask_tex = texture(texture_hsv2_mask,UV*vec2(5.0,5.0)); vec4 hsv2_mask_tex = texture(texture_hsv2_mask,UV*vec2(5.0,5.0));
vec4 albedo_mix_tex = texture(texture_albedo_mix,UV); vec4 albedo_mix_tex;
// if ( abs(v_index) > 1.28 )
// {
// albedo_mix_tex = texture(texture_hsv_mask,UV);
// }
// else
{
albedo_mix_tex = texture(texture_albedo_mix,UV);
}
vec4 mix_gradiant_tex = texture(texture_mix_gradiant,vec2( albedo_mix_tex.r, albedo_mix_tex.r )); vec4 mix_gradiant_tex = texture(texture_mix_gradiant,vec2( albedo_mix_tex.r, albedo_mix_tex.r ));
vec4 albedo_mix_tex_low = texture(texture_albedo_mix,UV*vec2(5.0,5.0)); vec4 albedo_mix_tex_low = texture(texture_albedo_mix,UV*vec2(5.0,5.0));
vec4 mix_gradiant_low_tex = texture(texture_mix_gradiant,vec2( albedo_mix_tex_low.r, albedo_mix_tex_low.r )); vec4 mix_gradiant_low_tex = texture(texture_mix_gradiant,vec2( albedo_mix_tex_low.r, albedo_mix_tex_low.r ));
@ -154,8 +165,14 @@ void fragment()
hsv_dirt.y = hsv.y*hsv_mask.z; hsv_dirt.y = hsv.y*hsv_mask.z;
hsv_dirt.z *= hsv.z*hsv_mask.z; hsv_dirt.z *= hsv.z*hsv_mask.z;
dirt_tex.rgb = hsv2rgb( hsv_dirt ); dirt_tex.rgb = hsv2rgb( hsv_dirt );
if ( mix_level >= 1.0 )
{
ALBEDO = mix( ALBEDO, dirt_tex.rgb, mix_level ); ALBEDO = mix( ALBEDO, dirt_tex.rgb, mix_level );
}
else if ( mix_level >= 0.1 )
{
ALBEDO = mix( ALBEDO, grass_25_tex.rgb, mix_level );
}
METALLIC = metallic; METALLIC = metallic;
vec4 final_roughness = mix( texture(texture_roughness,base_uv),texture(texture_roughness_dirt,base_uv), mix_level ); vec4 final_roughness = mix( texture(texture_roughness,base_uv),texture(texture_roughness_dirt,base_uv), mix_level );
ROUGHNESS = dot(final_roughness, roughness_texture_channel) * roughness; ROUGHNESS = dot(final_roughness, roughness_texture_channel) * roughness;

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.6 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 756 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.7 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 767 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.8 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 784 KiB

View file

@ -0,0 +1,5 @@
[gd_scene load_steps=2 format=2]
[ext_resource path="res://assets/decors/buildings/minaret/minaret.glb" type="PackedScene" id=1]
[node name="minaret" instance=ExtResource( 1 )]

View file

@ -1,4 +1,4 @@
[gd_scene load_steps=18 format=2] [gd_scene load_steps=19 format=2]
[ext_resource path="res://scenes/decors/terrains/demo/ground_0_0.tscn" type="PackedScene" id=1] [ext_resource path="res://scenes/decors/terrains/demo/ground_0_0.tscn" type="PackedScene" id=1]
[ext_resource path="res://scenes/decors/terrains/demo/ground_1_-1.tscn" type="PackedScene" id=2] [ext_resource path="res://scenes/decors/terrains/demo/ground_1_-1.tscn" type="PackedScene" id=2]
@ -15,6 +15,7 @@
[ext_resource path="res://assets/decors/terrains/demo/water/textures/Water_N_B.png" type="Texture" id=13] [ext_resource path="res://assets/decors/terrains/demo/water/textures/Water_N_B.png" type="Texture" id=13]
[ext_resource path="res://assets/decors/terrains/demo/water/textures/Foam.png" type="Texture" id=14] [ext_resource path="res://assets/decors/terrains/demo/water/textures/Foam.png" type="Texture" id=14]
[ext_resource path="res://assets/decors/terrains/demo/water/water.shader" type="Shader" id=15] [ext_resource path="res://assets/decors/terrains/demo/water/water.shader" type="Shader" id=15]
[ext_resource path="res://scenes/decors/buildings/minaret/minaret.tscn" type="PackedScene" id=16]
[sub_resource type="ShaderMaterial" id=1] [sub_resource type="ShaderMaterial" id=1]
shader = ExtResource( 15 ) shader = ExtResource( 15 )
@ -92,8 +93,12 @@ transform = Transform( -1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, 0, 0, -
[node name="water" type="MeshInstance" parent="."] [node name="water" type="MeshInstance" parent="."]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.074535, 0 ) transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.074535, 0 )
use_in_baked_light = true
mesh = SubResource( 2 ) mesh = SubResource( 2 )
material/0 = null material/0 = null
[node name="start_position" type="Position3D" parent="."] [node name="start_position" type="Position3D" parent="."]
transform = Transform( -0.985319, 0, 0.170725, 0, 1, 0, -0.170725, 0, -0.985319, 0, 0.315908, 1.42271 ) transform = Transform( -0.985319, 0, 0.170725, 0, 1, 0, -0.170725, 0, -0.985319, 0, 0.315908, 1.42271 )
[node name="minaret" parent="." instance=ExtResource( 16 )]
transform = Transform( 0.1, 0, 0, 0, 0.1, 0, 0, 0, 0.1, -0.962042, 0.332483, 1.08552 )

View file

@ -10,6 +10,7 @@ data = PoolVector3Array( -3.0953, 0.1603, 2.9874, -3.0753, 0.1603, 3.0074, -3.09
[node name="ground_-1_-1" instance=ExtResource( 1 )] [node name="ground_-1_-1" instance=ExtResource( 1 )]
[node name="ground_-1_-1" parent="." index="0"] [node name="ground_-1_-1" parent="." index="0"]
use_in_baked_light = true
material/0 = ExtResource( 2 ) material/0 = ExtResource( 2 )
[node name="static_body" type="StaticBody" parent="ground_-1_-1" index="0"] [node name="static_body" type="StaticBody" parent="ground_-1_-1" index="0"]

View file

@ -10,6 +10,7 @@ data = PoolVector3Array( -2.9836, 0.0061, 0.9804, -3.0036, 0.006, 1.0003, -3.002
[node name="ground_-1_0" instance=ExtResource( 1 )] [node name="ground_-1_0" instance=ExtResource( 1 )]
[node name="ground_-1_0" parent="." index="0"] [node name="ground_-1_0" parent="." index="0"]
use_in_baked_light = true
material/0 = ExtResource( 2 ) material/0 = ExtResource( 2 )
[node name="static_body" type="StaticBody" parent="ground_-1_0" index="0"] [node name="static_body" type="StaticBody" parent="ground_-1_0" index="0"]

View file

@ -10,6 +10,7 @@ data = PoolVector3Array( -2.98, 0, -1, -3, 0, -1.02, -2.98, 0, -1.02, -2.98, 0,
[node name="ground_-1_1" instance=ExtResource( 1 )] [node name="ground_-1_1" instance=ExtResource( 1 )]
[node name="ground_-1_1" parent="." index="0"] [node name="ground_-1_1" parent="." index="0"]
use_in_baked_light = true
material/0 = ExtResource( 2 ) material/0 = ExtResource( 2 )
[node name="static_body" type="StaticBody" parent="ground_-1_1" index="0"] [node name="static_body" type="StaticBody" parent="ground_-1_1" index="0"]

View file

@ -10,6 +10,7 @@ data = PoolVector3Array( -1.0366, 0.0817, 3.0041, -1.0186, 0.087, 2.9844, -1.015
[node name="ground_0_-1" instance=ExtResource( 1 )] [node name="ground_0_-1" instance=ExtResource( 1 )]
[node name="ground_0_-1" parent="." index="0"] [node name="ground_0_-1" parent="." index="0"]
use_in_baked_light = true
material/0 = ExtResource( 2 ) material/0 = ExtResource( 2 )
[node name="static_body" type="StaticBody" parent="ground_0_-1" index="0"] [node name="static_body" type="StaticBody" parent="ground_0_-1" index="0"]

View file

@ -10,6 +10,7 @@ data = PoolVector3Array( 1.2919, -0.6766, -1.0669, 1.313, -0.67, -1.0472, 1.294,
[node name="ground_0_0" instance=ExtResource( 1 )] [node name="ground_0_0" instance=ExtResource( 1 )]
[node name="ground_0_0" parent="." index="0"] [node name="ground_0_0" parent="." index="0"]
use_in_baked_light = true
material/0 = ExtResource( 2 ) material/0 = ExtResource( 2 )
[node name="static_body" type="StaticBody" parent="ground_0_0" index="0"] [node name="static_body" type="StaticBody" parent="ground_0_0" index="0"]

View file

@ -10,6 +10,7 @@ data = PoolVector3Array( -0.9993, -0.3328, -1.0002, -0.9787, -0.3425, -1.0203, -
[node name="ground_0_1" instance=ExtResource( 1 )] [node name="ground_0_1" instance=ExtResource( 1 )]
[node name="ground_0_1" parent="." index="0"] [node name="ground_0_1" parent="." index="0"]
use_in_baked_light = true
material/0 = ExtResource( 2 ) material/0 = ExtResource( 2 )
[node name="static_body" type="StaticBody" parent="ground_0_1" index="0"] [node name="static_body" type="StaticBody" parent="ground_0_1" index="0"]

View file

@ -10,6 +10,7 @@ data = PoolVector3Array( 1, 0.3078, 2.98, 1.02, 0.3085, 3, 1, 0.3058, 3, 1.02, 0
[node name="ground_1_-1" instance=ExtResource( 1 )] [node name="ground_1_-1" instance=ExtResource( 1 )]
[node name="ground_1_-1" parent="." index="0"] [node name="ground_1_-1" parent="." index="0"]
use_in_baked_light = true
material/0 = ExtResource( 2 ) material/0 = ExtResource( 2 )
[node name="static_body" type="StaticBody" parent="ground_1_-1" index="0"] [node name="static_body" type="StaticBody" parent="ground_1_-1" index="0"]

View file

@ -10,6 +10,7 @@ data = PoolVector3Array( 1.0299, 0.2651, 0.9779, 1.0083, 0.268, 0.9982, 1.0101,
[node name="ground_1_0" instance=ExtResource( 1 )] [node name="ground_1_0" instance=ExtResource( 1 )]
[node name="ground_1_0" parent="." index="0"] [node name="ground_1_0" parent="." index="0"]
use_in_baked_light = true
material/0 = ExtResource( 2 ) material/0 = ExtResource( 2 )
[node name="static_body" type="StaticBody" parent="ground_1_0" index="0"] [node name="static_body" type="StaticBody" parent="ground_1_0" index="0"]

View file

@ -10,6 +10,7 @@ data = PoolVector3Array( 1.3087, -0.6655, -1.0863, 1.3298, -0.6592, -1.0665, 1.3
[node name="ground_1_1" instance=ExtResource( 1 )] [node name="ground_1_1" instance=ExtResource( 1 )]
[node name="ground_1_1" parent="." index="0"] [node name="ground_1_1" parent="." index="0"]
use_in_baked_light = true
material/0 = ExtResource( 2 ) material/0 = ExtResource( 2 )
[node name="static_body" type="StaticBody" parent="ground_1_1" index="0"] [node name="static_body" type="StaticBody" parent="ground_1_1" index="0"]

File diff suppressed because one or more lines are too long

View file

@ -17,7 +17,7 @@ var mouse_delta = null
var camera_zoom = 0.0 var camera_zoom = 0.0
var camera_zoom_speed = 0.1 var camera_zoom_speed = 0.1
var ra = Creatures.Ra.new() var ra = Creatures.Ra_old.new()
var slot = null var slot = null