Set sufrace override material albedo instead

This commit is contained in:
Sofia 2026-08-09 23:36:53 +03:00
parent 36f53e14f0
commit 5d9630b03a
2 changed files with 9 additions and 7 deletions

View File

@ -3,19 +3,21 @@
importer="texture"
type="CompressedTexture2D"
uid="uid://be6kkun8jvorr"
path="res://.godot/imported/{str_grating1.png-c56d7008acfd43735ff24601098a1911.ctex"
path.s3tc="res://.godot/imported/{str_grating1.png-c56d7008acfd43735ff24601098a1911.s3tc.ctex"
path.etc2="res://.godot/imported/{str_grating1.png-c56d7008acfd43735ff24601098a1911.etc2.ctex"
metadata={
"vram_texture": false
"imported_formats": ["s3tc_bptc", "etc2_astc"],
"vram_texture": true
}
[deps]
source_file="res://maps/textures/{str_grating1.png"
dest_files=["res://.godot/imported/{str_grating1.png-c56d7008acfd43735ff24601098a1911.ctex"]
dest_files=["res://.godot/imported/{str_grating1.png-c56d7008acfd43735ff24601098a1911.s3tc.ctex", "res://.godot/imported/{str_grating1.png-c56d7008acfd43735ff24601098a1911.etc2.ctex"]
[params]
compress/mode=0
compress/mode=2
compress/high_quality=false
compress/lossy_quality=0.7
compress/uastc_level=0
@ -23,7 +25,7 @@ compress/rdo_quality_loss=0.0
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/generate=true
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
@ -37,4 +39,4 @@ process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1
detect_3d/compress_to=0

View File

@ -25,7 +25,7 @@ pub struct WeaponMesh {
impl WeaponMesh {
fn set_color(&mut self, color: Color) {
if let Some(mesh) = &mut self.mesh
&& let Some(mut mat) = mesh.get_active_material(0)
&& let Some(mut mat) = mesh.get_surface_override_material(0)
{
mat.set("albedo_color", &color.to_variant());
}