Skip to content

Commit

Permalink
refactor(mapper): multiple configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
rodrigobasilio2022 authored and floryst committed Oct 23, 2023
1 parent bc77fa8 commit a57b779
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions Sources/Rendering/OpenGL/VolumeMapper/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -261,11 +261,11 @@ function vtkOpenGLVolumeMapper(publicAPI, model) {
if (model.zBufferTexture !== null) {
FSSource = vtkShaderProgram.substitute(FSSource, '//VTK::ZBuffer::Dec', [
'uniform sampler2D zBufferTexture;',
'uniform float vpWidth;',
'uniform float vpHeight;',
'uniform float vpZWidth;',
'uniform float vpZHeight;',
]).result;
FSSource = vtkShaderProgram.substitute(FSSource, '//VTK::ZBuffer::Impl', [
'vec4 depthVec = texture2D(zBufferTexture, vec2(gl_FragCoord.x / vpWidth, gl_FragCoord.y/vpHeight));',
'vec4 depthVec = texture2D(zBufferTexture, vec2(gl_FragCoord.x / vpZWidth, gl_FragCoord.y/vpZHeight));',
'float zdepth = (depthVec.r*256.0 + depthVec.g)/257.0;',
'zdepth = zdepth * 2.0 - 1.0;',
'if (cameraParallel == 0) {',
Expand Down Expand Up @@ -650,8 +650,8 @@ function vtkOpenGLVolumeMapper(publicAPI, model) {
const size = model._useSmallViewport
? [model._smallViewportWidth, model._smallViewportHeight]
: model._openGLRenderWindow.getFramebufferSize();
program.setUniformf('vpWidth', size[0]);
program.setUniformf('vpHeight', size[1]);
program.setUniformf('vpZWidth', size[0]);
program.setUniformf('vpZHeight', size[1]);
}
};

Expand Down

0 comments on commit a57b779

Please sign in to comment.