Skip to content

Commit

Permalink
Add glass material to Procedural materials demo (#980)
Browse files Browse the repository at this point in the history
  • Loading branch information
Calinou authored Oct 11, 2023
1 parent 0dfb54f commit fc7ff91
Show file tree
Hide file tree
Showing 9 changed files with 54 additions and 78 deletions.
16 changes: 16 additions & 0 deletions 3d/procedural_materials/materials/glass.tres
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[gd_resource type="StandardMaterial3D" load_steps=3 format=3 uid="uid://68rvwiamrckm"]

[ext_resource type="Texture2D" uid="uid://dyyjawpfnrh0w" path="res://materials/textures/glass_normal.tres" id="1_ulrqn"]
[ext_resource type="Texture2D" uid="uid://cd8ptni1nkv0a" path="res://materials/textures/glass_refraction.tres" id="2_ggkhk"]

[resource]
transparency = 1
albedo_color = Color(0.423529, 0.517647, 0.623529, 0.627451)
roughness = 0.3
normal_enabled = true
normal_scale = 2.0
normal_texture = ExtResource("1_ulrqn")
refraction_enabled = true
refraction_texture = ExtResource("2_ggkhk")
uv1_world_triplanar = true
texture_filter = 5
16 changes: 16 additions & 0 deletions 3d/procedural_materials/materials/textures/glass_normal.tres
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[gd_resource type="NoiseTexture2D" load_steps=2 format=3 uid="uid://dyyjawpfnrh0w"]

[sub_resource type="FastNoiseLite" id="FastNoiseLite_fr1s0"]
noise_type = 2
frequency = 0.02
fractal_type = 0
cellular_distance_function = 1
cellular_jitter = 4.0
cellular_return_type = 6

[resource]
width = 1024
height = 1024
seamless = true
as_normal_map = true
noise = SubResource("FastNoiseLite_fr1s0")
15 changes: 15 additions & 0 deletions 3d/procedural_materials/materials/textures/glass_refraction.tres
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[gd_resource type="NoiseTexture2D" load_steps=2 format=3 uid="uid://cd8ptni1nkv0a"]

[sub_resource type="FastNoiseLite" id="FastNoiseLite_fr1s0"]
noise_type = 2
frequency = 0.02
fractal_type = 0
cellular_distance_function = 1
cellular_jitter = 4.0
cellular_return_type = 6

[resource]
width = 1024
height = 1024
seamless = true
noise = SubResource("FastNoiseLite_fr1s0")
19 changes: 0 additions & 19 deletions 3d/procedural_materials/materials/textures/trypophobia_albedo.tres

This file was deleted.

21 changes: 0 additions & 21 deletions 3d/procedural_materials/materials/textures/trypophobia_normal.tres

This file was deleted.

This file was deleted.

12 changes: 0 additions & 12 deletions 3d/procedural_materials/materials/trypophobia.tres

This file was deleted.

2 changes: 1 addition & 1 deletion 3d/procedural_materials/project.godot
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ config_version=5

config/name="Procedural Materials"
run/main_scene="res://loading.tscn"
config/features=PackedStringArray("4.0")
config/features=PackedStringArray("4.1")
config/icon="res://icon.webp"

[display]
Expand Down
12 changes: 6 additions & 6 deletions 3d/procedural_materials/test.tscn
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
[gd_scene load_steps=40 format=3 uid="uid://c4i1xdk0nc7s0"]

[ext_resource type="Material" uid="uid://b2588u4jkfiog" path="res://materials/trypophobia.tres" id="3_322sv"]
[ext_resource type="Material" uid="uid://chsncadr63hoc" path="res://materials/grass.tres" id="4_gplko"]
[ext_resource type="Material" uid="uid://3odjrwml2nes" path="res://materials/sand.tres" id="5_12jug"]
[ext_resource type="Material" uid="uid://cw85kxowmkj37" path="res://materials/wet_concrete.tres" id="6_q1c2f"]
[ext_resource type="Material" uid="uid://c5wve1c3hypfo" path="res://materials/marble.tres" id="7_ebvqo"]
[ext_resource type="Material" uid="uid://cbijbaq5qol7n" path="res://materials/ice.tres" id="7_k1q1v"]
[ext_resource type="Material" uid="uid://b74tdcluvrao6" path="res://materials/lava.tres" id="8_jphcw"]
[ext_resource type="Material" uid="uid://68rvwiamrckm" path="res://materials/glass.tres" id="9_vei4q"]
[ext_resource type="Script" path="res://scripts/grid.gd" id="10_wwlcf"]
[ext_resource type="Shader" path="res://shaders/plasma.gdshader" id="11_aoush"]
[ext_resource type="Texture2D" uid="uid://chjqieyps5n5r" path="res://checker.png" id="14"]
Expand Down Expand Up @@ -337,19 +337,19 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -1.5, 0)
mesh = SubResource("BoxMesh_opf1g")
surface_material_override/0 = ExtResource("8_jphcw")

[node name="NoiseTextureTrypophobia" type="Node3D" parent="Testers"]
[node name="NoiseTextureGlass" type="Node3D" parent="Testers"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.025, -6)

[node name="MeshInstance3D" type="MeshInstance3D" parent="Testers/NoiseTextureTrypophobia"]
[node name="MeshInstance3D" type="MeshInstance3D" parent="Testers/NoiseTextureGlass"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.00275182, -0.244153, -0.000101089)
mesh = SubResource("SphereMesh_be5u0")
skeleton = NodePath("../../..")
surface_material_override/0 = ExtResource("3_322sv")
surface_material_override/0 = ExtResource("9_vei4q")

[node name="MeshInstance3D2" type="MeshInstance3D" parent="Testers/NoiseTextureTrypophobia"]
[node name="MeshInstance3D2" type="MeshInstance3D" parent="Testers/NoiseTextureGlass"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -1.5, 0)
mesh = SubResource("BoxMesh_opf1g")
surface_material_override/0 = ExtResource("3_322sv")
surface_material_override/0 = ExtResource("9_vei4q")

[node name="NoiseTexturePixelArt" type="Node3D" parent="Testers"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.025, -10)
Expand Down

0 comments on commit fc7ff91

Please sign in to comment.