Class SurfaceLightingEffect
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.SurfaceLightingEffect
- All Implemented Interfaces:
Serializable,WildMagic.LibGraphics.ObjectSystem.NameIdInterface,WildMagic.LibGraphics.ObjectSystem.StreamInterface
Surface lighting uses the lights defined in the Volume/Surface/Tri-Planar view in the vertex and pixel shaders.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate booleanprivate booleanprivate booleanprivate floatprivate intprivate WildMagic.LibGraphics.Rendering.GraphicsImageprivate ModelImageprivate ModelStorageBaseprivate WildMagic.LibGraphics.Shaders.PixelShaderprivate WildMagic.LibGraphics.Shaders.PixelShaderprivate VolumeImageprivate WildMagic.LibGraphics.Rendering.GraphicsImageprivate WildMagic.LibGraphics.Rendering.Textureprivate WildMagic.LibGraphics.Rendering.Textureprivate WildMagic.LibGraphics.Shaders.VertexShaderprivate WildMagic.LibGraphics.Shaders.VertexShaderprivate 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
ConstructorsConstructorDescriptionSurfaceLightingEffect(VolumeImage[] images, WildMagic.LibGraphics.Rendering.Texture colormap) SurfaceLightingEffect(VolumeImage kImageA, boolean bTransparent) Creates a LightingEffect -
Method Summary
Modifier and TypeMethodDescriptionvoidBlend(float fValue) Sets surface blend/transparency value for alph-blending in the shader.voiddispose()Delete memoryvoidDropper(WildMagic.LibFoundation.Mathematics.Vector3f kTexCoord, WildMagic.LibFoundation.Mathematics.ColorRGBA rkDropperColor) Reads the surface color from the texture map at the given location.voidOnLoadPrograms(int iPass, WildMagic.LibGraphics.Shaders.Program pkVProgram, WildMagic.LibGraphics.Shaders.Program pkPProgram, WildMagic.LibGraphics.Shaders.Program pkCProgram) voidSetClipping(boolean bClip) Enables/disables surface clipping for the per-pixel shader.private voidSetColorImage(WildMagic.LibGraphics.Shaders.Program pkCProgram) Sets the IsColor shader parameter values.voidSetImageNew(ModelImage kImage) Sets alternate volume data for texture mapping.voidSets the light type for the given light.voidSetLUTNew(ModelStorageBase kLUT) Sets the alternate LUT for surface texture mapping.voidSetPerPixelLighting(boolean bOn) Sets the lighting shader to be per-pixel or per-vertex.voidSetReverseFace(int iReverse) Flag to reverse the direction of the triangle faces inside the vertex shader.voidSetSurfaceTexture(boolean bTextureOn, boolean bUseNewImage, boolean bUseNewLUT) Sets the surface texture on/off.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, SetName
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
m_kVolumeImage
-
m_fBlend
private float m_fBlend -
m_iReverseFace
private int m_iReverseFace -
m_kVVertexLighting
private WildMagic.LibGraphics.Shaders.VertexShader m_kVVertexLighting -
m_kPVertexLighting
private WildMagic.LibGraphics.Shaders.PixelShader m_kPVertexLighting -
m_kVPixelLighting
private WildMagic.LibGraphics.Shaders.VertexShader m_kVPixelLighting -
m_kPPixelLighting
private WildMagic.LibGraphics.Shaders.PixelShader m_kPPixelLighting -
m_bPerPixelLighting
private boolean m_bPerPixelLighting -
m_kVolumeTextureNew
private WildMagic.LibGraphics.Rendering.Texture m_kVolumeTextureNew -
m_kVolumeImageNew
private WildMagic.LibGraphics.Rendering.GraphicsImage m_kVolumeImageNew -
m_kVolumeLUTNew
private WildMagic.LibGraphics.Rendering.Texture m_kVolumeLUTNew -
m_kColorMapNew
private WildMagic.LibGraphics.Rendering.GraphicsImage m_kColorMapNew -
m_bUseNewLUT
private boolean m_bUseNewLUT -
m_bUseNewImage
private boolean m_bUseNewImage -
m_kImageNew
-
m_kLUTNew
-
-
Constructor Details
-
SurfaceLightingEffect
Creates a LightingEffect- Parameters:
kImageA- VolumeImage containing data and textures for the effect.
-
SurfaceLightingEffect
public SurfaceLightingEffect(VolumeImage[] images, WildMagic.LibGraphics.Rendering.Texture colormap)
-
-
Method Details
-
Blend
public void Blend(float fValue) Sets surface blend/transparency value for alph-blending in the shader.- Parameters:
fValue- surface blend/transparency value for alph-blending in the shader.
-
dispose
public void dispose()Delete memory- Overrides:
disposein classVolumeClipEffect
-
Dropper
public void Dropper(WildMagic.LibFoundation.Mathematics.Vector3f kTexCoord, WildMagic.LibFoundation.Mathematics.ColorRGBA rkDropperColor) Reads the surface color from the texture map at the given location.- Parameters:
kTexCoord- texture location.rkDropperColor- returned color.
-
OnLoadPrograms
public void OnLoadPrograms(int iPass, WildMagic.LibGraphics.Shaders.Program pkVProgram, WildMagic.LibGraphics.Shaders.Program pkPProgram, WildMagic.LibGraphics.Shaders.Program pkCProgram) - Overrides:
OnLoadProgramsin classVolumeClipEffect
-
SetClipping
public void SetClipping(boolean bClip) Enables/disables surface clipping for the per-pixel shader.- Parameters:
bClip- surface clipping on/off.
-
SetImageNew
Sets alternate volume data for texture mapping.- Parameters:
kImage- alternate volume data for texture mapping.
-
SetLight
Sets the light type for the given light.- Parameters:
kLightType- the name of the light to set (Light0, Light1, etc.)afType- the type of light (Ambient = 0, Directional = 1, Point = 2, Spot = 3).
-
SetLUTNew
Sets the alternate LUT for surface texture mapping.- Parameters:
kLUT- LUT for grayscale images.kRGBT- LUT for color images.
-
SetPerPixelLighting
public void SetPerPixelLighting(boolean bOn) Sets the lighting shader to be per-pixel or per-vertex.- Parameters:
bOn- turns per-pixel lighting on/off.
-
SetReverseFace
public void SetReverseFace(int iReverse) Flag to reverse the direction of the triangle faces inside the vertex shader. Useful for rendering from inside a mesh.- Parameters:
iReverse- 1 reverses the triangle face direction, 0 does nothing.
-
SetSurfaceTexture
public void SetSurfaceTexture(boolean bTextureOn, boolean bUseNewImage, boolean bUseNewLUT) Sets the surface texture on/off.- Parameters:
bTextureOn- texture on/offbUseNewImage- indicates which volume to use as the texture.bUseNewLUT- indicates which LUT to use.
-
SetColorImage
private void SetColorImage(WildMagic.LibGraphics.Shaders.Program pkCProgram) Sets the IsColor shader parameter values.
-