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:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate float[]stores the gradient magnitude filter on/off value:private booleanWhen true the volume data is color.private static final longFields 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_PLANESFields inherited from class WildMagic.LibGraphics.Effects.ShaderEffect
m_iPassQuantity, m_kAlphaState, m_kCompiledPrograms, m_kPShader, m_kVShader -
Constructor Summary
ConstructorsConstructorDescriptionVolumeCalcEffect(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
Modifier and TypeMethodDescriptionvoiddispose()memory cleanup.voidOnLoadPrograms(int iPass, WildMagic.LibGraphics.Shaders.Program pkVProgram, WildMagic.LibGraphics.Shaders.Program pkPProgram, WildMagic.LibGraphics.Shaders.Program pkCProgram) voidSetIsoVal(float fVal) voidSetStepSize(float fX, float fY, float fZ) Sets the step size shader parameter.voidSetStepSize(VolumeImage kVolumeImage) Sets the step size shader parameter.voidSetVolumeIndex(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, setVolumeMatrixMethods 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, SetVShaderMethods inherited from class WildMagic.LibGraphics.Effects.Effect
DrawMethods inherited from class WildMagic.LibGraphics.ObjectSystem.GraphicsObject
GetID, GetName, GetNextID, GetObjectByIDBase, GetObjectByNameBase, SetNameMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface WildMagic.LibGraphics.ObjectSystem.StreamInterface
GetDiskUsed, Link, Load, Register, Save, SaveStrings
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
m_bIsColor
private boolean m_bIsColorWhen true the volume data is color. -
m_afMinMax
private float[] m_afMinMaxstores the gradient magnitude filter on/off value:
-
-
Constructor Details
-
VolumeCalcEffect
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
For creating the surface mask texture.- Parameters:
kVolumeImage- Volume datakClip- current clipping state.
-
VolumeCalcEffect
For creating the surface mask texture.- Parameters:
kVolumeImage- Volume datakClip- current clipping state.
-
-
Method Details
-
dispose
public void dispose()memory cleanup.- Overrides:
disposein classVolumeClipEffect
-
OnLoadPrograms
public void OnLoadPrograms(int iPass, WildMagic.LibGraphics.Shaders.Program pkVProgram, WildMagic.LibGraphics.Shaders.Program pkPProgram, WildMagic.LibGraphics.Shaders.Program pkCProgram) - Overrides:
OnLoadProgramsin 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
Sets the step size shader parameter.- Parameters:
kVolumeImage- the shared volume data and textures.
-
SetVolumeIndex
public void SetVolumeIndex(int iIndex)
-