mirror of
https://github.com/xivdev/Penumbra.git
synced 2025-12-31 21:03:48 +01:00
Material editor: live-preview changes
This commit is contained in:
parent
ccca2f1434
commit
f64fdd2b26
14 changed files with 1067 additions and 110 deletions
|
|
@ -3,17 +3,42 @@ using FFXIVClientStructs.FFXIV.Client.Graphics.Render;
|
|||
|
||||
namespace Penumbra.Interop.Structs;
|
||||
|
||||
[StructLayout( LayoutKind.Explicit )]
|
||||
[StructLayout( LayoutKind.Explicit, Size = 0x40 )]
|
||||
public unsafe struct Material
|
||||
{
|
||||
[FieldOffset( 0x10 )]
|
||||
public ResourceHandle* ResourceHandle;
|
||||
public MtrlResource* ResourceHandle;
|
||||
|
||||
[FieldOffset( 0x18 )]
|
||||
public uint ShaderPackageFlags;
|
||||
|
||||
[FieldOffset( 0x20 )]
|
||||
public uint* ShaderKeys;
|
||||
|
||||
public int ShaderKeyCount
|
||||
=> (int)((uint*)Textures - ShaderKeys);
|
||||
|
||||
[FieldOffset( 0x28 )]
|
||||
public void* MaterialData;
|
||||
public ConstantBuffer* MaterialParameter;
|
||||
|
||||
[FieldOffset( 0x30 )]
|
||||
public void** Textures;
|
||||
public TextureEntry* Textures;
|
||||
|
||||
public Texture* Texture( int index ) => ( Texture* )Textures[3 * index + 1];
|
||||
[FieldOffset( 0x38 )]
|
||||
public ushort TextureCount;
|
||||
|
||||
public Texture* Texture( int index ) => Textures[index].ResourceHandle->KernelTexture;
|
||||
|
||||
[StructLayout( LayoutKind.Explicit, Size = 0x18 )]
|
||||
public struct TextureEntry
|
||||
{
|
||||
[FieldOffset( 0x00 )]
|
||||
public uint Id;
|
||||
|
||||
[FieldOffset( 0x08 )]
|
||||
public TextureResourceHandle* ResourceHandle;
|
||||
|
||||
[FieldOffset( 0x10 )]
|
||||
public uint SamplerFlags;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue