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:
java.io.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:
RenderViewBase.java
,VolumeImageViewer.java
, Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private float[]
m_afMinMax
stores the gradient magnitude filter on/off value:private boolean
m_bIsColor
When true the volume data is color.private static long
serialVersionUID
-
Fields inherited from class gov.nih.mipav.view.renderer.WildMagic.Render.VolumeClipEffect
CLIP_A, CLIP_A_INV, CLIP_EYE, CLIP_EYE_INV, CLIP_X, CLIP_X_INV, CLIP_Y, CLIP_Y_INV, CLIP_Z, CLIP_Z_INV, m_aafClipData, m_afClipAll, m_afClipOBBAxis0, m_afClipOBBAxis1, m_afClipOBBAxis2, m_afClipOBBExtent, m_afClipSphereCenter, m_afClipSphereScale, m_afDoClip, m_afVolumeMatrix, m_bClipOBB, m_bClipSphere, MAX_CLIP_PLANES
-
-
Constructor Summary
Constructors Constructor Description VolumeCalcEffect(VolumeImage kVolumeImage, VolumeClipEffect kClip)
For creating the surface mask texture.VolumeCalcEffect(VolumeImage kVolumeImage, VolumeClipEffect kClip, boolean bGM)
For creating the surface mask texture.VolumeCalcEffect(VolumeImage kVolumeImage, WildMagic.LibGraphics.Rendering.Texture kTexture)
Create a new VolumeCalcEffect shader with the VolumeImage data.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
dispose()
memory cleanup.void
OnLoadPrograms(int iPass, WildMagic.LibGraphics.Shaders.Program pkVProgram, WildMagic.LibGraphics.Shaders.Program pkPProgram, WildMagic.LibGraphics.Shaders.Program pkCProgram)
void
SetIsoVal(float fVal)
void
SetStepSize(float fX, float fY, float fZ)
Sets the step size shader parameter.void
SetStepSize(VolumeImage kVolumeImage)
Sets the step size shader parameter.void
SetVolumeIndex(int iIndex)
-
Methods inherited from class gov.nih.mipav.view.renderer.WildMagic.Render.VolumeClipEffect
getClip, getClipArb, getClipArbInv, getClipEnable, getClipEye, getClipEyeInv, getClipInv, getClipInvEnable, isClip, isClipAE, isClipOBB, isClipSphere, ResetClip, SetClip, SetClipArb, SetClipArbInv, SetClipEye, SetClipEyeInv, SetClipOBB, SetClipSphere, setVolumeMatrix
-
Methods inherited from class WildMagic.LibGraphics.Effects.ShaderEffect
GetAllObjectsByName, GetBlending, GetCProgram, GetDiskUsed, GetObjectByID, GetObjectByName, GetPassQuantity, GetPProgram, GetSamplerInformation, GetTexture, GetTexture, GetTextureQuantity, GetVProgram, Link, Load, LoadPrograms, LoadResources, OnReleasePrograms, Register, ReleasePrograms, ReleaseResources, RestoreGlobalState, Save, SaveStrings, SetCProgram, SetDefaultAlphaState, SetGlobalState, SetPassQuantity, SetPShader, SetVShader
-
Methods inherited from class WildMagic.LibGraphics.ObjectSystem.GraphicsObject
GetID, GetName, GetNextID, GetObjectByIDBase, GetObjectByNameBase, SetName
-
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
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 Detail
-
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 datakClip
- current clipping state.
-
VolumeCalcEffect
public VolumeCalcEffect(VolumeImage kVolumeImage, VolumeClipEffect kClip, boolean bGM)
For creating the surface mask texture.- Parameters:
kVolumeImage
- Volume datakClip
- current clipping state.
-
-
Method Detail
-
dispose
public void dispose()
memory cleanup.- Overrides:
dispose
in classVolumeClipEffect
-
OnLoadPrograms
public void OnLoadPrograms(int iPass, WildMagic.LibGraphics.Shaders.Program pkVProgram, WildMagic.LibGraphics.Shaders.Program pkPProgram, WildMagic.LibGraphics.Shaders.Program pkCProgram)
- Overrides:
OnLoadPrograms
in classVolumeClipEffect
-
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)
-
-