Initial commit
This commit is contained in:
commit
7514598acc
18 changed files with 201 additions and 0 deletions
Binary file not shown.
|
@ -0,0 +1,3 @@
|
|||
source_md5="d9af9f79de549eca6d954487ab638c1c"
|
||||
dest_md5="15ee69c90e911f7ea7f726de40e4394c"
|
||||
|
Binary file not shown.
Binary file not shown.
3
.import/icon.png-487276ed1e3a0c39cad0279d744ee560.md5
Normal file
3
.import/icon.png-487276ed1e3a0c39cad0279d744ee560.md5
Normal file
|
@ -0,0 +1,3 @@
|
|||
source_md5="0167658bc4406f0d0fe437e0197c415a"
|
||||
dest_md5="64b0613b3173e1e1c96dd18b6569e62d"
|
||||
|
BIN
.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex
Normal file
BIN
.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex
Normal file
Binary file not shown.
8
base_ground.gd
Normal file
8
base_ground.gd
Normal file
|
@ -0,0 +1,8 @@
|
|||
tool
|
||||
extends Spatial
|
||||
|
||||
export( Color ) var color = Color( 1.0, 1.0, 1.0, 1.0 ) setget set_shader_albedo
|
||||
|
||||
func set_shader_albedo( value ):
|
||||
color = value
|
||||
$textured_ground.get_surface_material( 0 ).set_shader_param("albedo", self.color)
|
17
base_ground.tscn
Normal file
17
base_ground.tscn
Normal file
|
@ -0,0 +1,17 @@
|
|||
[gd_scene load_steps=4 format=2]
|
||||
|
||||
[ext_resource path="res://base_rainboxing.tres" type="Material" id=1]
|
||||
[ext_resource path="res://base_ground.gd" type="Script" id=2]
|
||||
|
||||
[sub_resource type="PlaneMesh" id=1]
|
||||
|
||||
[node name="base_ground" type="Spatial"]
|
||||
script = ExtResource( 2 )
|
||||
color = Color( 0.93, 0.4929, 0.4929, 1 )
|
||||
|
||||
[node name="textured_ground" type="MeshInstance" parent="."]
|
||||
mesh = SubResource( 1 )
|
||||
material/0 = ExtResource( 1 )
|
||||
__meta__ = {
|
||||
"_editor_description_": ""
|
||||
}
|
12
base_rainboxing.tres
Normal file
12
base_rainboxing.tres
Normal file
|
@ -0,0 +1,12 @@
|
|||
[gd_resource type="ShaderMaterial" load_steps=3 format=2]
|
||||
|
||||
[ext_resource path="res://basic_texture_1024.png" type="Texture" id=1]
|
||||
[ext_resource path="res://rainboxing.shader" type="Shader" id=2]
|
||||
|
||||
[resource]
|
||||
resource_local_to_scene = true
|
||||
shader = ExtResource( 2 )
|
||||
shader_param/albedo = Color( 0.93, 0.4929, 0.4929, 1 )
|
||||
shader_param/scale = 1.0
|
||||
shader_param/uv1_offset = Vector3( 0, 0, 0 )
|
||||
shader_param/grid_texture = ExtResource( 1 )
|
BIN
basic_texture_1024.png
Normal file
BIN
basic_texture_1024.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 29 KiB |
36
basic_texture_1024.png.import
Normal file
36
basic_texture_1024.png.import
Normal file
|
@ -0,0 +1,36 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path.s3tc="res://.import/basic_texture_1024.png-125fe46c9b5fe8c3494a771c6fb2ed11.s3tc.stex"
|
||||
path.etc2="res://.import/basic_texture_1024.png-125fe46c9b5fe8c3494a771c6fb2ed11.etc2.stex"
|
||||
metadata={
|
||||
"imported_formats": [ "s3tc", "etc2" ],
|
||||
"vram_texture": true
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://basic_texture_1024.png"
|
||||
dest_files=[ "res://.import/basic_texture_1024.png-125fe46c9b5fe8c3494a771c6fb2ed11.s3tc.stex", "res://.import/basic_texture_1024.png-125fe46c9b5fe8c3494a771c6fb2ed11.etc2.stex" ]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=2
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=true
|
||||
flags/filter=true
|
||||
flags/mipmaps=true
|
||||
flags/anisotropic=false
|
||||
flags/srgb=1
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
process/invert_color=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=false
|
||||
svg/scale=1.0
|
7
default_env.tres
Normal file
7
default_env.tres
Normal file
|
@ -0,0 +1,7 @@
|
|||
[gd_resource type="Environment" load_steps=2 format=2]
|
||||
|
||||
[sub_resource type="ProceduralSky" id=1]
|
||||
|
||||
[resource]
|
||||
background_mode = 2
|
||||
background_sky = SubResource( 1 )
|
BIN
icon.png
Normal file
BIN
icon.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 3.4 KiB |
34
icon.png.import
Normal file
34
icon.png.import
Normal file
|
@ -0,0 +1,34 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://icon.png"
|
||||
dest_files=[ "res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex" ]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=true
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
process/invert_color=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=true
|
||||
svg/scale=1.0
|
16
main.tscn
Normal file
16
main.tscn
Normal file
|
@ -0,0 +1,16 @@
|
|||
[gd_scene load_steps=2 format=2]
|
||||
|
||||
[ext_resource path="res://base_ground.tscn" type="PackedScene" id=1]
|
||||
|
||||
[node name="Main" type="Spatial"]
|
||||
|
||||
[node name="base_ground" parent="." instance=ExtResource( 1 )]
|
||||
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 3, 0, 0 )
|
||||
color = Color( 0.556863, 0.929412, 0.494118, 1 )
|
||||
|
||||
[node name="base_ground2" parent="." instance=ExtResource( 1 )]
|
||||
color = Color( 0.494118, 0.929412, 0.827451, 1 )
|
||||
|
||||
[node name="base_ground3" parent="." instance=ExtResource( 1 )]
|
||||
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -3, 0, 0 )
|
||||
color = Color( 0.835294, 0.494118, 0.929412, 1 )
|
10
new_spatialmaterial.tres
Normal file
10
new_spatialmaterial.tres
Normal file
|
@ -0,0 +1,10 @@
|
|||
[gd_resource type="SpatialMaterial" load_steps=2 format=2]
|
||||
|
||||
[ext_resource path="res://basic_texture_1024.png" type="Texture" id=1]
|
||||
|
||||
[resource]
|
||||
albedo_color = Color( 0.953125, 0.621765, 0.621765, 1 )
|
||||
albedo_texture = ExtResource( 1 )
|
||||
uv1_scale = Vector3( 3, 2, 4 )
|
||||
uv1_offset = Vector3( 1, 2, 3 )
|
||||
uv1_triplanar = true
|
24
project.godot
Normal file
24
project.godot
Normal file
|
@ -0,0 +1,24 @@
|
|||
; Engine configuration file.
|
||||
; It's best edited using the editor UI and not directly,
|
||||
; since the parameters that go here are not all obvious.
|
||||
;
|
||||
; Format:
|
||||
; [section] ; section goes between []
|
||||
; param=value ; assign values to parameters
|
||||
|
||||
config_version=4
|
||||
|
||||
_global_script_classes=[ ]
|
||||
_global_script_class_icons={
|
||||
|
||||
}
|
||||
|
||||
[application]
|
||||
|
||||
config/name="YannK Sandbox"
|
||||
run/main_scene="res://main.tscn"
|
||||
config/icon="res://icon.png"
|
||||
|
||||
[rendering]
|
||||
|
||||
environment/default_environment="res://default_env.tres"
|
31
rainboxing.shader
Normal file
31
rainboxing.shader
Normal file
|
@ -0,0 +1,31 @@
|
|||
shader_type spatial;
|
||||
render_mode blend_mix,depth_draw_opaque,cull_back,diffuse_burley,specular_schlick_ggx;
|
||||
|
||||
uniform sampler2D grid_texture : hint_albedo;
|
||||
uniform vec4 albedo : hint_color = vec4(1.0);
|
||||
uniform float scale = float(1.0);
|
||||
uniform vec3 uv1_offset = vec3(0);
|
||||
|
||||
varying vec3 uv1_power_normal;
|
||||
varying vec3 uv1_triplanar_pos;
|
||||
|
||||
vec4 triplanar_texture(sampler2D p_sampler,vec3 p_weights,vec3 p_triplanar_pos) {
|
||||
vec4 samp=vec4(0.0);
|
||||
samp+= texture(p_sampler,p_triplanar_pos.xy) * p_weights.z;
|
||||
samp+= texture(p_sampler,p_triplanar_pos.xz) * p_weights.y;
|
||||
samp+= texture(p_sampler,p_triplanar_pos.zy * vec2(-1.0,1.0)) * p_weights.x;
|
||||
return samp;
|
||||
}
|
||||
|
||||
void vertex() {
|
||||
uv1_power_normal=pow(abs(NORMAL),vec3(1.0));
|
||||
uv1_power_normal/=dot(uv1_power_normal,vec3(1.0));
|
||||
vec3 uv1_scale = vec3(scale);
|
||||
uv1_triplanar_pos = VERTEX * uv1_scale + uv1_offset;
|
||||
uv1_triplanar_pos *= vec3(1.0,-1.0, 1.0);
|
||||
}
|
||||
|
||||
void fragment() {
|
||||
vec4 albedo_tex = triplanar_texture(grid_texture,uv1_power_normal,uv1_triplanar_pos);
|
||||
ALBEDO = albedo.rgb * albedo_tex.rgb;
|
||||
}
|
Loading…
Reference in a new issue