true and masked factory

This commit is contained in:
SlightlyObscure 2020-01-29 00:28:20 +01:00
parent cf67a47798
commit 5b90ac679f
11 changed files with 905 additions and 448 deletions

View File

@ -10,41 +10,101 @@
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 2 )
[node name="WallPart1" type="StaticBody" parent="."]
transform = Transform( 1, 0, 0, 0, 1.5, 0, 0, 0, 0.2, -3, 1.5, 0 )
transform = Transform( 1, 0, 0, 0, 1.5, 0, 0, 0, 0.1, -3, 1.5, 0.1 )
collision_layer = 3
[node name="MeshInstance" type="MeshInstance" parent="WallPart1"]
layers = 3
mesh = SubResource( 1 )
material/0 = null
[node name="MeshInstance2" type="MeshInstance" parent="WallPart1"]
layers = 2
mesh = SubResource( 1 )
material/0 = null
[node name="CollisionShape" type="CollisionShape" parent="WallPart1"]
shape = SubResource( 2 )
[node name="WallPart4" type="StaticBody" parent="."]
transform = Transform( 1, 0, 0, 0, 1.5, 0, 0, 0, 0.1, -3, 1.5, -0.1 )
collision_layer = 3
[node name="MeshInstance" type="MeshInstance" parent="WallPart4"]
mesh = SubResource( 1 )
material/0 = null
[node name="MeshInstance2" type="MeshInstance" parent="WallPart4"]
layers = 2
mesh = SubResource( 1 )
material/0 = null
[node name="CollisionShape" type="CollisionShape" parent="WallPart4"]
shape = SubResource( 2 )
[node name="WallPart2" type="StaticBody" parent="."]
transform = Transform( 1, 0, 0, 0, 1.5, 0, 0, 0, 0.2, 3, 1.5, 0 )
transform = Transform( 1, 0, 0, 0, 1.5, 0, 0, 0, 0.1, 3, 1.5, 0.1 )
collision_layer = 3
[node name="MeshInstance" type="MeshInstance" parent="WallPart2"]
layers = 3
mesh = SubResource( 1 )
material/0 = null
[node name="MeshInstance2" type="MeshInstance" parent="WallPart2"]
layers = 2
mesh = SubResource( 1 )
material/0 = null
[node name="CollisionShape" type="CollisionShape" parent="WallPart2"]
shape = SubResource( 2 )
[node name="WallPart5" type="StaticBody" parent="."]
transform = Transform( 1, 0, 0, 0, 1.5, 0, 0, 0, 0.1, 3, 1.5, -0.1 )
collision_layer = 3
[node name="MeshInstance" type="MeshInstance" parent="WallPart5"]
mesh = SubResource( 1 )
material/0 = null
[node name="MeshInstance2" type="MeshInstance" parent="WallPart5"]
layers = 2
mesh = SubResource( 1 )
material/0 = null
[node name="CollisionShape" type="CollisionShape" parent="WallPart5"]
shape = SubResource( 2 )
[node name="WallPart3" type="StaticBody" parent="."]
transform = Transform( 4, 0, 0, 0, 1, 0, 0, 0, 0.2, 0, 4, 0 )
transform = Transform( 4, 0, 0, 0, 1.2, 0, 0, 0, 0.1, 0, 4.2, 0.1 )
collision_layer = 3
[node name="MeshInstance" type="MeshInstance" parent="WallPart3"]
layers = 3
mesh = SubResource( 1 )
material/0 = null
[node name="MeshInstance2" type="MeshInstance" parent="WallPart3"]
layers = 2
mesh = SubResource( 1 )
material/0 = null
[node name="CollisionShape" type="CollisionShape" parent="WallPart3"]
shape = SubResource( 2 )
[node name="WallPart6" type="StaticBody" parent="."]
transform = Transform( 4, 0, 0, 0, 1.2, 0, 0, 0, 0.1, 0, 4.2, -0.1 )
collision_layer = 3
[node name="MeshInstance" type="MeshInstance" parent="WallPart6"]
mesh = SubResource( 1 )
material/0 = null
[node name="MeshInstance2" type="MeshInstance" parent="WallPart6"]
layers = 2
mesh = SubResource( 1 )
material/0 = null
[node name="CollisionShape" type="CollisionShape" parent="WallPart6"]
shape = SubResource( 2 )
[node name="Door" parent="." instance=ExtResource( 1 )]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -2, 1.5, 0 )

View File

@ -1,6 +1,7 @@
[gd_scene load_steps=4 format=2]
[gd_scene load_steps=5 format=2]
[ext_resource path="res://Resources/Models/Material.material" type="Material" id=1]
[ext_resource path="res://Materials/Sad_Walls.tres" type="Material" id=2]
[sub_resource type="BoxShape" id=1]
@ -30,6 +31,10 @@ transform = Transform( 0.5, 0, 0, 0, 1.7, 0, 0, 0, 0.2, 0, 1.7, -0.1 )
shape = SubResource( 1 )
[node name="MeshInstance" type="MeshInstance" parent="StaticBody"]
layers = 3
mesh = SubResource( 2 )
material/0 = null
[node name="MeshInstance2" type="MeshInstance" parent="StaticBody"]
layers = 2
mesh = SubResource( 2 )
material/0 = ExtResource( 2 )

File diff suppressed because one or more lines are too long

View File

@ -56,7 +56,7 @@ mesh = SubResource( 2 )
material/0 = ExtResource( 3 )
[node name="weirdModel" parent="." instance=ExtResource( 4 )]
transform = Transform( 0.1, 0, 0, 0, 0.1, 0, 0, 0, 0.1, 0, 0.01, 3.72529e-09 )
transform = Transform( 0.1, 0, 0, 0, 0.1, 0, 0, 0, 0.1, 0, 0.01, 3.72529e-009 )
visible = false
[node name="CollisionShape" type="CollisionShape" parent="."]

View File

@ -19,6 +19,7 @@ signal flow_changed
# constant variables
const NULL_COLOR = Color(0, 0, 0, 1)
const LIGHT_COLOR = Color(1, 1, 1, 1)
# private variables
var _left_cast : RayCast
@ -96,13 +97,17 @@ func update_content_color(var _all_colors: Array):
var material = SpatialMaterial.new()
if content_color != NULL_COLOR:
material.albedo_color = content_color
if can_turn:
var mix = content_color.linear_interpolate(LIGHT_COLOR, 0.5)
material.albedo_color = mix
else:
material.albedo_color = content_color
material.emission_enabled = true
material.emission = content_color
#print(get_name())
else:
if can_turn:
material = fork_material
elif can_turn:
material = fork_material
_mesh.material_override = material

View File

@ -0,0 +1,6 @@
[gd_resource type="SpatialMaterial" format=2]
[resource]
albedo_color = Color( 0.580392, 0.890196, 0.960784, 1 )
uv1_scale = Vector3( 3, 1, 2.5 )
uv1_triplanar = true

View File

@ -0,0 +1,6 @@
[gd_resource type="SpatialMaterial" format=2]
[resource]
albedo_color = Color( 0.992157, 0.67451, 0, 1 )
uv1_scale = Vector3( 3, 1, 2.5 )
uv1_triplanar = true

View File

@ -5,7 +5,7 @@ resource_local_to_scene = true
flags_transparent = true
albedo_color = Color( 0.905882, 0.905882, 0.905882, 0.772549 )
metallic = 1.0
roughness = 0.4
roughness = 0.29
rim_enabled = true
rim = 1.0
rim_tint = 0.5

6
Materials/Sad_Walls.tres Normal file
View File

@ -0,0 +1,6 @@
[gd_resource type="SpatialMaterial" format=2]
[resource]
albedo_color = Color( 0.568627, 0.415686, 0.337255, 1 )
uv1_scale = Vector3( 3, 1, 2.5 )
uv1_triplanar = true

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

View File

@ -0,0 +1,36 @@
[remap]
importer="texture"
type="StreamTexture"
path.s3tc="res://.import/wallpaper.png-58a54f19b21c285456769cf22ba3ff66.s3tc.stex"
path.etc2="res://.import/wallpaper.png-58a54f19b21c285456769cf22ba3ff66.etc2.stex"
metadata={
"imported_formats": [ "s3tc", "etc2" ],
"vram_texture": true
}
[deps]
source_file="res://Resources/Textures/wallpaper.png"
dest_files=[ "res://.import/wallpaper.png-58a54f19b21c285456769cf22ba3ff66.s3tc.stex", "res://.import/wallpaper.png-58a54f19b21c285456769cf22ba3ff66.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