-
Notifications
You must be signed in to change notification settings - Fork 317
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[VolumetricRendering] Fix the compilation (#4398)
* [VolumetricRendering] Fix the compilation But scenes crash * reflect changes from datatype change for vec3state (#6) * fix lots of stuff (#7) --------- Co-authored-by: Frederick Roy <[email protected]> Co-authored-by: Hugo <[email protected]>
- Loading branch information
1 parent
32d5e29
commit 9a107f7
Showing
15 changed files
with
171 additions
and
108 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
32 changes: 20 additions & 12 deletions
32
applications/plugins/VolumetricRendering/examples/OglTetrahedralModel.scn
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,16 +1,24 @@ | ||
<?xml version="1.0"?> | ||
<Node name="root" dt="0.02"> | ||
|
||
<MeshVTKLoader name="loader" filename="mesh/raptorTetra_8418.vtu" /> | ||
<MechanicalObject src="@loader" template="Vec3d" /> | ||
<include href="Objects/TetrahedronSetTopology.xml" src="@loader" /> | ||
|
||
<Node> | ||
<OglShader geometryVerticesOut="12" geometryInputType="10" geometryOutputType="5" vertFilename="shaders/tetra.vert" geoFilename="shaders/tetra_triangles.geo" fragFilename="shaders/tetra.frag" /> | ||
<OglFloat4Variable id="vertexColor" value="1 1 0 1"/> | ||
<OglFloatVariable id="tetraScale" value="0.8"/> | ||
<OglFloatVariable id="u_enableLight" value="2"/> | ||
<OglTetrahedralModel template="Vec3d" /> | ||
</Node> | ||
<RequiredPlugin name="Sofa.Component.IO.Mesh"/> <!-- Needed to use components [MeshVTKLoader] --> | ||
<RequiredPlugin name="Sofa.Component.StateContainer"/> <!-- Needed to use components [MechanicalObject] --> | ||
<RequiredPlugin name="Sofa.Component.Topology.Container.Dynamic"/> <!-- Needed to use components [TetrahedronSetGeometryAlgorithms,TetrahedronSetTopologyContainer,TetrahedronSetTopologyModifier] --> | ||
<RequiredPlugin name="Sofa.GL.Component.Shader"/> <!-- Needed to use components [OglFloat4Variable,OglFloatVariable,OglShader] --> | ||
<RequiredPlugin name="SofaCUDA"/> | ||
<RequiredPlugin name="VolumetricRendering"/> | ||
|
||
</Node> | ||
<DefaultAnimationLoop/> | ||
<MeshVTKLoader name="loader" filename="mesh/raptorTetra_8418.vtu" /> | ||
<MechanicalObject src="@loader" template="Vec3d" /> | ||
<include href="Objects/TetrahedronSetTopology.xml" src="@loader" /> | ||
|
||
<Node> | ||
<OglShader geometryVerticesOut="12" geometryInputType="10" geometryOutputType="5" fileVertexShaders="['shaders/tetra.vert']" fileGeometryShaders="['shaders/tetra_triangles.geo']" fileFragmentShaders="['shaders/tetra.frag']" /> | ||
<OglFloat4Variable id="vertexColor" value="1 1 0 1"/> | ||
<OglFloatVariable id="tetraScale" value="0.8"/> | ||
<OglFloatVariable id="u_enableLight" value="2"/> | ||
<OglTetrahedralModel template="Vec3d" /> | ||
</Node> | ||
|
||
</Node> |
27 changes: 16 additions & 11 deletions
27
applications/plugins/VolumetricRendering/examples/OglVolumetricModel_hexa.scn
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,18 +1,23 @@ | ||
<?xml version="1.0"?> | ||
<Node name="root" dt="0.02"> | ||
<RequiredPlugin name="Sofa.Component.StateContainer"/> <!-- Needed to use components [MechanicalObject] --> | ||
<RequiredPlugin name="Sofa.Component.Topology.Container.Dynamic"/> <!-- Needed to use components [HexahedronSetTopologyContainer] --> | ||
<RequiredPlugin name="Sofa.Component.Topology.Container.Grid"/> <!-- Needed to use components [SparseGridTopology] --> | ||
<RequiredPlugin name="Sofa.GL.Component.Shader"/> <!-- Needed to use components [OglFloatVariable,OglShader] --> | ||
<RequiredPlugin name="VolumetricRendering" /> | ||
|
||
<SparseGridTopology name="grid" n="51 51 51" fileTopology="mesh/raptor_8kp.obj" /> | ||
<DefaultAnimationLoop/> | ||
<SparseGridTopology name="grid" n="51 51 51" fileTopology="mesh/raptor_8kp.obj" /> | ||
|
||
<MechanicalObject template="Vec3d" /> | ||
<HexahedronSetTopologyContainer hexahedra="@grid.hexahedra" /> | ||
<MechanicalObject template="Vec3d" /> | ||
<HexahedronSetTopologyContainer hexahedra="@grid.hexahedra" /> | ||
|
||
<Node> | ||
<OglShader geometryVerticesOut="12" geometryInputType="10" geometryOutputType="5" | ||
vertFilename="share/shaders/tetra.vert" geoFilename="share/shaders/tetra_triangles.geo" fragFilename="share/shaders/tetra.frag" /> | ||
<OglFloatVariable id="volumeScale" value="0.9"/> | ||
<OglFloatVariable id="u_enableLight" value="1"/> | ||
<OglVolumetricModel printLog="false" color="1 0 1 1" /> | ||
</Node> | ||
<Node> | ||
<OglShader geometryVerticesOut="12" geometryInputType="10" geometryOutputType="5" | ||
fileVertexShaders="['share/shaders/tetra.vert']" fileGeometryShaders="['share/shaders/tetra_triangles.geo']" fileFragmentShaders="['share/shaders/tetra.frag']" /> | ||
<OglFloatVariable id="volumeScale" value="0.9"/> | ||
<OglFloatVariable id="u_enableLight" value="1"/> | ||
<OglVolumetricModel printLog="false" color="1 0 1 1" /> | ||
</Node> | ||
|
||
</Node> | ||
</Node> |
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
2 changes: 2 additions & 0 deletions
2
applications/plugins/VolumetricRendering/examples/share/shaders/tetra.frag
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,3 +1,5 @@ | ||
#version 140 | ||
|
||
uniform float u_enableLight; | ||
|
||
//GLSL >= 130 | ||
|
2 changes: 1 addition & 1 deletion
2
applications/plugins/VolumetricRendering/examples/share/shaders/tetra.vert
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,4 +1,4 @@ | ||
#version 130 | ||
#version 140 | ||
|
||
// uniform vec4 vertexColor; | ||
in vec4 a_vertexColor; | ||
|
2 changes: 1 addition & 1 deletion
2
applications/plugins/VolumetricRendering/examples/share/shaders/tetra_triangles.geo
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,4 +1,4 @@ | ||
#version 130 | ||
#version 140 | ||
#extension GL_EXT_geometry_shader4: enable | ||
|
||
//GLSL >= 130 | ||
|
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.