Fix object not drawing correctly

This commit is contained in:
Amazed 2020-04-17 18:43:29 +02:00
parent ed7262c14f
commit b37f4c5121
35 changed files with 13 additions and 6433 deletions

17
3d.gd
View File

@ -12,20 +12,8 @@ onready var camera = get_node("Player/Head/Camera")
##################################################
func create_water():
# create water
var waterscene = load("res://realistic_water_shader/water.tscn")
for x in range(-1000,1000, 128):
for y in range(-1000,1000, 128):
var water_instance = waterscene.instance()
water_instance.transform.origin.x = x
water_instance.transform.origin.y = 0
water_instance.transform.origin.z = y
add_child(water_instance)
func _ready() -> void:
if fast_close:
print("** Fast Close enabled in the 's_main.gd' script **")
print("** 'Esc' to close 'Shift + F1' to release mouse **")
var giantsscript = load("res://objectmanager.gd")
var objmgr = giantsscript.ObjectManager.new()
@ -36,10 +24,11 @@ func _ready() -> void:
# add_child(giants_dir_browser)
# giants_dir_browser.popup_centered()
objmgr.build()
var m = objmgr.load_model("W_story1_rock_2.gbs")
# var m = objmgr.load_model("mc_nothrust_l0.gbs")
var m = objmgr.load_model("RP_command.gbs")
# print(m.tex)
# print(m.point_uv)
print(m.tex)
# print(m.tex)
var meshinstance = objmgr.load_model_mesh(m)
meshinstance.transform.origin.y = 50
add_child(meshinstance)

View File

@ -36,6 +36,7 @@ script = ExtResource( 3 )
[node name="Player" parent="." instance=ExtResource( 1 )]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0.151, 200, -0.003 )
fly_speed = 50
[node name="GiantsTerrain" parent="." instance=ExtResource( 2 )]
material_override = SubResource( 1 )
@ -69,7 +70,7 @@ material/0 = SubResource( 5 )
margin_right = 307.0
margin_bottom = 130.0
popup_exclusive = true
window_title = "Open Giants directory"
window_title = "Open a Directory"
resizable = true
mode = 2
access = 2

View File

@ -1,33 +0,0 @@
[gd_scene load_steps=4 format=2]
[ext_resource path="res://assets/maujoe.basic_water_material/materials/basic_water_material.material" type="Material" id=1]
[sub_resource type="PlaneMesh" id=1]
material = ExtResource( 1 )
size = Vector2( 50000, 50000 )
[sub_resource type="Animation" id=2]
resource_name = "uv_water"
loop = true
tracks/0/type = "value"
tracks/0/path = NodePath(".:mesh:material:uv1_offset")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/keys = {
"times": PoolRealArray( 0, 1 ),
"transitions": PoolRealArray( 1, 1 ),
"update": 0,
"values": [ Vector3( 0, 0, 0 ), Vector3( 1, 0, 0 ) ]
}
[node name="Water" type="MeshInstance"]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.473385, 0 )
mesh = SubResource( 1 )
material/0 = null
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
autoplay = "uv_water"
playback_speed = 0.05
anims/uv_water = SubResource( 2 )

View File

@ -1,51 +0,0 @@
All parts of this project that are not copyrighted or licensed by someone else are released under the MIT License:
Copyright (c) 2018 Jaccomo Lorenz (Maujoe)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
------------
Other Files:
Some files caintained in this project may be generated by the Godot Engine version 3.x that is covered by its own license, an up to date version can be found on: https://github.com/godotengine/godot/blob/master/LICENSE.txt.
Quote (18th February 2018):
"Copyright (c) 2007-2018 Juan Linietsky, Ariel Manzur.
Copyright (c) 2014-2018 Godot Engine contributors (cf. AUTHORS.md)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE."

View File

@ -1,12 +0,0 @@
# Basic Water Material
A basic water material for the Godot Engine 3.x.
#### Video/How To:
https://youtu.be/jbYrpKWTlpw
![Image](screenshots/basic_water_material_1.jpg)
## License
All parts of this project that are not copyrighted or licensed by someone else are released free under the MIT License - see the LICENSE.md file for details.

View File

@ -1,30 +0,0 @@
[gd_scene load_steps=6 format=2]
[ext_resource path="res://assets/maujoe.basic_water_material/models/terrain.tscn" type="PackedScene" id=1]
[ext_resource path="res://assets/maujoe.basic_water_material/textures/cloud_layers_1k.hdr" type="Texture" id=2]
[ext_resource path="res://Water.tscn" type="PackedScene" id=3]
[sub_resource type="PanoramaSky" id=1]
radiance_size = 4
panorama = ExtResource( 2 )
[sub_resource type="Environment" id=2]
background_mode = 2
background_sky = SubResource( 1 )
background_energy = 1.5
fog_height_min = 0.0
fog_height_max = 100.0
ssao_quality = 0
[node name="Node" type="Node"]
[node name="terrain" parent="." instance=ExtResource( 1 )]
[node name="Camera" type="Camera" parent="."]
transform = Transform( 0.821155, 0, -0.570705, 0, 1, 0, 0.570705, 0, 0.821155, -10.0408, 1.29057, 13.15 )
[node name="WorldEnvironment" type="WorldEnvironment" parent="."]
environment = SubResource( 2 )
[node name="Water" parent="." instance=ExtResource( 3 )]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -1.14418, 0 )

View File

@ -1,18 +0,0 @@
[gd_resource type="Environment" load_steps=2 format=2]
[sub_resource type="ProceduralSky" id=1]
radiance_size = 4
sky_top_color = Color( 0.0470588, 0.454902, 0.976471, 1 )
sky_horizon_color = Color( 0.556863, 0.823529, 0.909804, 1 )
sky_curve = 0.25
ground_bottom_color = Color( 0.101961, 0.145098, 0.188235, 1 )
ground_horizon_color = Color( 0.482353, 0.788235, 0.952941, 1 )
ground_curve = 0.01
sun_energy = 16.0
[resource]
background_mode = 2
background_sky = SubResource( 1 )
fog_height_min = 0.0
fog_height_max = 100.0
ssao_quality = 0

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.9 KiB

View File

@ -1,34 +0,0 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/icon.png-231110b88024ae42b05514bfd264b637.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://assets/maujoe.basic_water_material/icon.png"
dest_files=[ "res://.import/icon.png-231110b88024ae42b05514bfd264b637.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

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

View File

@ -1,146 +0,0 @@
[gd_scene load_steps=6 format=2]
[ext_resource path="res://assets/maujoe.basic_water_material/models/terrain.dae" type="PackedScene" id=1]
[ext_resource path="res://assets/maujoe.basic_water_material/textures/dirt.png" type="Texture" id=2]
[sub_resource type="SpatialMaterial" id=1]
render_priority = 0
flags_transparent = false
flags_unshaded = false
flags_vertex_lighting = false
flags_no_depth_test = false
flags_use_point_size = false
flags_world_triplanar = false
flags_fixed_size = false
flags_albedo_tex_force_srgb = false
vertex_color_use_as_albedo = false
vertex_color_is_srgb = false
params_diffuse_mode = 0
params_specular_mode = 0
params_blend_mode = 0
params_cull_mode = 0
params_depth_draw_mode = 0
params_line_width = 1.0
params_point_size = 1.0
params_billboard_mode = 0
params_grow = false
params_use_alpha_scissor = false
albedo_color = Color( 1, 1, 1, 1 )
albedo_texture = ExtResource( 2 )
metallic = 0.0
metallic_specular = 0.5
metallic_texture_channel = 0
roughness = 1.0
roughness_texture_channel = 0
emission_enabled = false
normal_enabled = false
rim_enabled = false
clearcoat_enabled = false
anisotropy_enabled = false
ao_enabled = false
depth_enabled = false
subsurf_scatter_enabled = false
transmission_enabled = false
refraction_enabled = false
detail_enabled = false
uv1_scale = Vector3( 2, 2, 2 )
uv1_offset = Vector3( 0, 0, 0 )
uv1_triplanar = true
uv1_triplanar_sharpness = 1.0
uv2_scale = Vector3( 1, 1, 1 )
uv2_offset = Vector3( 0, 0, 0 )
uv2_triplanar = false
uv2_triplanar_sharpness = 1.0
proximity_fade_enable = false
distance_fade_enable = false
_sections_unfolded = [ "Roughness", "UV1" ]
[sub_resource type="CubeMesh" id=2]
size = Vector3( 2, 2, 2 )
subdivide_width = 0
subdivide_height = 0
subdivide_depth = 0
[sub_resource type="CylinderMesh" id=3]
top_radius = 1.0
bottom_radius = 1.0
height = 2.0
radial_segments = 64
rings = 4
[node name="terrain" index="0" instance=ExtResource( 1 )]
[node name="Plane" parent="." index="0"]
material/0 = SubResource( 1 )
_sections_unfolded = [ "material" ]
[node name="MeshInstance" type="MeshInstance" parent="." index="2"]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.611577, 2.08371 )
layers = 1
material_override = null
cast_shadow = 1
extra_cull_margin = 0.0
use_in_baked_light = false
lod_min_distance = 0.0
lod_min_hysteresis = 0.0
lod_max_distance = 0.0
lod_max_hysteresis = 0.0
mesh = SubResource( 2 )
skeleton = NodePath("..")
material/0 = null
[node name="MeshInstance2" type="MeshInstance" parent="." index="3"]
transform = Transform( 0.865298, 0.433177, -0.252223, -0.501257, 0.747774, -0.435402, 0, 0.503182, 0.864181, -2.51833, -4.75691, -3.43013 )
layers = 1
material_override = null
cast_shadow = 1
extra_cull_margin = 0.0
use_in_baked_light = false
lod_min_distance = 0.0
lod_min_hysteresis = 0.0
lod_max_distance = 0.0
lod_max_hysteresis = 0.0
mesh = SubResource( 2 )
skeleton = NodePath("..")
material/0 = null
[node name="MeshInstance3" type="MeshInstance" parent="." index="4"]
transform = Transform( -0.200505, -0.335063, -0.920614, 0.579423, 0.717171, -0.387214, 0.789979, -0.611064, 0.0503473, -4.13883, -4.1162, 4.76208 )
layers = 1
material_override = null
cast_shadow = 1
extra_cull_margin = 0.0
use_in_baked_light = false
lod_min_distance = 0.0
lod_min_hysteresis = 0.0
lod_max_distance = 0.0
lod_max_hysteresis = 0.0
mesh = SubResource( 2 )
skeleton = NodePath("..")
material/0 = null
[node name="MeshInstance4" type="MeshInstance" parent="." index="5"]
transform = Transform( -0.935291, -0.0302122, -0.352587, 0.317867, -0.50963, -0.799524, -0.155533, -0.859863, 0.486256, 2.44717, -5.55065, -1.09404 )
layers = 1
material_override = null
cast_shadow = 1
extra_cull_margin = 0.0
use_in_baked_light = false
lod_min_distance = 0.0
lod_min_hysteresis = 0.0
lod_max_distance = 0.0
lod_max_hysteresis = 0.0
mesh = SubResource( 3 )
skeleton = NodePath("..")
material/0 = null

Binary file not shown.

Before

Width:  |  Height:  |  Size: 246 KiB

View File

@ -1,34 +0,0 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/basic_water_material.jpg-de524e8fcab79b2b9c9cdcb882945294.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://assets/maujoe.basic_water_material/screenshots/basic_water_material.jpg"
dest_files=[ "res://.import/basic_water_material.jpg-de524e8fcab79b2b9c9cdcb882945294.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

Binary file not shown.

Before

Width:  |  Height:  |  Size: 280 KiB

View File

@ -1,34 +0,0 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/basic_water_material_1.jpg-25100a1cb77e2417c01fa5507b8f1672.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://assets/maujoe.basic_water_material/screenshots/basic_water_material_1.jpg"
dest_files=[ "res://.import/basic_water_material_1.jpg-25100a1cb77e2417c01fa5507b8f1672.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

Binary file not shown.

Before

Width:  |  Height:  |  Size: 268 KiB

View File

@ -1,34 +0,0 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/basic_water_material_2.jpg-c2ef2cff07f0225e579abd8a197b794b.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://assets/maujoe.basic_water_material/screenshots/basic_water_material_2.jpg"
dest_files=[ "res://.import/basic_water_material_2.jpg-c2ef2cff07f0225e579abd8a197b794b.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

Binary file not shown.

Before

Width:  |  Height:  |  Size: 262 KiB

View File

@ -1,34 +0,0 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/basic_water_material_3.jpg-c587e71eb08a08a02a297d3334efe204.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://assets/maujoe.basic_water_material/screenshots/basic_water_material_3.jpg"
dest_files=[ "res://.import/basic_water_material_3.jpg-c587e71eb08a08a02a297d3334efe204.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

Binary file not shown.

Before

Width:  |  Height:  |  Size: 295 KiB

View File

@ -1,34 +0,0 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/basic_water_material_5.jpg-3946231ae011bce7b7162b46d1a9c1f8.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://assets/maujoe.basic_water_material/screenshots/basic_water_material_5.jpg"
dest_files=[ "res://.import/basic_water_material_5.jpg-3946231ae011bce7b7162b46d1a9c1f8.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

Binary file not shown.

Before

Width:  |  Height:  |  Size: 293 KiB

View File

@ -1,34 +0,0 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/basic_water_material_6.jpg-393328d6fd88acbcc143143455f51c0b.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://assets/maujoe.basic_water_material/screenshots/basic_water_material_6.jpg"
dest_files=[ "res://.import/basic_water_material_6.jpg-393328d6fd88acbcc143143455f51c0b.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

View File

@ -1,34 +0,0 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/cloud_layers_1k.hdr-120b64acaa244e4436c31186a305491a.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://assets/maujoe.basic_water_material/textures/cloud_layers_1k.hdr"
dest_files=[ "res://.import/cloud_layers_1k.hdr-120b64acaa244e4436c31186a305491a.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

Binary file not shown.

Before

Width:  |  Height:  |  Size: 578 KiB

View File

@ -1,36 +0,0 @@
[remap]
importer="texture"
type="StreamTexture"
path.s3tc="res://.import/dirt.png-2f6f9f55b644c74cdd0f99e41507ea61.s3tc.stex"
path.etc2="res://.import/dirt.png-2f6f9f55b644c74cdd0f99e41507ea61.etc2.stex"
metadata={
"imported_formats": [ "s3tc", "etc2" ],
"vram_texture": true
}
[deps]
source_file="res://assets/maujoe.basic_water_material/textures/dirt.png"
dest_files=[ "res://.import/dirt.png-2f6f9f55b644c74cdd0f99e41507ea61.s3tc.stex", "res://.import/dirt.png-2f6f9f55b644c74cdd0f99e41507ea61.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

Binary file not shown.

Before

Width:  |  Height:  |  Size: 220 KiB

View File

@ -1,34 +0,0 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/water_normal_1.png-7e3a5f6b654ae6d69802a802595bdf49.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://assets/maujoe.basic_water_material/textures/water_normal_1.png"
dest_files=[ "res://.import/water_normal_1.png-7e3a5f6b654ae6d69802a802595bdf49.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

Binary file not shown.

Before

Width:  |  Height:  |  Size: 72 KiB

View File

@ -1,36 +0,0 @@
[remap]
importer="texture"
type="StreamTexture"
path.s3tc="res://.import/water_normal_2.png-4dc8dd7a6821e4087592d9c95e1f0755.s3tc.stex"
path.etc2="res://.import/water_normal_2.png-4dc8dd7a6821e4087592d9c95e1f0755.etc2.stex"
metadata={
"imported_formats": [ "s3tc", "etc2" ],
"vram_texture": true
}
[deps]
source_file="res://assets/maujoe.basic_water_material/textures/water_normal_2.png"
dest_files=[ "res://.import/water_normal_2.png-4dc8dd7a6821e4087592d9c95e1f0755.s3tc.stex", "res://.import/water_normal_2.png-4dc8dd7a6821e4087592d9c95e1f0755.etc2.stex" ]
[params]
compress/mode=2
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=1
flags/repeat=true
flags/filter=true
flags/mipmaps=true
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=false
svg/scale=1.0

View File

@ -35,8 +35,8 @@ class ObjectManager:
var name = file.get_buffer(name_length).get_string_from_ascii()
if name.ends_with(".tga") or name.ends_with(".gbs"):
index[name] = file.get_path_absolute()
# if name.ends_with(".gbs"):
# print(name)
if name.ends_with(".gbs"):
print(name)
func read_file_in_gzp(filename: String) -> StreamPeerBuffer:
var gzp_file = index[filename]
@ -222,12 +222,14 @@ class ObjectManager:
mat.params_cull_mode = SpatialMaterial.CULL_DISABLED
if model.tex[i]:
mat.albedo_texture = model.tex[i]
else:
mat.vertex_color_use_as_albedo = true
st.set_material(mat)
assert(len(model.basepoint) % 3 == 0)
for j in range(len(model.part[i].triangle)):
for k in range(2):
for k in range(3):
var l = model.part[i].triangle[j][k]
st.add_uv(Vector2(model.point_uv[l][0], model.point_uv[l][1]))
st.add_color(Color(
@ -237,9 +239,10 @@ class ObjectManager:
l = model.point_1[l]
st.add_vertex(Vector3(
model.basepoint[l][0],
model.basepoint[l][1],
model.basepoint[l][2]))
model.basepoint[l][2],
model.basepoint[l][1]))
mesh = st.commit(mesh)
meshinstance.mesh = mesh
return meshinstance