Class VolumeCalcEffect

java.lang.Object
WildMagic.LibGraphics.ObjectSystem.GraphicsObject
WildMagic.LibGraphics.Effects.Effect
WildMagic.LibGraphics.Effects.ShaderEffect
gov.nih.mipav.view.renderer.WildMagic.Render.VolumeClipEffect
gov.nih.mipav.view.renderer.WildMagic.Render.VolumeCalcEffect
All Implemented Interfaces:
Serializable, WildMagic.LibGraphics.ObjectSystem.NameIdInterface, WildMagic.LibGraphics.ObjectSystem.StreamInterface

public class VolumeCalcEffect extends VolumeClipEffect implements WildMagic.LibGraphics.ObjectSystem.StreamInterface
ShaderEffect class for calculating the volume normals on the GPU. The volume normals are calculated in two passes with two different shaders. The shader code is based on the normal calculation function in RenderViewBase.java. The first pass calculates the fDX, fDY, and fDZ values for the voxels. The second pass calculates the normals as the average of the current voxel normal with it's 6 axis-aligned neighbors. All calculations are done on the GPU, the textures remain on the GPU and are not copied into system memory. After both passes are complete, the texture containing the normals is accessible through the VolumeImage.GetNormalMapTarget() Texture. The VolumeImageViewer class applies the VolumeCalcEffect and maps the output textures to the VolumeImage object normal map texture.
See Also:
  • invalid reference
    RenderViewBase.java
  • invalid reference
    VolumeImageViewer.java
  • Serialized Form
  • Field Details

    • serialVersionUID

      private static final long serialVersionUID
      See Also:
    • m_bIsColor

      private boolean m_bIsColor
      When true the volume data is color.
    • m_afMinMax

      private float[] m_afMinMax
      stores the gradient magnitude filter on/off value:
  • Constructor Details

    • VolumeCalcEffect

      public VolumeCalcEffect(VolumeImage kVolumeImage, WildMagic.LibGraphics.Rendering.Texture kTexture)
      Create a new VolumeCalcEffect shader with the VolumeImage data. This fn creates the first-pass shader.
      Parameters:
      kVolumeImageA - the shared volume data and textures.
    • VolumeCalcEffect

      public VolumeCalcEffect(VolumeImage kVolumeImage, VolumeClipEffect kClip)
      For creating the surface mask texture.
      Parameters:
      kVolumeImage - Volume data
      kClip - current clipping state.
    • VolumeCalcEffect

      public VolumeCalcEffect(VolumeImage kVolumeImage, VolumeClipEffect kClip, boolean bGM)
      For creating the surface mask texture.
      Parameters:
      kVolumeImage - Volume data
      kClip - current clipping state.
  • Method Details

    • dispose

      public void dispose()
      memory cleanup.
      Overrides:
      dispose in class VolumeClipEffect
    • OnLoadPrograms

      public void OnLoadPrograms(int iPass, WildMagic.LibGraphics.Shaders.Program pkVProgram, WildMagic.LibGraphics.Shaders.Program pkPProgram, WildMagic.LibGraphics.Shaders.Program pkCProgram)
      Overrides:
      OnLoadPrograms in class VolumeClipEffect
    • SetIsoVal

      public void SetIsoVal(float fVal)
    • SetStepSize

      public void SetStepSize(float fX, float fY, float fZ)
      Sets the step size shader parameter.
      Parameters:
      kVolumeImage - the shared volume data and textures.
    • SetStepSize

      public void SetStepSize(VolumeImage kVolumeImage)
      Sets the step size shader parameter.
      Parameters:
      kVolumeImage - the shared volume data and textures.
    • SetVolumeIndex

      public void SetVolumeIndex(int iIndex)