Inviwo  0.9.10.1
Inviwo documentation
glsl Namespace Reference

Classes

class  Abuffergeometrygl
 
class  Axisalignedcutplaneboundingbox
 
class  Axisalignedcutplaneslice
 
class  Background
 
class  Bilateralblur
 
class  Bloomblur
 
class  Bloomcompose
 
class  Bloomhighpass
 
class  Brightnesscontrast
 
struct  CameraParameters
 
class  Capnearclipping
 
class  Composite
 
class  Cubeglyph
 
class  Depthdarkening
 
class  Depthlinearize
 
class  Displaytex
 
class  Edgedarken
 
class  Fog
 
class  Fontrendering_freetype
 
class  Fullscreenquad
 
class  Fxaa
 
class  Geometrycustompicking
 
struct  GeometryParameters
 
class  Geometryrendering
 
class  Hbao
 
class  Hbao_blur
 
class  Hbao_deinterleave
 
class  Hbao_reinterleave
 
struct  HBAOData
 
class  Heightfield
 
class  Huesaturationluminance
 
class  Imagegradient
 
class  Imageopacity
 
struct  ImageParameters
 
class  Imagesharpen
 
class  Img_binary
 
class  Img_channel_combine
 
class  Img_channel_select
 
class  Img_color
 
class  Img_convert_cef
 
class  Img_convolution
 
class  Img_copy
 
class  Img_findedges
 
class  Img_gamma
 
class  Img_graysc
 
class  Img_highpass
 
class  Img_identity
 
class  Img_invert
 
class  Img_jacobian
 
class  Img_mapping
 
class  Img_mix
 
class  Img_noise
 
class  Img_normalize
 
class  Img_overlay
 
class  Img_resample
 
class  Img_texturequad
 
class  Isoraycasting
 
struct  IsovalueParameters
 
class  Labelui
 
class  Legend
 
class  Lic2d
 
class  Lic3d
 
class  Lightingraycasting
 
struct  LightParameters
 
class  Lightpropagation
 
class  Lightvolumeblend
 
class  Linerenderer
 
class  Lorenzsystem
 
class  Mesh2drendering
 
class  Meshentryexit
 
class  Meshrendering
 
class  Minimal
 
class  Multichannelraycaster
 
class  Pcp_lines
 
class  Persistencediagram
 
class  Persistencediagramlines
 
class  Picking
 
struct  PlaneParameters
 
class  Pointrenderer
 
class  Raycasting
 
struct  RaycastingParameters
 
class  Rendertexturequad
 
class  Renderui
 
class  Rgbl
 
class  Scatterplot
 
class  Simpleraycasting
 
class  Sphereglyph
 
class  Splitter
 
class  Standard
 
struct  StipplingParameters
 
class  Streamlinesgl
 
class  Textrenderer
 
class  Texturedgeometryrendering
 
class  Tmip
 
class  Tonemapping
 
class  Tuberendering
 
class  Vector2dcurl
 
class  Vector2ddivergence
 
class  Vector2dmagnitude
 
class  Vector3dcurl
 
class  Vector3ddivergence
 
class  Vectorfieldgenerator2d
 
class  Vectorfieldgenerator3d
 
class  Vectorfieldgenerator4d
 
class  Vectormagnitudeprocessor
 
class  Viewnormal
 
class  Volume_binary
 
class  Volume_difference
 
class  Volume_gpu
 
class  Volume_gradient
 
class  Volume_laplacian
 
class  Volume_lowpass
 
class  Volume_mapping
 
class  Volumegradientmagnitude
 
struct  VolumeIndicatorParameters
 
class  Volumemerger
 
struct  VolumeParameters
 
class  Volumeslice
 
class  Widgetrenderer
 
class  Widgettexture
 

Functions

vec4 applyTF (sampler2D transferFunction, vec4 voxel)
 
vec4 applyTF (sampler2D transferFunction, vec4 voxel, int channel)
 
vec4 applyTF (sampler2D transferFunction, float intensity)
 
vec4 compositeDVR (in vec4 curResult, in vec4 color, in float t, inout float tDepth, in float tIncr)
 
vec4 compositeMIP (in vec4 curResult, in vec4 color, in float t, inout float tDepth)
 
vec4 compositeFHP (in vec4 curResult, in vec4 color, in vec3 samplePos, in float t, inout float tDepth)
 
vec4 compositeFHN (in vec4 curResult, in vec4 color, in vec3 gradient, in float t, inout float tDepth)
 
vec4 compositeFHN_VS (in vec4 curResult, in vec4 color, in vec3 gradient, in float t, in CameraParameters camera, inout float tDepth)
 
vec4 compositeFHD (in vec4 curResult, in vec4 color, in float t, inout float tDepth)
 
vec4 compositeISO (in vec4 curResult, in vec4 color, in float intensity, in float t, inout float tDepth, in float tIncr, in float isoValue)
 
vec4 compositeISON (in vec4 curResult, in vec4 color, in float intensity, in vec3 gradient, in float t, inout float tDepth, in float isoValue)
 
float convertScreenToEye (CameraParameters camera, float depthScreen)
 
float convertEyeToScreen (CameraParameters camera, float depthEye)
 
float calculateDepthValue (CameraParameters camera, float t, float entryDepthScreen, float exitDepthScreen)
 
float calculateTValueFromDepthValue (CameraParameters camera, float depth, float entryDepthScreen, float exitDepthScreen)
 
float convertDepthViewToClip (CameraParameters camera, float z)
 
float convertDepthClipToView (CameraParameters camera, float z)
 
float convertDepthScreenToView (CameraParameters camera, float z)
 
float convertDepthViewToScreen (CameraParameters camera, float z)
 
vec3 gradientForwardDiff (vec4 intensity, sampler3D volume, VolumeParameters volumeParams, vec3 samplePos, int channel)
 
vec3 gradientCentralDiff (vec4 intensity, sampler3D volume, VolumeParameters volumeParams, vec3 samplePos, int channel)
 
vec3 gradientBackwardDiff (vec4 intensity, sampler3D volume, VolumeParameters volumeParams, vec3 samplePos, int channel)
 
vec3 gradientCentralDiffH (vec4 intensity, sampler3D volume, VolumeParameters volumeParams, vec3 samplePos, int channel)
 
mat4x3 gradientAllForwardDiff (vec4 intensity, sampler3D volume, VolumeParameters volumeParams, vec3 samplePos)
 
mat4x3 gradientAllCentralDiff (vec4 intensity, sampler3D volume, VolumeParameters volumeParams, vec3 samplePos)
 
mat4x3 gradientAllBackwardDiff (vec4 intensity, sampler3D volume, VolumeParameters volumeParams, vec3 samplePos)
 
mat4x3 gradientAllCentralDiffH (vec4 intensity, sampler3D volume, VolumeParameters volumeParams, vec3 samplePos)
 
vec3 gradientPrecomputedXYZ (vec4 intensity, VolumeParameters volumeParams)
 
vec3 gradientPrecomputedYZW (vec4 intensity, VolumeParameters volumeParams)
 
bool rayPlaneIntersection (in PlaneParameters plane, in vec3 point, in vec3 rayDir, inout float t0, in float t1)
 
vec4 drawIsosurface (in vec4 curResult, in float isovalue, in vec4 isosurfaceColor, in vec4 voxel, in vec4 previousVoxel, in sampler3D volume, in VolumeParameters volumeParameters, in int channel, in sampler2D transferFunction, in CameraParameters camera, in LightParameters lighting, in vec3 rayPosition, in vec3 rayDirection, in vec3 toCameraDir, in float t, in float raySegmentLen, inout float tIncr, inout float tDepth)
 
vec4 drawIsosurfaces (in vec4 curResult, in IsovalueParameters isoparams, in vec4 voxel, in vec4 previousVoxel, in sampler3D volume, in VolumeParameters volumeParameters, in int channel, in sampler2D transferFunction, in CameraParameters camera, in LightParameters lighting, in vec3 rayPosition, in vec3 rayDirection, in vec3 toCameraDir, in float t, inout float tIncr, inout float tDepth)
 
uint reverseByte (uint b)
 
vec3 pickingIndexToColor (uint id)
 
uint pickingColorToIndex (vec3 color)
 
vec4 drawPlanes (in vec4 oldres, in vec3 pos, in vec3 dir, in float inc, PlaneParameters plane, in float t, inout float tDepth)
 
vec4 drawPlanes (in vec4 oldres, in vec3 pos, in vec3 dir, in float inc, PlaneParameters plane1, PlaneParameters plane2, in float t, inout float tDepth)
 
vec4 drawPlanes (in vec4 oldres, in vec3 pos, in vec3 dir, in float inc, PlaneParameters plane1, PlaneParameters plane2, PlaneParameters plane3, in float t, inout float tDepth)
 
vec4 drawBackground (in vec4 oldres, in float depth, in float inc, in vec4 color, in float bgDepth, inout float tDepth)
 
vec4 textureLookup2Dnormalized (sampler2D tex, ImageParameters textureParams, vec2 samplePos)
 
vec4 textureLookup2Dscreen (sampler2D tex, ImageParameters textureParams, vec2 samplePos)
 
vec4 getVoxel (sampler3D volume, VolumeParameters volumeParams, vec3 samplePos)
 
vec4 getNormalizedVoxel (sampler3D volume, VolumeParameters volumeParams, vec3 samplePos)
 
float getNormalizedVoxelChannel (sampler3D volume, VolumeParameters volumeParams, vec3 samplePos, int channel)
 
vec4 getSignNormalizedVoxel (sampler3D volume, VolumeParameters volumeParams, vec3 samplePos)
 
vec4 getVoxel (sampler3D volume, VolumeParameters volumeParams, ivec3 samplePos)
 
vec4 getNormalizedVoxel (sampler3D volume, VolumeParameters volumeParams, ivec3 samplePos)
 
vec4 getSignNormalizedVoxel (sampler3D volume, VolumeParameters volumeParams, ivec3 samplePos)
 
vec3 shadeDiffuseCalculation (LightParameters light_, vec3 materialDiffuseColor, vec3 normal, vec3 toLightDir)
 
vec3 shadeSpecularBlinnPhongCalculation (LightParameters light_, vec3 materialSpecularColor, vec3 normal, vec3 toLightDir, vec3 toCameraDir)
 
vec3 shadeSpecularPhongCalculation (LightParameters light_, vec3 materialSpecularColor, vec3 normal, vec3 toLightDir, vec3 toCameraDir)
 
vec3 shadeAmbient (LightParameters light_, vec3 materialAmbientColor)
 
vec3 shadeDiffuse (LightParameters light_, vec3 materialDiffuseColor, vec3 position, vec3 normal)
 
vec3 shadeSpecular (LightParameters light_, vec3 materialSpecularColor, vec3 position, vec3 normal, vec3 toCameraDir)
 
vec3 shadeBlinnPhong (LightParameters light_, vec3 materialAmbientColor, vec3 materialDiffuseColor, vec3 materialSpecularColor, vec3 position, vec3 normal, vec3 toCameraDir)
 
vec3 shadePhong (LightParameters light_, vec3 materialAmbientColor, vec3 materialDiffuseColor, vec3 materialSpecularColor, vec3 position, vec3 normal, vec3 toCameraDir)
 
vec3 right (in CameraParameters camera)
 
vec3 up (in CameraParameters camera)
 
vec3 direction (in CameraParameters camera)
 
 layout (binding=0, offset=0) uniform atomic_uint atomicPageCounter
 
bool semaphoreAcquire (ivec2 coords)
 
void semaphoreRelease (ivec2 coords)
 
bool getSemaphore (ivec2 coords)
 
void setSemaphore (ivec2 coords, bool val)
 
uint getPixelCurrentPage (ivec2 coords)
 
void setPixelCurrentPage (ivec2 coords, uint newpageidx)
 
uint getPixelFragCounter (ivec2 coords)
 
void setPixelFragCounter (ivec2 coords, uint val)
 
uint pixelFragCounterAtomicAdd (ivec2 coords, uint val)
 
uint sharedPoolGetLink (uint pageNum)
 
void sharedPoolSetLink (uint pageIdx, uint pointer)
 
void sharedPool_GetRGBAValue (uint index, out u8vec4 val)
 
void sharedPool_GetExtValue (uint index, out float val)
 
void sharedPool_SetRGBAValue (uint index, u8vec4 val)
 
void sharedPool_SetExtValue (uint index, float val)
 
void sharedPoolSetValue (uint index, u8vec4 val1, float val2)
 
void sharedPoolGetValue (uint index, out u8vec4 val1, out float val2)
 
void setSharedPageCounter (uint val)
 
uint sharedPageCounterAtomicAdd ()
 
uint getSharedPageCounterAtomicValue ()
 
void main ()
 
void resetABuffer ()
 
void bubbleSort (int array_size)
 
vec2 getPosWithSpacing (vec2 inPos)
 
vec2 getPixelSpacing ()
 
vec2 getPixelCoordsWithSpacing (vec2 inPos)
 
vec2 getGLPositionFromPixel (vec2 pos)
 
vec3 hue2rgb (float hue)
 
vec3 rgb2hcv (vec3 rgb)
 
vec3 hsv2rgb (vec3 hsv)
 
vec3 hsl2rgb (vec3 hsl)
 
vec3 hcy2rgb (vec3 hcy)
 
vec3 hcl2rgb (vec3 hcl)
 
vec3 rgb2hsv (vec3 rgb)
 
vec3 rgb2hsl (vec3 rgb)
 
vec3 rgb2hcy (vec3 rgb)
 
vec3 rgb2hcl (vec3 rgb)
 
vec3 computeFog (in vec3 pixelColor, in float distance, in vec3 fogColor, in float density)
 
vec3 computeFogScatter (in vec3 pixelColor, in float distance, in vec3 fogColor, in float scatter)
 
vec3 computeFogInOutScatter (in vec3 pixelColor, in float distance, in vec3 fogColor, in vec3 extinction, in vec3 scatter)
 
vec3 sampleVelocity (vec3 worldPos)
 
vec3 advectEuler (vec3 worldPos, float stepSize)
 
vec3 advectRK4 (vec3 worldPos, float stepSize)
 

Variables

uniform int abufferSharedPoolSize
 
coherent uniform uint * d_abufferPageIdx
 
coherent uniform uint * d_abufferFragCount
 
coherent uniform uint * d_semaphore
 
coherent uniform u8vec4 * d_shared_RGBA_DataPageList
 
coherent uniform float * d_shared_Ext_DataPageList
 
coherent uniform uint * d_sharedLinkList
 
coherent uniform uint * d_curSharedPage
 
uniform bool isInputImageGiven
 
uniform ImageParameters inputimageParameters
 
uniform sampler2D inputimageColor
 
uniform sampler2D inputimageDepth
 
u8vec4 rgba_Array [ABUFFER_SIZE *ABUFFER_DATA_PER_NODE]
 
float ext_Array [ABUFFER_SIZE *ABUFFER_DATA_PER_NODE]
 
uniform ivec2 dims
 
uniform vec4 spacing = vec4(0)
 
uniform vec4 margins
 

Detailed Description

#version 330 layout(location = 0) out vec4 FragData0; #include "../../opengl/glsl/utils/structs.glsl" #include "../../opengl/glsl/utils/depth.glsl"

Function Documentation

◆ advectEuler()

vec3 glsl::advectEuler ( vec3  worldPos,
float  stepSize 
)

Advect point p at worldPos one step using Euler integration Caller needs to implement vec3 sampleVelocity(vec3 worldPos) @ see streamparticles.comp

◆ advectRK4()

vec3 glsl::advectRK4 ( vec3  worldPos,
float  stepSize 
)

Advect point p at worldPos one step usig 4th order Runge-Kutta integration Caller needs to implement vec3 sampleVelocity(vec3 worldPos) @ see streamparticles.comp

◆ applyTF()

vec4 glsl::applyTF ( sampler2D  transferFunction,
vec4  voxel 
)
Remarks
GLSL-Shader

◆ convertScreenToEye()

float glsl::convertScreenToEye ( CameraParameters  camera,
float  depthScreen 
)
Remarks
GLSL-Shader

◆ drawIsosurface()

vec4 glsl::drawIsosurface ( in vec4  curResult,
in float  isovalue,
in vec4  isosurfaceColor,
in vec4  voxel,
in vec4  previousVoxel,
in sampler3D  volume,
in VolumeParameters  volumeParameters,
in int  channel,
in sampler2D  transferFunction,
in CameraParameters  camera,
in LightParameters  lighting,
in vec3  rayPosition,
in vec3  rayDirection,
in vec3  toCameraDir,
in float  t,
in float  raySegmentLen,
inout float  tIncr,
inout float  tDepth 
)

Draws an isosurface if the given isovalue is found along the ray in between the current and the previous volume sample. On return, tIncr refers to the distance between the last valid isosurface and the current sampling position. That is if no isosurface was found, tIncr is not modified.

Parameters
curResultcolor accumulated so far during raycasting
isovalueisovalue of isosurface to be drawn
isosurfaceColorcolor of the isosurface used for blending
voxelscalar values of current sampling position
previousVoxelscalar values of previous sample
Returns
in case of an isosurface, curResult is blended with the color of the isosurface. Otherwise curResult is returned

◆ drawPlanes()

vec4 glsl::drawPlanes ( in vec4  oldres,
in vec3  pos,
in vec3  dir,
in float  inc,
PlaneParameters  plane,
in float  t,
inout float  tDepth 
)
Remarks
GLSL-Shader

◆ getPixelCoordsWithSpacing()

vec2 glsl::getPixelCoordsWithSpacing ( vec2  inPos)

maps (0,0) -> (bottom ,left) (1,1) -> (w - top , h - right)

Parameters
inPos2d-position between zero and one where (0,0) is the lower left corner of the image and (1,1) is the upper right corner, both including/excluding including margins
Returns
the pixel coordinate where (0,0) is the bottom left and (w,h) is top right

◆ getPosWithSpacing()

vec2 glsl::getPosWithSpacing ( vec2  inPos)

Convert a normalized position [0 1] into screen coordinates [-1 1] considering canvas dimensions and optional spacing

◆ getVoxel()

vec4 glsl::getVoxel ( sampler3D  volume,
VolumeParameters  volumeParams,
vec3  samplePos 
)
Remarks
GLSL-Shader

◆ gradientForwardDiff()

vec3 glsl::gradientForwardDiff ( vec4  intensity,
sampler3D  volume,
VolumeParameters  volumeParams,
vec3  samplePos,
int  channel 
)
Remarks
GLSL-Shader

◆ hue2rgb()

vec3 glsl::hue2rgb ( float  hue)
Remarks
GLSL-Shader

◆ main()

void glsl::main ( )
Remarks
GLSL-Shader

◆ rayPlaneIntersection()

bool glsl::rayPlaneIntersection ( in PlaneParameters  plane,
in vec3  point,
in vec3  rayDir,
inout float  t0,
in float  t1 
)
Remarks
GLSL-Shader

◆ reverseByte()

uint glsl::reverseByte ( uint  b)
Remarks
GLSL-Shader

◆ sampleVelocity()

vec3 glsl::sampleVelocity ( vec3  worldPos)
Remarks
GLSL-Shader

◆ shadeDiffuseCalculation()

vec3 glsl::shadeDiffuseCalculation ( LightParameters  light_,
vec3  materialDiffuseColor,
vec3  normal,
vec3  toLightDir 
)
Remarks
GLSL-Shader

◆ textureLookup2Dnormalized()

vec4 glsl::textureLookup2Dnormalized ( sampler2D  tex,
ImageParameters  textureParams,
vec2  samplePos 
)
Remarks
GLSL-Shader

Variable Documentation

◆ abufferSharedPoolSize

uniform int glsl::abufferSharedPoolSize
Remarks
GLSL-Shader

◆ dims

uniform ivec2 glsl::dims
Remarks
GLSL-Shader

◆ rgba_Array

u8vec4 glsl::rgba_Array[ABUFFER_SIZE *ABUFFER_DATA_PER_NODE]
Remarks
GLSL-Shader