-
-
Notifications
You must be signed in to change notification settings - Fork 231
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for armature visualization
- Loading branch information
Showing
35 changed files
with
237 additions
and
52 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
d085bfba2e97c65a031daacae3499c051bb8f18b | ||
e5226e04401e93dc8aabd83d082cfbb111811c53 |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#include "vtkF3DGLTFDracoImporter.h" | ||
|
||
#include "vtkF3DGLTFDracoDocumentLoader.h" | ||
|
||
#include <vtkObjectFactory.h> | ||
|
||
//---------------------------------------------------------------------------- | ||
vtkStandardNewMacro(vtkF3DGLTFDracoImporter); | ||
|
||
//---------------------------------------------------------------------------- | ||
void vtkF3DGLTFDracoImporter::InitializeLoader() | ||
{ | ||
this->Loader = vtkSmartPointer<vtkF3DGLTFDracoDocumentLoader>::New(); | ||
} |
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,34 @@ | ||
/** | ||
* @class vtkF3DGLTFDracoImporter | ||
* @brief VTK GLTF importer with Draco support | ||
* | ||
* Subclasses the default importer to initialize our own loader. | ||
* @sa vtkF3DGLTFDracoDocumentLoader | ||
*/ | ||
|
||
#ifndef vtkF3DGLTFDracoImporter_h | ||
#define vtkF3DGLTFDracoImporter_h | ||
|
||
#include <vtkF3DGLTFImporter.h> | ||
|
||
class vtkF3DGLTFDracoImporter : public vtkF3DGLTFImporter | ||
{ | ||
public: | ||
static vtkF3DGLTFDracoImporter* New(); | ||
vtkTypeMacro(vtkF3DGLTFDracoImporter, vtkF3DGLTFImporter); | ||
|
||
protected: | ||
vtkF3DGLTFDracoImporter() = default; | ||
~vtkF3DGLTFDracoImporter() override = default; | ||
|
||
/** | ||
* Overridden to instantiate our own document loader | ||
*/ | ||
void InitializeLoader() override; | ||
|
||
private: | ||
vtkF3DGLTFDracoImporter(const vtkF3DGLTFDracoImporter&) = delete; | ||
void operator=(const vtkF3DGLTFDracoImporter&) = delete; | ||
}; | ||
|
||
#endif |
This file was deleted.
Oops, something went wrong.
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
Git LFS file not shown
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
#include "vtkF3DGLTFImporter.h" | ||
|
||
#include "vtkF3DRenderPass.h" | ||
|
||
#include <vtkActor.h> | ||
#include <vtkInformation.h> | ||
#include <vtkObjectFactory.h> | ||
#include <vtkOpenGLShaderProperty.h> | ||
|
||
//---------------------------------------------------------------------------- | ||
vtkStandardNewMacro(vtkF3DGLTFImporter); | ||
|
||
//---------------------------------------------------------------------------- | ||
#if VTK_VERSION_NUMBER >= VTK_VERSION_CHECK(9, 4, 20241219) | ||
vtkF3DGLTFImporter::vtkF3DGLTFImporter() | ||
{ | ||
this->SetImportArmature(true); | ||
} | ||
#else | ||
vtkF3DGLTFImporter::vtkF3DGLTFImporter() = default; | ||
#endif | ||
|
||
//---------------------------------------------------------------------------- | ||
#if VTK_VERSION_NUMBER >= VTK_VERSION_CHECK(9, 4, 20241219) | ||
void vtkF3DGLTFImporter::ApplyArmatureProperties(vtkActor* actor) | ||
{ | ||
this->Superclass::ApplyArmatureProperties(actor); | ||
|
||
vtkNew<vtkInformation> info; | ||
info->Set(vtkF3DRenderPass::ACTOR_IS_ARMATURE(), 1); | ||
actor->SetPropertyKeys(info); | ||
|
||
// armature on top | ||
//vtkOpenGLShaderProperty* sp = vtkOpenGLShaderProperty::SafeDownCast(actor->GetShaderProperty()); | ||
//if (sp) | ||
//{ | ||
// // compress the depth value to the first thousandth slice in front of the camera to make sure it's displayed on top | ||
// sp->AddFragmentShaderReplacement("//VTK::Depth::Impl", false, "gl_FragDepth = gl_FragDepth * 0.001;\n", false); | ||
//} | ||
} | ||
#endif |
Oops, something went wrong.