Re-enabled prop mesh building. Also small cleanups to materials.

This commit is contained in:
Relintai 2020-02-11 01:27:39 +01:00
parent fad9e70f48
commit 87c8c286ce
7 changed files with 7 additions and 18 deletions

View File

@ -1,7 +1,4 @@
[gd_resource type="SpatialMaterial" load_steps=2 format=2] [gd_resource type="SpatialMaterial" format=2]
[ext_resource path="res://data/voxel_textures/test_01.png" type="Texture" id=1]
[resource] [resource]
flags_vertex_lighting = true flags_vertex_lighting = true
albedo_texture = ExtResource( 1 )

View File

@ -1,6 +1,4 @@
[gd_resource type="SpatialMaterial" load_steps=2 format=2] [gd_resource type="SpatialMaterial" format=2]
[ext_resource path="res://data/voxel_textures/test_01.png" type="Texture" id=1]
[resource] [resource]
flags_vertex_lighting = true flags_vertex_lighting = true
@ -8,5 +6,4 @@ vertex_color_use_as_albedo = true
vertex_color_is_srgb = true vertex_color_is_srgb = true
params_diffuse_mode = 1 params_diffuse_mode = 1
params_specular_mode = 4 params_specular_mode = 4
albedo_texture = ExtResource( 1 )
metallic_specular = 0.0 metallic_specular = 0.0

View File

@ -1,9 +1,6 @@
[gd_resource type="SpatialMaterial" load_steps=2 format=2] [gd_resource type="SpatialMaterial" format=2]
[ext_resource path="res://data/voxel_textures/grass_albedo.png" type="Texture" id=1]
[resource] [resource]
flags_vertex_lighting = true flags_vertex_lighting = true
vertex_color_use_as_albedo = true vertex_color_use_as_albedo = true
params_specular_mode = 4 params_specular_mode = 4
albedo_texture = ExtResource( 1 )

File diff suppressed because one or more lines are too long

View File

@ -168,8 +168,6 @@ func build_phase_lights() -> void:
if prop.prop != null: if prop.prop != null:
prop.prop.add_prop_lights_into(self, t, true) prop.prop.add_prop_lights_into(self, t, true)
next_phase()
func get_prop_transform(prop : VoxelChunkPropData, snap_to_mesh: bool, snap_axis: Vector3) -> Transform: func get_prop_transform(prop : VoxelChunkPropData, snap_to_mesh: bool, snap_axis: Vector3) -> Transform:
var pos : Vector3 = Vector3(prop.x * voxel_scale, prop.y * voxel_scale, prop.z * voxel_scale) var pos : Vector3 = Vector3(prop.x * voxel_scale, prop.y * voxel_scale, prop.z * voxel_scale)
@ -246,9 +244,10 @@ func _physics_process(delta):
if current_build_phase == VoxelChunk.BUILD_PHASE_LIGHTS: if current_build_phase == VoxelChunk.BUILD_PHASE_LIGHTS:
build_phase_lights() build_phase_lights()
set_physics_process_internal(false) set_physics_process_internal(false)
next_phase()
elif current_build_phase == VoxelChunk.BUILD_PHASE_PROP_MESH: elif current_build_phase == VoxelChunk.BUILD_PHASE_PROP_MESH:
#build_phase_prop_mesh() build_phase_prop_mesh()
set_physics_process_internal(false) set_physics_process_internal(false)
next_phase() next_phase()

View File

@ -328,7 +328,6 @@ func add_buffer_normal(buffer : VoxelChunk) -> void:
add_color(light) add_color(light)
vert_pos *= float(voxel_scale) vert_pos *= float(voxel_scale)
add_normal(normal) add_normal(normal)