HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RU_GPUFunctions.h
Go to the documentation of this file.
1 /*
2  * PROPRIETARY INFORMATION. This software is proprietary to
3  * Side Effects Software Inc., and is not to be reproduced,
4  * transmitted, or disclosed in any way without written permission.
5  *
6  * NAME: RU_GPUFunctions.h ( UT Library, C++)
7  *
8  * COMMENTS:
9  * This class contains a list of functions that return GPU code in
10  * in a UT_String for doing various things.
11  *
12  * The parameters and local variables for each are listed. Parameters
13  * must have valid values assigned, locals just need to be passed to the
14  * function (GLSL doesn't allow locals declared in functions - you have to
15  * pass them in).
16  *
17  * If you wish to modify the code string, harden it first.
18  *
19  */
20 #ifndef RU_GPUFunctions_h
21 #define RU_GPUFunctions_h
22 
23 #include "RU_API.h"
24 #include <PXL/PXL_LumFuncs.h>
25 
26 class UT_String;
27 class TIL_TileList;
28 class UT_ComputeGPU;
29 
30 // This adds the various tiles as single outputs to the shader, as
31 // OUT_red(colorname.r); OUT_green(colorname.g); etc. It also registers them
32 // as outputs with the UT_ComputeGPU engine.
33 extern RU_API void RUsetOutput(UT_ComputeGPU &engine,
34  TIL_TileList *tiles,
35  const char *outname,
36  UT_String &shader);
37 
38 // vec4 texture_sample(...)
39 // Samples a texture in the area (x1,y1) - (x2,y2) from 'texture' and
40 // returns the filtered color.
41 // Parameters:
42 // float x0 - sampling area
43 // float y0
44 // float x1
45 // float y1
46 extern RU_API void RUgetTextureSampleGPU(const char *texture,
47  int vsize,
48  UT_String &code);
49 extern RU_API void RUgetTextureClamp(UT_String &code);
50 extern RU_API void RUgetTextureBilinear(const char *texture,
51  int vsize,
52  UT_String &code);
53 
54 // vec3 toHSV(...)
55 // converts an RGB color to HSV
56 // Parameters
57 // vec3 rgbcol - RGB color to be converted
58 extern RU_API void RUgetToHSVConvertGPU(UT_String &code);
59 
60 // vec3 toHSV(...)
61 // converts an HSV color to RGB
62 // Parameters
63 // vec3 hsvcol - HSV color to be converted
64 extern RU_API void RUgetFromHSVConvertGPU(UT_String &code);
65 
66 
67 // vec3 lambert_diffuse(vec3 N, vec3 L)
68 // Parameters
69 // N - surface normal
70 // L - Light dir
71 extern RU_API void RUgetDiffuseLambert(UT_String &code);
72 
73 // float oren_diffuse(vec3 N, vec3 L, vec3 I, float rough, ...)
74 // Parameters
75 // N - surface normal
76 // L - Light dir
77 // I - Incident ray
78 // rough - roughness factor, from 0 (none) to 1
79 extern RU_API void RUgetDiffuseOrenNayar(UT_String &code);
80 
81 // float phong_specular(vec3 N, vec3 L, vec3 I, float power)
82 // Parameters:
83 // N - surface normal
84 // L - Light dir
85 // I - Incident ray
86 // power - phong exponent (higher = sharper highlight)
87 extern RU_API void RUgetSpecularPhong(UT_String &code);
88 
89 // float blinn_specular(vec3 N, vec3 L, vec3 I, float rough, ...)
90 // Parameters:
91 // N - surface normal
92 // L - Light dir
93 // I - Incident ray
94 // rough - roughness factor, from 0 (none) to 1
95 extern RU_API void RUgetSpecularBlinn(UT_String &code);
96 
97 // Parm : int dropoff type. 0 = linear, 1 = ease in, 2 = ease out,
98 // 3 = ease in/out, 4 = gaussian
99 extern RU_API void RUgetDropoffFunc(UT_String &code);
100 // returns a branchless version for the specific function.
101 extern RU_API void RUgetSoftDropoff(int function, UT_String &code);
102 
103 // Parm: int lumfunc : 0 = standard lum, 1 = NTSC lum, 2 = max, 3 = min,
104 // 4 = average, 5 = red, 6 = green, 7 = blue.
105 // Returns a float.
106 extern RU_API void RUgetLuminanceFunc(UT_String &code);
108 
109 extern RU_API void RUgetFlatLightFrontend(UT_String &code);
110 extern RU_API void RUgetBumpLightFrontend(UT_String &code,
111  const char *bump_name);
112 extern RU_API void RUget3DLightFrontend(UT_String &code,
113  const char *point_name,
114  const char *normal_name);
115 
116 extern RU_API void RUgetLightingBackend(UT_String &code,
117  const char *color_name);
118 extern RU_API void RUgetVolumetricLight(UT_String &code);
119 
120 extern RU_API void RUgetLightingMain(UT_String &code);
121 
122 extern RU_API void RUgetTransform(int vsize, const char *texture,
123  UT_String &code);
124 
125 extern RU_API void RUgetTransformBlur(int vsize, const char *image,
126  UT_String &code);
127 extern RU_API void RUgetTransformDeformBlur(int vsize,
128  const char *image,
129  const char *prev,
130  const char *next,
131  UT_String &code);
132 
133 extern RU_API void RUgetFogMain(UT_String &code);
134 extern RU_API void RUgetFogDistanceZ(const char *depth_name, UT_String &code);
135 extern RU_API void RUgetFogDistanceP(const char *point_name, UT_String &code);
136 extern RU_API void RUgetFogDistanceNone(UT_String &code);
137 extern RU_API void RUgetFogColorConst(UT_String &code);
138 extern RU_API void RUgetFogColorImage(const char *color_name,UT_String &code);
139 extern RU_API void RUgetFogDensityConst(UT_String &code);
140 extern RU_API void RUgetFogDensityImage(const char *alpha_name,UT_String &code);
141 extern RU_API void RUgetFogConst(UT_String &code);
142 extern RU_API void RUgetFogNoise(UT_String &code);
143 
144 extern RU_API void RUgetFogTypeFog(const char *color_name, UT_String &code);
145 extern RU_API void RUgetFogTypeAdd(const char *color_name, UT_String &code);
146 extern RU_API void RUgetFogTypeHeat(const char *color_name, UT_String &code);
147 extern RU_API void RUgetFogTypeHaze(const char *color_name, UT_String &code);
148 
149 extern RU_API void RUgetZCompositeSimple(int vsize, UT_String &code);
150 extern RU_API void RUgetZCompositeSuperSample(int vsize, UT_String &code);
151 extern RU_API void RUgetZCompositeGeo(int vsize, UT_String &code);
152 extern RU_API void RUgetZCompositeSuperSampleGeo(int vsize, UT_String &code);
153 
154 extern RU_API void RUgetEnvironmentMain(int vsize, UT_String &code);
155 extern RU_API void RUgetEnvironmentBump(UT_String &code);
156 extern RU_API void RUgetEnvironmentNormal(UT_String &code);
157 extern RU_API void RUgetEnvironmentCubeDeep(UT_String &code);
158 extern RU_API void RUgetEnvironmentCubeStrip(UT_String &code);
161 extern RU_API void RUgetEnvironmentLatLong(UT_String &code);
162 
163 extern RU_API void RUgetKeyMain(int vsize, const char *key, UT_String &code);
164 extern RU_API void RUgetKeyMainSuperSample(int vsize, UT_String &code);
165 extern RU_API void RUgetKeyMainSuperSampleSelf(int vsize, UT_String &code);
166 extern RU_API void RUgetKeyLuma(int vsize, UT_String &code);
167 extern RU_API void RUgetKeyChroma(int vsize, UT_String &code);
168 
169 extern RU_API void RUgetNoiseCop2(UT_String &code);
170 extern RU_API void RUgetPerlinNoise(UT_String &code);
171 extern RU_API void RUgetSparseNoise(UT_String &code);
172 extern RU_API void RUgetAlligatorNoise(UT_String &code);
173 
174 extern RU_API void RUgetDeform(const char *pname, int vsize, UT_String &code);
175 extern RU_API void RUgetDeformMask(const char *pname, int vsize,
176  UT_String &code);
177 
178 extern RU_API void RUgetConvolve(int vsize, UT_String &code);
179 
180 extern RU_API void RUgetExpand(int vsize, UT_String &code);
181 extern RU_API void RUgetExpandLuma(int vsize, UT_String &code);
182 extern RU_API void RUgetExpandPerPixel(int vsize, UT_String &code);
183 extern RU_API void RUgetExpandLumaPerPixel(int vsize, UT_String &code);
184 
185 extern RU_API void RUgetBlurPerPixel(int vsize, UT_String &code);
186 #endif
RU_API void RUgetBlurPerPixel(int vsize, UT_String &code)
RU_API void RUgetKeyChroma(int vsize, UT_String &code)
RU_API void RUgetFogDensityImage(const char *alpha_name, UT_String &code)
RU_API void RUgetFogColorConst(UT_String &code)
RU_API void RUgetZCompositeSuperSampleGeo(int vsize, UT_String &code)
RU_API void RUgetDeform(const char *pname, int vsize, UT_String &code)
RU_API void RUgetVolumetricLight(UT_String &code)
RU_API void RUgetNoiseCop2(UT_String &code)
RU_API void RUgetTransformBlur(int vsize, const char *image, UT_String &code)
RU_API void RUgetDeformMask(const char *pname, int vsize, UT_String &code)
RU_API void RUgetTransformDeformBlur(int vsize, const char *image, const char *prev, const char *next, UT_String &code)
RU_API void RUgetEnvironmentNormal(UT_String &code)
RU_API void RUgetSpecularBlinn(UT_String &code)
RU_API void RUgetBumpLightFrontend(UT_String &code, const char *bump_name)
RU_API void RUgetKeyMainSuperSample(int vsize, UT_String &code)
#define RU_API
Definition: RU_API.h:10
RU_API void RUgetLightingMain(UT_String &code)
RU_API void RUgetFogDistanceZ(const char *depth_name, UT_String &code)
RU_API void RUgetTextureSampleGPU(const char *texture, int vsize, UT_String &code)
RU_API void RUgetZCompositeGeo(int vsize, UT_String &code)
GLenum GLenum GLsizei void * image
Definition: glad.h:5132
RU_API void RUgetExpandLumaPerPixel(int vsize, UT_String &code)
RU_API void RUgetFogDistanceNone(UT_String &code)
RU_API void RUgetFogTypeAdd(const char *color_name, UT_String &code)
RU_API void RUgetExpand(int vsize, UT_String &code)
RU_API void RUgetEnvironmentCubeStrip(UT_String &code)
RU_API void RUgetSparseNoise(UT_String &code)
RU_API void RUgetKeyMain(int vsize, const char *key, UT_String &code)
RU_API void RUgetFogDistanceP(const char *point_name, UT_String &code)
RU_API void RUgetEnvironmentCubeDeep(UT_String &code)
RU_API void RUgetEnvironmentBump(UT_String &code)
RU_API void RUgetSoftDropoff(int function, UT_String &code)
PXL_LumFunction
Definition: PXL_LumFuncs.h:18
RU_API void RUgetAlligatorNoise(UT_String &code)
GLfloat f
Definition: glcorearb.h:1926
RU_API void RUgetEnvironmentCubeCrossHorz(UT_String &code)
RU_API void RUgetDiffuseOrenNayar(UT_String &code)
RU_API void RUgetExpandPerPixel(int vsize, UT_String &code)
RU_API void RUgetPerlinNoise(UT_String &code)
RU_API void RUgetFogColorImage(const char *color_name, UT_String &code)
RU_API void RUgetDiffuseLambert(UT_String &code)
RU_API void RUgetFogTypeHaze(const char *color_name, UT_String &code)
RU_API void RUget3DLightFrontend(UT_String &code, const char *point_name, const char *normal_name)
RU_API void RUgetKeyLuma(int vsize, UT_String &code)
RU_API void RUgetFogTypeHeat(const char *color_name, UT_String &code)
GLenum pname
Definition: glcorearb.h:104
RU_API void RUgetFogTypeFog(const char *color_name, UT_String &code)
RU_API void RUgetEnvironmentCubeCrossVert(UT_String &code)
RU_API void RUgetToHSVConvertGPU(UT_String &code)
RU_API void RUgetFogDensityConst(UT_String &code)
GLuint shader
Definition: glcorearb.h:785
RU_API void RUgetTextureBilinear(const char *texture, int vsize, UT_String &code)
RU_API void RUgetFlatLightFrontend(UT_String &code)
RU_API void RUgetZCompositeSuperSample(int vsize, UT_String &code)
RU_API void RUgetFogConst(UT_String &code)
RU_API void RUgetFogNoise(UT_String &code)
GLuint texture
Definition: glcorearb.h:415
RU_API void RUgetSpecularPhong(UT_String &code)
RU_API void RUgetFogMain(UT_String &code)
RU_API void RUgetKeyMainSuperSampleSelf(int vsize, UT_String &code)
RU_API void RUgetFromHSVConvertGPU(UT_String &code)
RU_API void RUgetTextureClamp(UT_String &code)
RU_API void RUgetConvolve(int vsize, UT_String &code)
RU_API void RUgetTransform(int vsize, const char *texture, UT_String &code)
RU_API void RUgetEnvironmentMain(int vsize, UT_String &code)
RU_API void RUgetLightingBackend(UT_String &code, const char *color_name)
RU_API void RUgetDropoffFunc(UT_String &code)
RU_API void RUsetOutput(UT_ComputeGPU &engine, TIL_TileList *tiles, const char *outname, UT_String &shader)
RU_API void RUgetLuminanceFunc(UT_String &code)
RU_API void RUgetEnvironmentLatLong(UT_String &code)
RU_API void RUgetExpandLuma(int vsize, UT_String &code)
RU_API void RUgetZCompositeSimple(int vsize, UT_String &code)