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:
java.io.Serializable,WildMagic.LibGraphics.ObjectSystem.NameIdInterface,WildMagic.LibGraphics.ObjectSystem.StreamInterface
public class SurfaceLightingEffect extends VolumeClipEffect
Surface lighting uses the lights defined in the Volume/Surface/Tri-Planar view in the vertex and pixel shaders.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private booleanm_bPerPixelLightingprivate booleanm_bUseNewImageprivate booleanm_bUseNewLUTprivate floatm_fBlendprivate intm_iReverseFaceprivate WildMagic.LibGraphics.Rendering.GraphicsImagem_kColorMapNewprivate ModelImagem_kImageNewprivate ModelStorageBasem_kLUTNewprivate WildMagic.LibGraphics.Shaders.PixelShaderm_kPPixelLightingprivate WildMagic.LibGraphics.Shaders.PixelShaderm_kPVertexLightingprivate VolumeImagem_kVolumeImageprivate WildMagic.LibGraphics.Rendering.GraphicsImagem_kVolumeImageNewprivate WildMagic.LibGraphics.Rendering.Texturem_kVolumeLUTNewprivate WildMagic.LibGraphics.Rendering.Texturem_kVolumeTextureNewprivate WildMagic.LibGraphics.Shaders.VertexShaderm_kVPixelLightingprivate WildMagic.LibGraphics.Shaders.VertexShaderm_kVVertexLightingprivate static longserialVersionUID-
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 SurfaceLightingEffect(VolumeImage[] images, WildMagic.LibGraphics.Rendering.Texture colormap)SurfaceLightingEffect(VolumeImage kImageA, boolean bTransparent)Creates a LightingEffect
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidBlend(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.voidSetLight(java.lang.String kLightType, float[] afType)Sets 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, 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
-
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
m_kVolumeImage
private VolumeImage 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
private ModelImage m_kImageNew
-
m_kLUTNew
private ModelStorageBase m_kLUTNew
-
-
Constructor Detail
-
SurfaceLightingEffect
public SurfaceLightingEffect(VolumeImage kImageA, boolean bTransparent)
Creates a LightingEffect- Parameters:
kImageA- VolumeImage containing data and textures for the effect.
-
SurfaceLightingEffect
public SurfaceLightingEffect(VolumeImage[] images, WildMagic.LibGraphics.Rendering.Texture colormap)
-
-
Method Detail
-
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
public void SetImageNew(ModelImage kImage)
Sets alternate volume data for texture mapping.- Parameters:
kImage- alternate volume data for texture mapping.
-
SetLight
public void SetLight(java.lang.String kLightType, float[] afType)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
public void SetLUTNew(ModelStorageBase kLUT)
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.
-
-