mirror of
https://github.com/FOSS-Supremacy/OpenLiberty.git
synced 2025-04-28 20:07:57 +03:00
Detect alpha from item flags
This commit is contained in:
parent
8d2963413a
commit
3c76567ee8
1 changed files with 4 additions and 3 deletions
|
@ -126,6 +126,10 @@ func spawn(id: int, model_name: String, position: Vector3, scale: Vector3, rotat
|
|||
var rwmat := geometry.material_list.materials[0] as RWMaterial
|
||||
var material := rwmat.material
|
||||
|
||||
if item.flags & 0x04:
|
||||
material.transparency = BaseMaterial3D.TRANSPARENCY_ALPHA
|
||||
material.cull_mode = BaseMaterial3D.CULL_DISABLED
|
||||
|
||||
if rwmat.is_textured:
|
||||
var txd: RWTextureDict
|
||||
|
||||
|
@ -138,9 +142,6 @@ func spawn(id: int, model_name: String, position: Vector3, scale: Vector3, rotat
|
|||
for raster in txd.textures:
|
||||
if rwmat.texture.texture_name.string.matchn(raster.name):
|
||||
material.albedo_texture = ImageTexture.create_from_image(raster.image)
|
||||
if raster.has_alpha:
|
||||
material.transparency = BaseMaterial3D.TRANSPARENCY_ALPHA
|
||||
material.cull_mode = BaseMaterial3D.CULL_DISABLED
|
||||
break
|
||||
|
||||
instance.material_override = material
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue