git.s-ol.nu ~forks/DiligentTools / 3d2dc82
GLTF Loader: switched to using texture arrays assiduous 1 year, 1 month ago
2 changed file(s) with 16 addition(s) and 11 deletion(s). Raw diff Collapse all Expand all
8787 float PhysicalDescriptorUVSelector = -1;
8888 float NormalUVSelector = -1;
8989
90 float OcclusionUVSelector = -1;
91 float EmissiveUVSelector = -1;
92 float MetallicFactor = 1;
93 float RoughnessFactor = 1;
90 float OcclusionUVSelector = -1;
91 float EmissiveUVSelector = -1;
92 float BaseColorSlice = 0;
93 float PhysicalDescriptorSlice = 0;
94
95 float NormalSlice = 0;
96 float OcclusionSlice = 0;
97 float EmissiveSlice = 0;
98 float MetallicFactor = 1;
99
100 float RoughnessFactor = 1;
101 int UseAlphaMask = 0;
102 float AlphaCutoff = 0.5f;
103 float Dummy0;
94104
95105 // When texture atlas is used, UV scale and bias applied to
96106 // each texture coordinate set
99109 float4 NormalUVScaleBias = float4{1, 1, 0, 0};
100110 float4 OcclusionUVScaleBias = float4{1, 1, 0, 0};
101111 float4 EmissiveUVScaleBias = float4{1, 1, 0, 0};
102
103 int UseAlphaMask = 0;
104 float AlphaCutoff = 0.5f;
105 float Dummy0;
106 float Dummy1;
107112 };
108113 static_assert(sizeof(ShaderAttribs) % 16 == 0, "ShaderAttribs struct must be 16-byte aligned");
109114 ShaderAttribs Attribs;
779779 {
780780 TextureDesc TexDesc;
781781 TexDesc.Name = "GLTF Texture";
782 TexDesc.Type = RESOURCE_DIM_TEX_2D;
782 TexDesc.Type = RESOURCE_DIM_TEX_2D_ARRAY;
783783 TexDesc.Usage = USAGE_DEFAULT;
784784 TexDesc.BindFlags = BIND_SHADER_RESOURCE;
785785 TexDesc.Width = gltf_image.width;
820820 // Create stub texture
821821 TextureDesc TexDesc;
822822 TexDesc.Name = "Checkerboard stub texture";
823 TexDesc.Type = RESOURCE_DIM_TEX_2D;
823 TexDesc.Type = RESOURCE_DIM_TEX_2D_ARRAY;
824824 TexDesc.Width = 32;
825825 TexDesc.Height = 32;
826826 TexDesc.Format = TEX_FORMAT_RGBA8_UNORM;