diff --git a/src/experimental/filament/compat/scene_geom_util.cc b/src/experimental/filament/compat/scene_geom_util.cc index 382e6c88..6e9939b3 100644 --- a/src/experimental/filament/compat/scene_geom_util.cc +++ b/src/experimental/filament/compat/scene_geom_util.cc @@ -420,8 +420,7 @@ static void UpdateGeomMaterial(Renderable& renderable, const mjvGeom& geom, // the programmatic UVs. if (textures.color) { - if (Texture::downcast(textures.color)->GetFilamentTexture()->getTarget() == - filament::Texture::Sampler::SAMPLER_2D) { + if (Texture::downcast(textures.color)->GetTarget() == mjTEXTURE_2D) { // For 2D textures, `tex_repeat` specifies how many times the texture // image is repeated. The `tex_uniform` flag determines if the repetition // is applied at in object space (false) or in world space (true). diff --git a/src/experimental/filament/filament/renderable.cc b/src/experimental/filament/filament/renderable.cc index 279d718c..a620be37 100644 --- a/src/experimental/filament/filament/renderable.cc +++ b/src/experimental/filament/filament/renderable.cc @@ -383,8 +383,7 @@ ObjectManager::MaterialType Renderable::GetColorMaterialType() const { } else { return ObjectManager::kPhongColor; } - } else if (color_texture->GetFilamentTexture()->getTarget() == - filament::Texture::Sampler::SAMPLER_CUBEMAP) { + } else if (color_texture->GetTarget() == mjTEXTURE_CUBE) { if (material_params_.color[3] < 1.0f) { return ObjectManager::kPhongCubeFade; } else if (material_params_.reflective) { diff --git a/src/experimental/filament/filament/texture.h b/src/experimental/filament/filament/texture.h index c0ec1e0b..ba94a161 100644 --- a/src/experimental/filament/filament/texture.h +++ b/src/experimental/filament/filament/texture.h @@ -52,6 +52,9 @@ class Texture : public mjrTexture { // Returns the height of the texture. int GetHeight() const { return config_.height; } + // Returns the target of the texture. + mjrTextureTarget GetTarget() const { return config_.target; } + // Returns the underlying filament texture. filament::Texture* GetFilamentTexture() const { return texture_; }