Open Inventor Release 2024.2.1
 
Loading...
Searching...
No Matches
vvizfnc_frag.h
1/*=======================================================================
2 *** THE CONTENT OF THIS WORK IS PROPRIETARY TO FEI S.A.S, (FEI S.A.S.), ***
3 *** AND IS DISTRIBUTED UNDER A LICENSE AGREEMENT. ***
4 *** ***
5 *** REPRODUCTION, DISCLOSURE, OR USE, IN WHOLE OR IN PART, OTHER THAN AS ***
6 *** SPECIFIED IN THE LICENSE ARE NOT TO BE UNDERTAKEN EXCEPT WITH PRIOR ***
7 *** WRITTEN AUTHORIZATION OF FEI S.A.S. ***
8 *** ***
9 *** RESTRICTED RIGHTS LEGEND ***
10 *** USE, DUPLICATION, OR DISCLOSURE BY THE GOVERNMENT OF THE CONTENT OF THIS ***
11 *** WORK OR RELATED DOCUMENTATION IS SUBJECT TO RESTRICTIONS AS SET FORTH IN ***
12 *** SUBPARAGRAPH (C)(1) OF THE COMMERCIAL COMPUTER SOFTWARE RESTRICTED RIGHT ***
13 *** CLAUSE AT FAR 52.227-19 OR SUBPARAGRAPH (C)(1)(II) OF THE RIGHTS IN ***
14 *** TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 52.227-7013. ***
15 *** ***
16 *** COPYRIGHT (C) 1996-2022 BY FEI S.A.S, ***
17 *** BORDEAUX, FRANCE ***
18 *** ALL RIGHTS RESERVED ***
19**=======================================================================*/
20/*=======================================================================
21** Author : VSG (MMM YYYY)
22**=======================================================================*/
23
24#ifndef VVIZFNC_FRAG_H
25#define VVIZFNC_FRAG_H
26
34vec4 VVizOverOperator(vec4 underCol, vec4 overCol);
35
42float VVizGetLuminance(VVIZ_DATATYPE data);
43
44 #if VVIZ_SHAPE_TYPE == VVIZ_VRENDER
52
59vec3 VVizGetNearestCoord(in VVizDataSetId dataset, in VVizVoxelInfo voxelInfo);
60
66vec3 VVizComputePreintegratedGradient(vec3 tcoord0, vec3 tcoord1);
67vec3 VVizComputePreintegratedGradient(VVizDataSetId tex, vec3 tcoord0, vec3 tcoord1);
68vec3 VVizComputePreintegratedGradient(VVizDataSetId tex, inout VVizVoxelInfo voxelInfoFront, in VVizVoxelInfo voxelInfoBack);
69#endif
70
76#if VVIZ_SHAPE_TYPE == VVIZ_VRENDER
77vec3 VVizComputeNormal(vec3 view, vec3 grad);
78vec3 VVizComputeNormal(vec3 view, vec3 grad, float gradNorm);
79#endif
80
91vec3 VVizComputeNormal(vec3 tcoordVirt);
92
100vec3 VVizComputeNormal(in VVizDataSetId dataset, vec3 tcoordVirt);
101
112#if VVIZ_SHAPE_TYPE == VVIZ_VRENDER
113vec4 VVizComputeIsoMaterial(VVizDataSetId tex, in VVizVoxelInfo voxelInfoFront, in VVizVoxelInfo voxelInfoBack, int maskId);
114#endif
115
123vec4 VVizComputePreIntegrated(VVIZ_DATATYPE sf, VVIZ_DATATYPE sb);
124vec4 VVizComputePreIntegrated(VVIZ_DATATYPE sf, VVIZ_DATATYPE sb, int mask);
125vec4 VVizComputePreIntegrated(inout VVizVoxelInfo voxelInfoFront, in VVizVoxelInfo voxelInfoBack, int mask);
126
131vec4 VVizComputeVolumeRendering(VVIZ_DATATYPE sf);
132vec4 VVizComputeVolumeRendering(inout VVizVoxelInfo voxelInfoFront, int mask);
133vec4 VVizComputeVolumeRendering(VVIZ_DATATYPE sf, int tfId);
134
135vec2 VVizComputeDiffuseAndSpecularCoeffs(vec3 normal, float gradLength, float threshold, vec3 lightVec, vec3 halfVec, float shininess);
136vec3 VVizApplySurfaceScalarInternal(vec3 baseColor, vec3 lightedColor, float gradLength);
137vec3 VVizApplySurfaceScalar(vec3 baseColor, vec3 lightedColor, float gradLength);
138
144vec4 VVizComputeVolumeRenderingLighting(in vec4 col, in vec3 normal, in float gradLength);
145
151vec4 VVizComputeVolumeRenderingLighting(in VVizDataSetId dataset, in vec4 col, in vec3 normal, in float gradLength);
152
162vec4 VVizComputePreintegratedLighting(in vec4 col, in vec3 normal, in float gradLength);
163
173vec4 VVizComputePreintegratedLighting(in VVizDataSetId dataset, in vec4 col, in vec3 normal, in float gradLength);
174
181
187vec3 VVizComputeViewVec(in VVizDataSetId dataset);
188
189// TODO should take datasetInfo or datasetId as input.
190bool VVizIsOutsideTexture(in vec3 tcoord);
191// TODO should take datasetInfo or datasetId as input.
192bool VVizIsOutsideVolume(in vec3 tcoord);
193
200// TODO should take datasetInfo or datasetId as input.
201bool VVizIsOutsideOrOnVolumeBorder(in vec3 tcoord);
202
204bool VVizIsOutsideOrOnVolumeBorder(in VVizDataSetId dataset, in vec3 tcoord);
205
207VVIZ_DATATYPE VVizGetDataPhysicalLod(sampler3D tex, vec3 tcoord, float lod);
208
210VVIZ_DATATYPE VVizGetDataPhysicalLod(sampler2D tex, vec2 tcoord, float lod);
211
213VVIZ_DATATYPE VVizGetDataPhysicalLod(VVizDataSetId dataSet, vec3 tcoord, float lod);
214
222float VVizGetProjectedDepth(in vec3 tcoord);
223
228float VVizGetProjectedDepth(in VVizDataSetId dataset, in vec3 tcoord);
229
236vec2 VVizGetScreenCoord();
237
238#if defined(VVIZ_NUM_CLIPPING_PLANES)
245bool VVizIsClippedByPlane(in vec3 tcoord);
246
248bool VVizIsClippedByPlane(in VVizDataSetId dataset, in vec3 tcoord);
249#endif
250
252bool VVizIsTransparent(in float alphaValue);
253
255bool VVizIsOpaque(in float alphaValue);
256
258vec4 VVizTextureLod(sampler3D tex, vec3 tcoord, float mipLevel);
259
261vec4 VVizTextureLod(sampler2D tex, vec2 tcoord, float mipLevel);
262
264vec4 VVizTextureLod(sampler2D tex, vec3 tcoord, float mipLevel);
265
266vec4 VVizGetColor(VVizDataSetId dataset, in vec3 viewVec, in vec3 rayDir, inout VVizVoxelInfo voxel, in VVizVoxelInfo previousVoxel);
267
277void VVizComputeGradientCommon(in vec3 tcoordFront, in vec3 tcoordBack, out vec3 gradient, out vec3 normal);
278
285void VVizComputeGradientCommon(VVizDataSetId dataset, in vec3 tcoordFront, in vec3 tcoordBack, out vec3 gradient, out vec3 normal);
286
287#endif
void VVizComputeGradientCommon(in vec3 tcoordFront, in vec3 tcoordBack, out vec3 gradient, out vec3 normal)
Computes gradient and normal values at the given texture coordinates.
float VVizGetLuminance(VVIZ_DATATYPE data)
Compute the luminance of a voxel value.
vec4 VVizOverOperator(vec4 underCol, vec4 overCol)
Blend 2 colors using the over operator, result color is not alpha premultiplied.
vec4 VVizComputeVolumeRendering(VVIZ_DATATYPE sf)
Returns the conversion of the volume data value sf to color by lookup in the colormap.
vec3 VVizGetNearestCoord(in VVizVoxelInfo voxelInfo)
Returns virtual coordinates of nearest voxel center, taking in account current voxel resolution.
vec4 VVizComputeVolumeRenderingLighting(in vec4 col, in vec3 normal, in float gradLength)
Add lighting to the color col.
vec3 VVizComputePreintegratedGradient(vec3 tcoord0, vec3 tcoord1)
Returns the gradient at the center of the two slices.
vec3 VVizComputeNormal(vec3 view, vec3 grad)
Returns the current normal.
vec4 VVizComputePreintegratedLighting(in vec4 col, in vec3 normal, in float gradLength)
Add lighting to the color col in the case of pre-integrated rendering.
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.
vec3 VVizComputeViewVec()
Returns the current viewing vector in the model space of the default dataset.
vec4 VVizComputeIsoMaterial(VVizDataSetId tex, in VVizVoxelInfo voxelInfoFront, in VVizVoxelInfo voxelInfoBack, int maskId)
Returns the color of the lighted pixel belonging to the isosurface.
Defines voxel state info used with the VolumeViz Shader Library API.