VolumeViz/vvizfnc_frag.h File Reference

This file contains various utility method. More...

Go to the source code of this file.

Functions

vec4 VVizOverOperator (vec4 underCol, vec4 overCol)
float VVizGetLuminance (VVIZ_DATATYPE data)
vec3 VVizGetNearestCoord (in VVizVoxelInfo voxelInfo)
vec3 VVizComputePreintegratedGradient (vec3 tcoord0, vec3 tcoord1)
vec3 VVizComputePreintegratedGradient (VVizDataSetId tex, vec3 tcoord0, vec3 tcoord1)
vec3 VVizComputePreintegratedGradient (VVizDataSetId tex, inout VVizVoxelInfo voxelInfoFront, in VVizVoxelInfo voxelInfoBack)
vec3 VVizComputeNormal (vec3 view, vec3 grad)
vec3 VVizComputeNormal (vec3 view, vec3 grad, float gradNorm)
vec3 VVizComputeNormal (vec3 tcoordVirt)
vec4 VVizComputeIsoMaterial (VVizDataSetId tex, in VVizVoxelInfo voxelInfoFront, in VVizVoxelInfo voxelInfoBack, int maskId)
vec4 VVizComputePreIntegrated (VVIZ_DATATYPE sf, VVIZ_DATATYPE sb)
vec4 VVizComputePreIntegrated (VVIZ_DATATYPE sf, VVIZ_DATATYPE sb, int mask)
vec4 VVizComputePreIntegrated (inout VVizVoxelInfo voxelInfoFront, in VVizVoxelInfo voxelInfoBack, int mask)
vec4 VVizComputeVolumeRendering (VVIZ_DATATYPE sf)
vec4 VVizComputeVolumeRendering (inout VVizVoxelInfo voxelInfoFront, int mask)
vec4 VVizComputeVolumeRendering (VVIZ_DATATYPE sf, int tfId)
vec2 VVizComputeDiffuseAndSpecularCoeffs (vec3 normal, float gradLength, float threshold, vec3 lightVec, vec3 halfVec, float shininess)
vec3 VVizApplySurfaceScalarInternal (vec3 baseColor, vec3 lightedColor, float gradLength)
vec3 VVizApplySurfaceScalar (vec3 baseColor, vec3 lightedColor, float gradLength)
vec4 VVizComputeVolumeRenderingLighting (in vec4 col, in vec3 normal, in float gradLength)
vec4 VVizComputePreintegratedLighting (in vec4 col, in vec3 normal, in float gradLength)
vec3 VVizComputeViewVec ()
bool VVizIsOutsideTexture (in vec3 tcoord)
bool VVizIsOutsideVolume (in vec3 tcoord)
bool VVizIsOutsideOrOnVolumeBorder (in vec3 tcoord)
VVIZ_DATATYPE VVizGetDataPhysicalLod (sampler3D tex, vec3 tcoord, float lod)
VVIZ_DATATYPE VVizGetDataPhysicalLod (sampler2D tex, vec2 tcoord, float lod)
float VVizGetProjectedDepth (in vec3 tcoord)
vec2 VVizGetScreenCoord ()
bool VVizIsTransparent (in float alphaValue)
bool VVizIsOpaque (in float alphaValue)
vec4 VVizTextureLod (sampler3D tex, vec3 tcoord, float mipLevel)
vec4 VVizTextureLod (sampler2D tex, vec2 tcoord, float mipLevel)
vec4 VVizTextureLod (sampler2D tex, vec3 tcoord, float mipLevel)
vec4 VVizGetColor (VVizDataSetId dataset, in vec3 viewVec, in vec3 rayDir, inout VVizVoxelInfo voxel, in VVizVoxelInfo previousVoxel)
void VVizComputeGradientCommon (in vec3 tcoordFront, in vec3 tcoordBack, out vec3 gradient, out vec3 normal)
void VVizComputeGradientCommon (VVizDataSetId dataset, in vec3 tcoordFront, in vec3 tcoordBack, out vec3 gradient, out vec3 normal)

Detailed Description

This file contains various utility method.

Definition in file vvizfnc_frag.h.


Function Documentation

vec3 VVizApplySurfaceScalar ( vec3  baseColor,
vec3  lightedColor,
float  gradLength 
)
vec3 VVizApplySurfaceScalarInternal ( vec3  baseColor,
vec3  lightedColor,
float  gradLength 
)
vec2 VVizComputeDiffuseAndSpecularCoeffs ( vec3  normal,
float  gradLength,
float  threshold,
vec3  lightVec,
vec3  halfVec,
float  shininess 
)
void VVizComputeGradientCommon ( VVizDataSetId  dataset,
in vec3  tcoordFront,
in vec3  tcoordBack,
out vec3  gradient,
out vec3  normal 
)
void VVizComputeGradientCommon ( in vec3  tcoordFront,
in vec3  tcoordBack,
out vec3  gradient,
out vec3  normal 
)
vec4 VVizComputeIsoMaterial ( VVizDataSetId  tex,
in VVizVoxelInfo  voxelInfoFront,
in VVizVoxelInfo  voxelInfoBack,
int  maskId 
)

Returns the color of the lighted pixel belonging to the isosurface.

sf and sb are usually the volume data which have the texture coordinate gl_TexCoord[0] and gl_TexCoord[1] computed by VVizComputeFrontSliceTexCoord and VVizComputeBackSliceTexCoord. If there is no isosurface between sf and sb, a transparent pixel will be returned. Lighting is computed with the first directional light found in the scene graph.
Because it needs a special texture, this function can only be used with SoVolumeIsosurface.

vec3 VVizComputeNormal ( vec3  tcoordVirt  ) 

Compute normal in surface of 2D shapes (slices, volumeGeometry, volumeSkin, hzighfield) at given coordinates.

Normal is returned in eye space. If bump mapping is currently enabled, the normal corresponding to bump effect will be returned.

vec3 VVizComputeNormal ( vec3  view,
vec3  grad,
float  gradNorm 
)
vec3 VVizComputeNormal ( vec3  view,
vec3  grad 
)

Returns the current normal.

vec4 VVizComputePreIntegrated ( inout VVizVoxelInfo  voxelInfoFront,
in VVizVoxelInfo  voxelInfoBack,
int  mask 
)
vec4 VVizComputePreIntegrated ( VVIZ_DATATYPE  sf,
VVIZ_DATATYPE  sb,
int  mask 
)
vec4 VVizComputePreIntegrated ( VVIZ_DATATYPE  sf,
VVIZ_DATATYPE  sb 
)

Convert the volume data values (sf, sb) to a color by lookup in the pre-integrated table.

The pre-integrated table is a precomputed table which gives an approximation of the volume rendering integral between two slices.
Because it needs a special texture, this function can only be used with SoVolumeRenderingQuality.

vec3 VVizComputePreintegratedGradient ( VVizDataSetId  tex,
inout VVizVoxelInfo  voxelInfoFront,
in VVizVoxelInfo  voxelInfoBack 
)
vec3 VVizComputePreintegratedGradient ( VVizDataSetId  tex,
vec3  tcoord0,
vec3  tcoord1 
)
vec3 VVizComputePreintegratedGradient ( vec3  tcoord0,
vec3  tcoord1 
)

Returns the gradient at the center of the two slices.

vec4 VVizComputePreintegratedLighting ( in vec4  col,
in vec3  normal,
in float  gradLength 
)

Add lighting to the color col in the case of pre-integrated rendering.

col is usually the result of VVizComputePreintegrated. The difference with the VVizComputeVolumeRenderingLighting function is that the normal used for lighting is at the middle of the space between the front and the back slice. Lighting is computed with the first directional light found in the scene graph.
Because it needs a special texture, this function can only be used with SoVolumeRenderingQuality.

vec3 VVizComputeViewVec (  ) 

Returns the current viewing vector.

vec4 VVizComputeVolumeRendering ( VVIZ_DATATYPE  sf,
int  tfId 
)
vec4 VVizComputeVolumeRendering ( inout VVizVoxelInfo  voxelInfoFront,
int  mask 
)
vec4 VVizComputeVolumeRendering ( VVIZ_DATATYPE  sf  ) 

Returns the conversion of the volume data value sf to color by lookup in the colormap.

vec4 VVizComputeVolumeRenderingLighting ( in vec4  col,
in vec3  normal,
in float  gradLength 
)

Add lighting to the color col.

col is usually the result of VVizComputeVolumeRendering.

vec4 VVizGetColor ( VVizDataSetId  dataset,
in vec3  viewVec,
in vec3  rayDir,
inout VVizVoxelInfo  voxel,
in VVizVoxelInfo  previousVoxel 
)
VVIZ_DATATYPE VVizGetDataPhysicalLod ( sampler2D  tex,
vec2  tcoord,
float  lod 
)

Sample texture without converting from virtual to physical texture coords.

VVIZ_DATATYPE VVizGetDataPhysicalLod ( sampler3D  tex,
vec3  tcoord,
float  lod 
)

Sample texture without converting from virtual to physical texture coords.

float VVizGetLuminance ( VVIZ_DATATYPE  data  ) 

Compute the luminance of a voxel value.

Parameters:
data value to convert
Returns:
Luminance of data.
vec3 VVizGetNearestCoord ( in VVizVoxelInfo  voxelInfo  ) 

Returns virtual coordinates of nearest voxel center, taking in account current voxel resolution.

This can be used to avoid having interpolation issues by taking the true value of voxel.

float VVizGetProjectedDepth ( in vec3  tcoord  ) 

Return depth in screen space (range [0, 1].

0 is nearClip, 1 is farClip) of the specified virtual space coordinate.

vec2 VVizGetScreenCoord (  ) 

Return screen coordinates (range [0, 1]) of current fragment center.

Note that if using lowResScale the center of the corresponding FULL resolution fragment is returned. This can be useful when using screen space effects (like depth peeling) to retrieve the value of the current fragment.

bool VVizIsOpaque ( in float  alphaValue  ) 

Return true if alphaValue is considered as fully opaque.

bool VVizIsOutsideOrOnVolumeBorder ( in vec3  tcoord  ) 

True if tcoord is on the volume's boundary voxel or out of the volume.

bool VVizIsOutsideTexture ( in vec3  tcoord  ) 
bool VVizIsOutsideVolume ( in vec3  tcoord  ) 
bool VVizIsTransparent ( in float  alphaValue  ) 

Return true if alphaValue is considered as fully transparent.

vec4 VVizOverOperator ( vec4  underCol,
vec4  overCol 
)

Blend 2 colors using the over operator, result color is not alpha premultiplied.

Parameters:
underCol First color to blend.
overCol Second color to blend.
Returns:
Blended color.
vec4 VVizTextureLod ( sampler2D  tex,
vec3  tcoord,
float  mipLevel 
)

Helper function to fetch a texel at a specific LOD.

vec4 VVizTextureLod ( sampler2D  tex,
vec2  tcoord,
float  mipLevel 
)

Helper function to fetch a texel at a specific LOD.

vec4 VVizTextureLod ( sampler3D  tex,
vec3  tcoord,
float  mipLevel 
)

Helper function to fetch a texel at a specific LOD.


Open Inventor Toolkit reference manual, generated on 12 Feb 2024
Copyright © Thermo Fisher Scientific All rights reserved.
http://www.openinventor.com/