Compare commits

..

2 Commits

Author SHA1 Message Date
Jarrod Doyle fcf0c6a503
Initial alpha model support 2024-09-01 13:51:05 +01:00
Jarrod Doyle 91060ad5be
Remove RectpackSharp 2024-09-01 13:20:50 +01:00
5 changed files with 7 additions and 6 deletions

View File

@ -1,13 +1,10 @@
<Project Sdk="Godot.NET.Sdk/4.3.0">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<!-- <TargetFramework Condition=" '$(GodotTargetPlatform)' == 'android' ">net7.0</TargetFramework>
<TargetFramework Condition=" '$(GodotTargetPlatform)' == 'ios' ">net8.0</TargetFramework> -->
<EnableDynamicLoading>true</EnableDynamicLoading>
<RootNamespace>ThiefMissionViewer</RootNamespace>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="rectpacksharp" Version="1.2.0" />
<PackageReference Include="SixLabors.ImageSharp" Version="3.1.5" />
</ItemGroup>
</Project>

View File

@ -284,7 +284,8 @@ public partial class Mission : Node3D
{
var overrideMat = new StandardMaterial3D
{
AlbedoTexture = TextureLoader.LoadTexture(path)
AlbedoTexture = TextureLoader.LoadTexture(path),
Transparency = BaseMaterial3D.TransparencyEnum.AlphaDepthPrePass,
};
var surfaceCount = model.Mesh.GetSurfaceCount();

View File

@ -65,7 +65,8 @@ public class ModelLoader
var mat = new StandardMaterial3D
{
AlbedoTexture = TextureLoader.LoadTexture(path)
AlbedoTexture = TextureLoader.LoadTexture(path),
Transparency = BaseMaterial3D.TransparencyEnum.AlphaDepthPrePass,
};
var name = material.Name.ToLower();
for (var i = 0; i < 4; i++)

View File

@ -6,6 +6,7 @@ namespace KeepersCompound.TMV;
public partial class TextureLoader
{
// TODO: Replace this with my own implementation lol
// TODO: Alpha!?
// References:
// - https://www.w3.org/Graphics/GIF/spec-gif89a.txt
private static ImageTexture LoadGif(string path)

View File

@ -38,7 +38,8 @@ public partial class TextureLoader
var r = reader.ReadByte() / 255.0f;
var g = reader.ReadByte() / 255.0f;
var b = reader.ReadByte() / 255.0f;
palette[i] = new Color(r, g, b);
var a = (i == 0) ? 0.0f : 1.0f;
palette[i] = new Color(r, g, b, a);
}
}