Skip to content

[Bug] Volume Shader compile error with GradientOpacity and clippingPlane  #2830

@PaulHax

Description

@PaulHax

Bug description

Getting shader compile error in vtkVolumeFS.glsl

ROR: 0:402: 'IStoVC' : no matching overloaded function found
ERROR: 0:402: '=' : dimension mismatch
ERROR: 0:402: '=' : cannot convert from 'const mediump float' to 'highp 3-component vector of float'

Steps to reproduce

Add these lines to VolumeMapperBlendModes example:

import vtkPlane from '@kitware/vtk.js/Common/DataModel/Plane';
actor.getProperty().setUseGradientOpacity(0, true);
const clipPlane1 = vtkPlane.newInstance();
mapper.addClippingPlane(clipPlane1);

Detailed Behavior

Trouble is somewhere around here:

// compute the normal and gradient magnitude for a position, uses forward difference
#if (vtkLightComplexity > 0) || (defined vtkGradientOpacityOn)
#ifdef vtkClippingPlanesOn
void adjustClippedVoxelValues(vec3 pos, vec3 texPos[3], inout vec3 g1)
{
vec3 g1VC[3];
for (int i = 0; i < 3; ++i)
{
g1VC[i] = IStoVC(texPos[i]);
}
vec3 posVC = IStoVC(pos);

Expected Behavior

No shader compile error.

Environment

  • vtk.js version: v28.0.0
  • Browsers: Chrome
  • OS: Linux

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions