Skip to content

Commit 58d6baa

Browse files
committed
.
1 parent 2212000 commit 58d6baa

File tree

6 files changed

+18
-731
lines changed

6 files changed

+18
-731
lines changed

application/testing/CMakeLists.txt

Lines changed: 1 addition & 681 deletions
Large diffs are not rendered by default.

application/testing/tests.features.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -442,6 +442,7 @@ f3d_test(NAME TestFinalShaderNegative DATA cow.vtp ARGS --final-shader "vec4 pix
442442
f3d_test(NAME TestFinalShaderNegativeFileName DATA cow.vtp ARGS --filename --final-shader "vec4 pixel(vec2 uv){return vec4(vec3(1.0) - texture(source, uv).rgb, 1.0)\\\\\\\;}" UI)
443443
f3d_test(NAME TestFinalShaderUndefined DATA cow.vtp ARGS --final-shader "undefined" REGEXP "Final shader must define a function" NO_BASELINE)
444444
f3d_test(NAME TestFinalShaderCompilationFailure DATA cow.vtp ARGS --final-shader "vec4 pixel(vec2 uv){}" --verbose REGEXP " build the shader program" NO_BASELINE)
445+
f3d_test(NAME TestFinalShaderTimeUniform DATA cow.vtp ARGS --final-shader "vec4 pixel(vec2 uv){return vec4(texture(source, uv).rgb * (0.5 + 0.5*cos(time+uv.xyx+vec3(0,2,4))), 1.0)\\\\\\\;}")
445446

446447
## Command Script
447448
f3d_test(NAME TestCommandScriptBasic SCRIPT DATA dragon.vtu) # roll_camera 90;toggle ui.scalar_bar;print_scene_info;increase_light_intensity

library/src/interactor_impl.cxx

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -172,15 +172,9 @@ class interactor_impl::internals
172172
double fwd[3];
173173
vtkMath::Cross(right, up, fwd);
174174
const double m[9] = {
175-
right[0],
176-
right[1],
177-
right[2], //
178-
fwd[0],
179-
fwd[1],
180-
fwd[2], //
181-
up[0],
182-
up[1],
183-
up[2], //
175+
right[0], right[1], right[2], //
176+
fwd[0], fwd[1], fwd[2], //
177+
up[0], up[1], up[2], //
184178
};
185179
transform->DeepCopy(m);
186180
}
@@ -630,7 +624,7 @@ class interactor_impl::internals
630624
vtkRenderWindow* renWin = this->Window.GetRenderWindow();
631625
vtkF3DRenderer* ren = vtkF3DRenderer::SafeDownCast(renWin->GetRenderers()->GetFirstRenderer());
632626
ren->SetUIDeltaTime(deltaTime);
633-
ren->SetTime(ren->GetTime() + deltaTime);
627+
ren->SetTotalTime(ren->GetTotalTime() + deltaTime);
634628

635629
// Determine if we need a full render or just a UI render
636630
// At the moment, only TAA requires a full render each frame

vtkext/private/module/vtkF3DRenderer.cxx

Lines changed: 8 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -816,22 +816,10 @@ void vtkF3DRenderer::ConfigureGridUsingCurrentActors()
816816

817817
vtkNew<vtkMatrix4x4> upMatrix;
818818
const double m[16] = {
819-
right[0],
820-
right[1],
821-
right[2],
822-
0, //
823-
up[0],
824-
up[1],
825-
up[2],
826-
0, //
827-
front[0],
828-
front[1],
829-
front[2],
830-
0, //
831-
0,
832-
0,
833-
0,
834-
1, //
819+
right[0], right[1], right[2], 0, //
820+
up[0], up[1], up[2], 0, //
821+
front[0], front[1], front[2], 0, //
822+
0, 0, 0, 1, //
835823
};
836824
upMatrix->DeepCopy(m);
837825
vtkNew<vtkMatrix4x4> upMatrixInv;
@@ -967,22 +955,10 @@ void vtkF3DRenderer::ConfigureGridAxesUsingCurrentActors()
967955

968956
vtkNew<vtkMatrix4x4> upMatrix;
969957
const double m[16] = {
970-
right[0],
971-
right[1],
972-
right[2],
973-
0, //
974-
up[0],
975-
up[1],
976-
up[2],
977-
0, //
978-
front[0],
979-
front[1],
980-
front[2],
981-
0, //
982-
0,
983-
0,
984-
0,
985-
1, //
958+
right[0], right[1], right[2], 0, //
959+
up[0], up[1], up[2], 0, //
960+
front[0], front[1], front[2], 0, //
961+
0, 0, 0, 1, //
986962
};
987963
upMatrix->DeepCopy(m);
988964
vtkNew<vtkMatrix4x4> upMatrixInv;

vtkext/private/module/vtkF3DRenderer.h

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -518,14 +518,10 @@ class vtkF3DRenderer : public vtkOpenGLRenderer
518518
void SetUIDeltaTime(double time);
519519

520520
/**
521-
* Add to the total animation time (cumulative time of each frame being rendered) in seconds
521+
* Set/Get the total animation time (cumulative time of each frame being rendered) in seconds
522522
*/
523-
void AddTime(double time);
524-
525-
/**
526-
* Gets total time of render
527-
*/
528-
double GetTime();
523+
vtkSetMacro(TotalTime, double);
524+
vtkGetMacro(TotalTime, double);
529525

530526
/**
531527
* Set console badge enabled status

vtkext/private/module/vtkF3DUserRenderPass.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ void vtkF3DUserRenderPass::Render(const vtkRenderState* s)
7474
vtkShaderProgram::Substitute(FSSource, "//VTK::FSQ::Decl",
7575
"uniform sampler2D source;\n"
7676
"uniform ivec2 resolution;\n"
77-
"uniform double time;\n"
77+
"uniform float time;\n"
7878
"//VTK::FSQ::Decl");
7979

8080
vtkShaderProgram::Substitute(FSSource, "//VTK::FSQ::Decl", this->UserShader);

0 commit comments

Comments
 (0)