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

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:
  • Field Details

    • serialVersionUID

      private static final long serialVersionUID
      See Also:
    • 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 Details

    • 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 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:
      dispose in class VolumeClipEffect
    • 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:
      OnLoadPrograms in class VolumeClipEffect
    • 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(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/off
      bUseNewImage - 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.