File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -204,14 +204,14 @@ namespace Gltf {
204204 Pbr::RGBAColor defaultRGBA) {
205205 // Find or load the image referenced by the texture.
206206 const ImageKey imageKey = std::make_tuple (texture.Image , sRGB );
207- winrt::com_ptr<ID3D11ShaderResourceView> textureView = imageMap[imageKey];
207+ winrt::com_ptr<ID3D11ShaderResourceView> textureView =
208+ texture.Image != nullptr ? imageMap[imageKey] : pbrResources.CreateSolidColorTexture (defaultRGBA);
208209 if (!textureView) // If not cached, load the image and store it in the texture cache.
209210 {
210211 // TODO: Generate mipmaps if sampler's minification filter (minFilter) uses mipmapping.
211212 // TODO: If texture is not power-of-two and (sampler has wrapping=repeat/mirrored_repeat OR minFilter uses
212213 // mipmapping), resize to power-of-two.
213- textureView = texture.Image != nullptr ? LoadImage (pbrResources.GetDevice ().get (), *texture.Image , sRGB )
214- : pbrResources.CreateSolidColorTexture (defaultRGBA);
214+ textureView = LoadImage (pbrResources.GetDevice ().get (), *texture.Image , sRGB );
215215 imageMap[imageKey] = textureView;
216216 }
217217
You can’t perform that action at this time.
0 commit comments