-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
457 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
65 changes: 65 additions & 0 deletions
65
src/core/include/cesium/omniverse/FabricMultiTextureMaterial.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
#pragma once | ||
|
||
#include "cesium/omniverse/FabricMaterialDefinition.h" | ||
#include "cesium/omniverse/GltfUtil.h" | ||
|
||
#include <omni/fabric/IPath.h> | ||
#include <omni/fabric/Type.h> | ||
#include <pxr/usd/sdf/assetPath.h> | ||
#include <pxr/usd/sdf/path.h> | ||
|
||
namespace omni::ui { | ||
class DynamicTextureProvider; | ||
} | ||
|
||
namespace cesium::omniverse { | ||
|
||
class FabricMultiTextureMaterial { | ||
public: | ||
FabricMultiTextureMaterial( | ||
const omni::fabric::Path& path, | ||
const FabricMaterialDefinition& materialDefinition, | ||
const pxr::TfToken& defaultTextureAssetPathToken, | ||
long stageId); | ||
~FabricMultiTextureMaterial(); | ||
|
||
void setMaterial(int64_t tilesetId, const MaterialInfo& materialInfo); | ||
void setBaseColorTexture(const pxr::TfToken& textureAssetPathToken, const TextureInfo& textureInfo); | ||
|
||
void clearMaterial(); | ||
void clearBaseColorTexture(); | ||
|
||
void setActive(bool active); | ||
|
||
[[nodiscard]] const omni::fabric::Path& getPath() const; | ||
[[nodiscard]] const FabricMaterialDefinition& getMaterialDefinition() const; | ||
|
||
private: | ||
void initialize(); | ||
|
||
void createMaterial(const omni::fabric::Path& materialPath); | ||
void createShader(const omni::fabric::Path& shaderPath, const omni::fabric::Path& materialPath); | ||
void createTexture( | ||
const omni::fabric::Path& texturePath, | ||
const omni::fabric::Path& shaderPath, | ||
const omni::fabric::Token& shaderInput); | ||
|
||
void reset(); | ||
void setShaderValues(const omni::fabric::Path& shaderPath, const MaterialInfo& materialInfo); | ||
void setTextureValues( | ||
const omni::fabric::Path& texturePath, | ||
const pxr::TfToken& textureAssetPathToken, | ||
const TextureInfo& textureInfo); | ||
void setTilesetId(int64_t tilesetId); | ||
bool stageDestroyed(); | ||
|
||
omni::fabric::Path _materialPath; | ||
const FabricMaterialDefinition _materialDefinition; | ||
const pxr::TfToken _defaultTextureAssetPathToken; | ||
const long _stageId; | ||
|
||
omni::fabric::Path _shaderPath; | ||
omni::fabric::Path _baseColorTexturePath; | ||
}; | ||
|
||
} // namespace cesium::omniverse |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.