Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] Is there anyway I can custom shader for VolumeMapper? #3184

Open
zhaoangus opened this issue Dec 10, 2024 · 1 comment
Open

[Feature] Is there anyway I can custom shader for VolumeMapper? #3184

zhaoangus opened this issue Dec 10, 2024 · 1 comment
Labels
type: feature request 💡 Desired capabilities / enhancements

Comments

@zhaoangus
Copy link

zhaoangus commented Dec 10, 2024

Motivation

I want to mix the colors of two volumeActors that overlap each other,but I cannot find anything that works.

Detailed Description

  1. I tried a blend mode which is ADDITIVE_INTENSITY_BLEND in volumeMapper, but it doesn't work.
  2. I use a way to custom shader refer to PolyDataMapper,like this:

const replaceShader = (volumeMapper: vtkVolumeMapper) => {
const mapperViewProp = volumeMapper.getViewSpecificProperties()
mapperViewProp.OpenGL = {
ShaderReplacements: [],
VertexShaderCode: '',
FragmentShaderCode: '',
GeometryShaderCode: '',
}
mapperViewProp.OpenGL.ShaderReplacements.push({
shaderType: 'Fragment',
originalValue: '//VTK:CustomColorMix',
replaceFirst: true,
replacementValue: '//VTK::Color::Impl\n gl_FragColor = vec4(0.0,1.0,0.0,1.0);\n',
replaceAll: false,
})
}

But that doesn't work either.

So I wonder if there‘s a way to make it?

@zhaoangus zhaoangus added the type: feature request 💡 Desired capabilities / enhancements label Dec 10, 2024
@finetjul
Copy link
Member

You might want to look at this branch that has been merged into beta.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: feature request 💡 Desired capabilities / enhancements
Projects
None yet
Development

No branches or pull requests

2 participants