@@ -105,6 +105,7 @@ namespace Lux {
105105 spec.GenerateMips = false ; // SRGBA cannot be used as storage image for compute-based mip generation
106106 spec.SamplerWrap = texture->m_Specification .SamplerWrap ;
107107 spec.SamplerFilter = texture->m_Specification .SamplerFilter ;
108+ spec.MaxAnisotropy = texture->m_Specification .MaxAnisotropy ;
108109
109110 // Create the SRGBA image with all mip levels pre-allocated (matching source texture)
110111 ImageSpecification imageSpec;
@@ -132,6 +133,7 @@ namespace Lux {
132133 samplerDesc.minFilter = samplerDesc.magFilter = samplerDesc.mipFilter = Utils::NVRHISamplerFilter (spec.SamplerFilter );
133134 samplerDesc.addressU = Utils::NVRHISamplerWrap (spec.SamplerWrap );
134135 samplerDesc.addressV = samplerDesc.addressW = samplerDesc.addressU ;
136+ samplerDesc.maxAnisotropy = spec.MaxAnisotropy ;
135137 srgbImage->GetImageInfo ().Sampler = device->createSampler (samplerDesc);
136138
137139 // Copy all mip levels from source texture to SRGBA texture using GPU copy
@@ -165,12 +167,12 @@ namespace Lux {
165167
166168 // specification.GenerateMips = true;
167169
168- m_ImageData = TextureImporter::ToBufferFromFile (filepath, m_Specification.Format , m_Specification.Width , m_Specification.Height );
170+ m_ImageData = TextureImporter::ToBufferFromFile (filepath, m_Specification.Format , m_Specification.Width , m_Specification.Height , m_Specification. FlipVertically );
169171 if (!m_ImageData)
170172 {
171173 // TODO(Yan): move this to asset manager
172174 LUX_CORE_ERROR (" Failed to load texture from file: {}" , filepath);
173- m_ImageData = TextureImporter::ToBufferFromFile (" Resources/Textures/ErrorTexture.png" , m_Specification.Format , m_Specification.Width , m_Specification.Height );
175+ m_ImageData = TextureImporter::ToBufferFromFile (" Resources/Textures/ErrorTexture.png" , m_Specification.Format , m_Specification.Width , m_Specification.Height , m_Specification. FlipVertically );
174176 }
175177
176178 ImageSpecification imageSpec;
@@ -192,12 +194,12 @@ namespace Lux {
192194 {
193195 Utils::ValidateSpecification (specification);
194196
195- m_ImageData = TextureImporter::ToBufferFromFile (filepath, m_Specification.Format , m_Specification.Width , m_Specification.Height );
197+ m_ImageData = TextureImporter::ToBufferFromFile (filepath, m_Specification.Format , m_Specification.Width , m_Specification.Height , m_Specification. FlipVertically );
196198 if (!m_ImageData)
197199 {
198200 // TODO(Yan): move this to asset manager
199201 LUX_CORE_ERROR (" Failed to load texture from file: {}" , filepath);
200- m_ImageData = TextureImporter::ToBufferFromFile (" Resources/Textures/ErrorTexture.png" , m_Specification.Format , m_Specification.Width , m_Specification.Height );
202+ m_ImageData = TextureImporter::ToBufferFromFile (" Resources/Textures/ErrorTexture.png" , m_Specification.Format , m_Specification.Width , m_Specification.Height , m_Specification. FlipVertically );
201203 }
202204
203205 ImageSpecification imageSpec;
@@ -225,11 +227,11 @@ namespace Lux {
225227
226228 if (m_Specification.Height == 0 )
227229 {
228- m_ImageData = TextureImporter::ToBufferFromMemory (Buffer (data.Data , m_Specification.Width ), m_Specification.Format , m_Specification.Width , m_Specification.Height );
230+ m_ImageData = TextureImporter::ToBufferFromMemory (Buffer (data.Data , m_Specification.Width ), m_Specification.Format , m_Specification.Width , m_Specification.Height , m_Specification. FlipVertically );
229231 if (!m_ImageData)
230232 {
231233 // TODO(Yan): move this to asset manager
232- m_ImageData = TextureImporter::ToBufferFromFile (" Resources/Textures/ErrorTexture.png" , m_Specification.Format , m_Specification.Width , m_Specification.Height );
234+ m_ImageData = TextureImporter::ToBufferFromFile (" Resources/Textures/ErrorTexture.png" , m_Specification.Format , m_Specification.Width , m_Specification.Height , m_Specification. FlipVertically );
233235 }
234236
235237 Utils::ValidateSpecification (m_Specification);
@@ -325,6 +327,7 @@ namespace Lux {
325327 samplerDesc.minFilter = samplerDesc.magFilter = samplerDesc.mipFilter = Utils::NVRHISamplerFilter (m_Specification.SamplerFilter );
326328 samplerDesc.addressU = Utils::NVRHISamplerWrap (m_Specification.SamplerWrap );
327329 samplerDesc.addressV = samplerDesc.addressW = samplerDesc.addressU ;
330+ samplerDesc.maxAnisotropy = m_Specification.MaxAnisotropy ;
328331
329332 info.Sampler = device->createSampler (samplerDesc);
330333
0 commit comments