Graphics.PerformImageDistortion - lordmundi/wikidoctest GitHub Wiki
« Allowing For Offscreen Light Flares And Blooms | EDGE User’s Guide | Print Out Any Node Changes In The Scene »
In EDGE v2.4 a new capability was added to perform both real-time image distortion and image distortion of rendered poster images.
Example distortion using the dsp_distort2 plugin.
There are number of ways this can be very useful. For example, displaying EDGE on a non-flat surface requires image distortion of the real-time generated renderings. Or, for example, perhaps you are modeling a specific camera which has certain optical distortion characteristics you want to use when you save rendered images.
Distortion can be done using parameters for a Brown-Conrady distortion model, or using a generic map that maps input pixels to output pixels.The GPU programs used to perform the distortion are completely open to let the user define whatever distortion logic they would like. Examples of both parameterized Brown-Conrady distortion and generic map based distortion are included in this document.
On this page… (hide)
- 1. dsp_distort2 plugin
- 1.1 warp_direct.vs
- 1.2 warp_direct.fs
- 1.3 warp_map.vs
- 1.4 warp_map.fs
- 1.5 Plugin API
- 2. warpgen Offline Tool
- 2.1 warpgen.c
- 3. dsp_poster2 Modifications
- 4. dsp_speedtest3 Modifications
The main development that allows this is the dsp_distort2 plugin. This plugin provides an API to other plugins to give them access to GPU accelerated processing of rendered image using "programs" written in the OpenGL Shading Language (OGLSL).
The plugin extends the OpenGL Shading Language to include the "parameter" keyword allowing Tcl access to variables defined in a GPU program at runtime. The plugin accepts the following command line arguments.
-gridsize <hor_size> <ver_size>
-program <prog_name> <default/vert_shader_fname> <default/frag_shader_fname>
Multiple "-program" names can be specified with different vertex and fragment shader source files. These command lines can be placed inside of a "command_line" sub-block of a "DSP_DISTORT2" block of an EDGE config file. See the following for an example.
DSP_DISTORT2
{
command_line
{
-gridsize 1024 1024
-program OpNavFwdDirect warp_direct.vs default
-program OpNavInvDirect default warp_direct.fs
-program OpNavFwdMap warp_map.vs default
-program OpNavInvMap default warp_map.fs
}
}
The "-gridsize" is used to specify the resolution of the uniform grid passed down to the vertex shader stage of the GPU and is where "forward" distortion computation should be computed. The fragment shader stage is where the "backward" distortion computation should be computed (i.e., the result of applying the same distortion computation in both the vertex and fragment shaders is an undistorted image). The example shaders given above are included in this document and implement the "direct" case the Brown-Conrady distortion model providing Tcl access to the first two terms of both the radial (K1,K2) and tangential (P1,P2) portions of the distortion model as defined below:
Xd = Xu * (1 + K1*r*r + K2*r*r*r*r) + (P2*(r*r + 2*Xu*Xu) + 2*P1*Xu*Yu)
Yd= Yu * (1 + K1*r*r + K2*r*r*r*r) + (P1*(r*r + 2*Yu*Yu) + 2*P2*Yu*Yu)
Given the following:
- Xd,Yd = the distorted image pixel coordinates
- Xu,Yu = the undistorted "pin-hole" camera pixel image coordinates
- r = is the radial distance of the image pixel from the image center based on a unit length equal to half the image height.
- K1,K2 = the first and second terms of the radial portion of the distortion equation
- P1,P2 = the first and second terms of the tangential portion of the distortion equation
NOTE: the K1,K2,P1,P2 parameters in the "OpNavFwdDirect" program can be modified via the following Tcl commands if using them through the dsp_poster2 plugin:
doug.plugin dsp_poster2.distort_program set "OpNavFwdDirect"0adoug.plugin dsp_poster2.distort_parameter OpNavFwdDirect.K1 set <val1>
doug.plugin dsp_poster2.distort_parameter OpNavFwdDirect.K2 set <val2>
doug.plugin dsp_poster2.distort_parameter OpNavFwdDirect.P1 set <val3>
doug.plugin dsp_poster2.distort_parameter OpNavFwdDirect.iP2 set <val4>
or, you can modify the paramters inside dsp_distort2 for the OpNavFwdDirect program directly:
doug.plugin dsp_distort2.parameter OpNavFwdDirect.K1 set <val1>
doug.plugin dsp_distort2.parameter OpNavFwdDirect.K2 set <val2>
doug.plugin dsp_distort2.parameter OpNavFwdDirect.P1 set <val3>
doug.plugin dsp_distort2.parameter OpNavFwdDirect.P2 set <val4>
NOTE: Telling dsp_poster2 to set the distort_program to "OpNavFwdDirect" is what enables the distortion for dsp_poster2 rendering. To disabled it, you would call the same tcl command and set the distort_program to a blank string ("").
The following is the vertex shader source for the "OpNavFwdDirect" program that loads and runs in the vertex shading stage of the GPU which occurs before the fragment shading stage.
parameter float K1 = 0.0; // FIRST 2 RADIAL DISTORTION TERMS
parameter float K2 = 0.0;
parameter float P1 = 0.0; // FIRST 2 TANGENTIAL DISTORTION TERMS
parameter float P2 = 0.0;
varying vec2 DSV_uv;
void main()
{
vec4 pos;
vec2 Vu;
float r;
// CONVERT FROM WINDOW COORDINATES TO NORMALIZED IMAGE COORDINATES WHERE CENTER TO IMAGE TOP = 1.0
// FROM x=<0,1>, y=<0,1> ----> x=<-DSV_ImageAspect,DSV_ImageAspect>, y=<-1,1>
Vu = (gl_Vertex.xy * 2.0)-1.0;
Vu.x *= DSV_ImageAspect;
// USING THE "Brown-Conrady" DISTORTION FORMULA DIRECTLY
r = length(Vu);
pos.x = Vu.x * (1.0 + K1*r*r + K2*r*r*r*r) + (P2*(r*r + 2*Vu.x*Vu.x) + 2.0*P1*Vu.x*Vu.y);
pos.y = Vu.y * (1.0 + K1*r*r + K2*r*r*r*r) + (P1*(r*r + 2*Vu.y*Vu.y) + 2.0*P2*Vu.x*Vu.y);
pos.z = gl_Vertex.z;
pos.w = 1.0;
// CONVERT BACK TO WINDOW COORDINATES
pos.x /= DSV_ImageAspect;
pos.xy = (pos.xy + 1.0) * 0.5;
gl_Position = gl_ProjectionMatrix * pos;
gl_ClipVertex = vec4(0.0,0.0,0.0,0.0);
DSV_uv = gl_Vertex.xy;
}
The following is the fragment shader source for the "OpNavInvDirect" program, notice how the distortion function and math is virtually identical to the previous vertex shader source but since it is being performed in the fragment shading stage of the GPU it is effectively computing the inverse.
parameter float K1 = 0.0; // FIRST 2 RADIAL DISTORTION TERMS
parameter float K2 = 0.0;
parameter float P1 = 0.0; // FIRST 2 TANGENTIAL DISTORTION TERMS
parameter float P2 = 0.0;
varying vec2 DSV_uv;
void main()
{
vec2 pos;
vec2 Vu;
float r;
// CONVERT FROM WINDOW COORDINATES TO NORMALIZED IMAGE COORDINATES WHERE CENTER TO IMAGE TOP = 1.0
// FROM x=<0,1>, y=<0,1> ----> x=<-DSV_ImageAspect,DSV_ImageAspect>, y=<-1,1>
Vu = (DSV_uv.xy * 2.0)-1.0;
Vu.x *= DSV_ImageAspect;
// USING THE "Brown-Conrady" DISTORTION FORMULA DIRECTLY
r = length(Vu);
pos.x = Vu.x * (1.0 + K1*r*r + K2*r*r*r*r) + (P2*(r*r + 2*Vu.x*Vu.x) + 2.0*P1*Vu.x*Vu.y);
pos.y = Vu.y * (1.0 + K1*r*r + K2*r*r*r*r) + (P1*(r*r + 2*Vu.y*Vu.y) + 2.0*P2*Vu.x*Vu.y);
// CONVERT BACK TO WINDOW COORDINATES
pos.x /= DSV_ImageAspect;
pos.xy = (pos.xy + 1.0) * 0.5;
// SAMPLE PIN-HOLE IMAGE AND MAKE OUT-OF-BOUNDS BLACK
r = step(0.0,pos.x)*step(pos.x,1.0)*step(0.0,pos.y)*step(pos.y,1.0);
gl_FragColor.rgb = texture2D( DSV_Image, pos ).rgb * vec3(r,r,r);
gl_FragColor.a = 1.0;
}
The "map" based programs show how an offline computed distortion map can be used to implement arbitrary distortions and modifications of the input image. The "map" version of the programs provide Tcl access to the "map" or image file used in performing the distortion and supports floating point "tiff" formatted images. The Tcl commands to modify the "map" used to perform the distortion are:
doug.plugin dsp_poster2.settings set -distort_program OpNavFwdMap
doug.plugin dsp_poster2.distort_parameter map set <mapfile>
or
doug.plugin dsp_distort2.parameter OpNavFwdMap.map set <mapfile>
The following is the vertex shader source for the "OpNavFwdMap" program that loads and runs in the vertex shading stage of the GPU which occurs before the fragment shading stage.
parameter sampler2D map = {"warp_map.tiff",SWRAP=GL_CLAMP_TO_EDGE,TWRAP=GL_CLAMP_TO_EDGE};
varying vec2 DSV_uv;
void main()
{
vec4 pos;
// CONVERT FROM WINDOW COORDINATES TO NORMALIZED IMAGE COORDINATES WHERE CENTER TO IMAGE TOP = 1.0
// FROM x=<0,1>, y=<0,1> ----> x=<-DSV_ImageAspect,DSV_ImageAspect>, y=<-1,1>
pos.xy = (gl_Vertex.xy * 2.0)-1.0;
pos.x *= DSV_ImageAspect;
// USING DISTORTION UV MAP
DSV_uv = gl_Vertex.xy;
pos.xy *= texture2D( map, DSV_uv.xy ).xy;
pos.z = gl_Vertex.z;
pos.w = 1.0;
// CONVERT BACK TO WINDOW COORDINATES
pos.x /= DSV_ImageAspect;
pos.xy = (pos.xy + 1.0) * 0.5;
gl_Position = gl_ProjectionMatrix * pos;
gl_ClipVertex = vec4(0.0,0.0,0.0,0.0);
}
The following is the fragment shader source for the "OpNavInvMap" program, notice how the distortion function and math is virtually identical to the previous vertex shader source but since it is being performed in the fragment shading stage of the GPU it is effectively computing the inverse.
parameter sampler2D map = {"warp_map.tiff",SWRAP=GL_CLAMP_TO_EDGE,TWRAP=GL_CLAMP_TO_EDGE};
varying vec2 DSV_uv;
void main()
{
vec2 pos;
float c;
// CONVERT FROM WINDOW COORDINATES TO NORMALIZED IMAGE COORDINATES WHERE CENTER TO IMAGE TOP = 1.0
// FROM x=<0,1>, y=<0,1> ----> x=<-DSV_ImageAspect,DSV_ImageAspect>, y=<-1,1>
pos.xy = (DSV_uv.xy * 2.0)-1.0;
pos.x *= DSV_ImageAspect;
// USING DISTORTION UV MAP
pos.xy *= texture2D( map, DSV_uv.xy ).xy;
// CONVERT BACK TO WINDOW COORDINATES
pos.x /= DSV_ImageAspect;
pos.xy = (pos.xy + 1.0) * 0.5;
// SAMPLE PIN-HOLE IMAGE AND MAKE OUT-OF-BOUNDS BLACK
c = step(0.0,pos.x)*step(pos.x,1.0)*step(0.0,pos.y)*step(pos.y,1.0);
gl_FragColor.rgb = texture2D( DSV_Image, pos ).rgb * vec3(c,c,c);
gl_FragColor.a = 1.0;
}
As mentioned above, the dsp_distort2 plugin provides an API that other plugins can use to perform GPU accelerated image processing. The API interface structure is defined in the dsp_distort2.h header file and is listed below:
#if !defined(DSP_DISTORT2_H)
# define DSP_DISTORT2_H
# include "doug.h"
typedef struct
{
unsigned int (*GetProgramID)( char *prog_name );
unsigned int (*DefineProgram)( char *prog_name, char *vs_file, char *fs_file );
void (*Distort)( int program_id, int srcx1, int srcy1, int srcx2, int srcy2, int dstx1, int dsty1, int dstx2, int dsty2 );
int (*DistortParameterCmd)( void *data, Tcl_Interp *interp, int objc, Tcl_Obj *objv[] );
int (*DistortOptionCmd)( void *data, Tcl_Interp *interp, int objc, Tcl_Obj *objv[] );
} DSP_DISTORT2;
#endif
To acquire access to the structure from inside a plugin the following code can be used:
DSP_DISTORT2 *dsp_distort2 = NULL;
if( !dsp_distort2 && !(dsp_distort2 = (DSP_DISTORT2*)DSF_GetDataFromProcess( "DSP_DISTORT2" )) )
{
DSS_PLUGIN *ploader;
if( ploader = DSF_LoadPlugin( "dsp_distort2" ) )
{
if( DSF_InitializePlugin( ploader ) )
dsp_distort2 = (DSP_DISTORT2*)DSF_GetDataFromProcess( "DSP_DISTORT2" );
else
Tcl_AppendResult( interp, "ERROR: unable to initalize dsp_distort2 plugin to support distortion program\n" );
}
else
Tcl_AppendResult( interp, "ERROR: unable to load dsp_distort2 plugin to support distortion program\n" );
}
Once successfully acquired, calls can be made into the dsp_distort2 plugin using the function pointers declared in the structure. The declared functions are explained below:
unsigned int GetProgramID( char *program_name );
This function is used to get the "ID" of a program who's name is passed as an argument. The program by the given name must have been previously defined in a command line argument to the dsp_distort2 plugin or by a previous call to the DefineProgram API function. Upon success a non-zero value is returned which can be used in subsequent calls to the Distort API function to perform image processing.
unsigned int DefineProgram( char *program_name, char *vs_file, char *fs_file );
This function can be used to define or redefine the source code to compile for the program with the given name. The "vs_file" argument must either be the "default" keyword or point to a valid OpenGL Shading Language (glsl version 1.2) source file targeting the vertex shader stage of the rendering pipeline. The "fs_file" argument must either be the "default" keyword or point to a valid OpenGL Shading Language source file targeting the fragment shader stage of the rendering pipeline.
void Distort( int program_id, int src_x1, int src_y1, int src_x2, int src_y2, int dst_x1, int dst_y1, int dst_x2, int dst_y2 );
This function effectively performs a blit operation applying the distortion program referenced in program_id to the image source (as defined by OpenGL's GL_READ_BUFFER state) rectangle bounded by src_x1, src_y1, src_x2, src_y2 and transferred to the destination (as defined by OpenGL's GL_DRAW_BUFFER state) bounded by the dst_x1, dst_y1, dst_x2, dst_y2. Since the plugin automatically performs a blit operation to an offscreen texture buffer before doing the "distortion" it is permissible for both the GL_READ_BUFFER and GL_DRAW_BUFFER to reference the same buffer and that the source and destination rectangles overlap. This is done in the dsp_speedtest3 plugin in the DSP_PLUGIN_DISPLAY_SWAPBUFFER callback to perform real-time distortion to the image residing in the back buffer before it is swapped to the front for display.
int DistortParameterCmd( void *data, Tcl_Interp *interp, int objc, Tcl_Obj *objv[] );
This function allows the execution of dsp_distort2.parameter commands from another plugin's Tcl interface.
int DistortOptionCmd( void *data, Tcl_Interp *interp, int objc, Tcl_Obj *objv[] );
This function allows the execution of dsp_distort2.option commands from another plugin's Tcl Interface.
To allow the modification at run time of shader variables the "parameter" keyword was added to the OGLSL specification to indicate to the dsp_distort2 plugin which variables are allowed to be modified via Tcl/tk commands during run time as well as allow the default initialization of those variables in the shader source. The "parameter" modifier can be used on the following OGLSL data types (int,float,vec2,vec3,vec4,mat2,mat3,mat4,sampler1d,sampler2d,sampler3d,sampler2dRect) for individual variable declarations and does not currently support arrays or multiple variables being declared at the same time using a single parameter instance. See the following for invalid and valid parameter declarations:
parameter float x1, y1; /* INVALID : not allowed to define multiple variables per */
parameter float z[30]; /* INVALID : not allowed to use arrays */
parameter float x1 = 30.0; /* VALID : permitted to provide initial/default value */
parameter float y1; /* VALID */
parameter vec3 mycol = { 1.0, 0.5, 0.4 }; /* VALID */
parameter sampler2D mytex = { "funpic.rgb" }; /* VALID */
The sampler types allow you to specify the minification "MIN" and magnification "MAG" sample modes which can be "GL_NEAREST" "GL_LINEAR" or "GL_LINEAR_MIPMAP_LINEAR" If not specified the default is "GL_LINEAR" In addition to the sampling modes you can also specify how to treat samples that are taken outside of the image bounds by setting the wrap modes of each coordinate to "GL_REPEAT" "GL_CLAMP" or "GL_CLAMP_TO_EDGE" with the default being "GL_REPEAT" if not specified. The following is an example that initializes all the parameters of the declared sampler parameter "mytex"0a
parameter sampler2D mytex = { "picture.jpeg" MIN=GL_NEAREST, MAG=GL_LINEAR, WRAP_S=GL_REPEAT, WRAP_T=GL_REPEAT };
In the above example it was not required to specify the "MAG" sample mode or the "WRAP_S" and "WRAP_T" modes since they are being set to what the default setting would have been but is done here to illustrate the proper syntax. For 1D samplers (ie "sampler1D" there is only "WRAP_S" since there is only one coordinate used to sample the image, and for 3D samplers (ie "sampler3D" there is an additional "WRAP_R" coordinate mode that can be set.
This program was developed to generate a distortion map that encodes the scaling terms used to distort an image according the Brown-Conrady distortion model using as many radial and/or tangential terms as desired. This map can be used in OpenGL shading programs to reduce the complexity of the computation down to a simple scaling term which may result in higher performance. The use of a distortion scaling map is not limited to the Brown-Conrady distortion model implemented in the "warpgen" program but can encode any desired distortion function. This program encodes its terms using a floating-point image format supported by the TIFF image file format. The program has the following usage:
warpgen [-aspect <val>] [-r <num_coeff> <coeff1> ... <coeffn>] [-t <num_coeff> <coeff1> ... <coeffn>] [-size <val>] <file_name.tiff>
Where:
- -aspect ---| val specifies the horizontal/vertical aspect ratio of the generated map file (default=1.778)
- -r <num_coeff> ---| num_coeff specifies the number of radial distortion terms that follow (default=0)
- -t <num_coeff> ---| num_coeff specifies the number of tangential distortion terms that follow (default=0)
- -size ---| val specifies the vertical pixel resolution of the resulting map file (default=512)
- <file_name.tiff>---| specifies the name of the floating point "tiff" image file to save to
The following is the source code to the warpgen program. The program has dependency on the open source FreeImage Library which can be download from:
<http://freeimage.sourceforge.net/>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include "FreeImage.h"
void
Usage( char *prog )
{
fprintf( stderr,
"Usage: %s [-aspect <val>] [-r <num_coeff> <coeff1> ... <coeffn>] [-t <num_coeff> <coeff1> ... <coeffn>] [-size <val>] warpmapfile\n", prog );
exit(-1);
}
/* program generates a distortion texture in floating point TIFF format
* where the components are defined below
*
* R = X coordinate scaling term
* G = Y coordinate scaling term
* B = 1 (unused)
*
* Xd = Xu*(1 + K1*r*r + K2*r*r*r*r) + (P2*(r*r + 2*Xu*Xu) + 2*P1*Xu*Yu)*(1 + P3*r*r + P4*r*r*r*r);
* Yd = Yu*(1 + K1*r*r + K2*r*r*r*r) + (P1*(r*r + 2*Yu*Yu) + 2*P2*Xu*Yu)*(1 + P3*r*r + P4*r*r*r*r);
*
*
*/
int
main( int argc, char *argv[] )
{
int i, j;
int num_r_coeff = 0;
int num_t_coeff = 0;
float *r_coeff = 0;
float *t_coeff = 0;
int xsize = 512;
int ysize = 512;
char *fname = 0;
FREE_IMAGE_FORMAT fif;
FIBITMAP *dib;
double aspect = 16.0/9.0;
float u1, u2, u3, u4;
float v1, v2, v3, v4;
float Av, Bv, Cv, Dv;
float Au, Bu, Cu, Du;
float A, B, C, D;
float a, b, c;
for( i = 1; i < argc; i++ )
{
if( !strcmp( argv[i], "-r" ) )
{
i++;
num_r_coeff = atoi( argv[i] );
if( num_r_coeff > 0 )
{
r_coeff = (float*)malloc( sizeof(float) * num_r_coeff );
for( j = 0; j < num_r_coeff; j++ )
{
i++;
r_coeff[j] = atof( argv[i] );
}
}
}
else if( !strcmp( argv[i], "-aspect" ) )
{
i++;
aspect = atof( argv[i] );
}
else if( !strcmp( argv[i], "-t" ) )
{
i++;
num_t_coeff = atoi( argv[i] );
if( num_t_coeff > 1 )
{
t_coeff = (float*)malloc( sizeof(float) * num_t_coeff );
for( j = 0; j < num_t_coeff; j++ )
{
i++;
t_coeff[j] = atof( argv[i] );
}
}
else
num_t_coeff = 0;
}
else if( !strncmp( argv[i], "-s", 2 ) )
{
i++;
ysize = atoi( argv[i] );
if( ysize < 4 )
ysize = 4;
}
else if( !fname )
{
fname = argv[i];
}
else
Usage( argv[0] );
}
if( !fname )
Usage( argv[0] );
FreeImage_Initialise( TRUE );
xsize = (int)(ysize * aspect);
if( dib = FreeImage_AllocateT( FIT_RGBF, xsize, ysize, 96, 0, 0, 0 ) )
{
double xu,yu,xd,yd,xc,yc,rr,rsq,tsum;
double rscale;
unsigned pitch;
BYTE *bits;
FIRGBF *pixel;
int r, t, ii, jj;
double u,v,du,dv;
double du1,dv1,du2,dv2,sx,sy;
int valid;
int prev_ii, prev_jj, isum;
pitch = FreeImage_GetPitch( dib );
bits = (BYTE*)FreeImage_GetBits( dib );
xc = (double)(xsize-1.0) / 2.0;
yc = (double)(ysize-1.0) / 2.0;
rscale = (double)ysize / 2.0;
for( i = 0; i < ysize; i++ )
{
pixel = (FIRGBF*)bits;
for( j = 0; j < xsize; j++ )
{
xd = xu = (j - xc) / rscale;
yd = yu = (i - yc) / rscale;
/* RADIAL DISTORTION */
rr = rsq = (xu*xu + yu*yu);
for( r = 0; r < num_r_coeff; r++, rr *= rsq )
{
xd += xu*r_coeff[r]*rr;
yd += yu*r_coeff[r]*rr;
}
/* TANGENTAL DISTORTION */
if( num_t_coeff > 1 )
{
rr = rsq;
tsum = 1.0;
for( t = 2; t < num_t_coeff; t++, rr *= rsq )
xd += (t_coeff[1]*(rsq + 2*xu*xu) + 2*t_coeff[0]*xu*yu)*tsum;
yd += (t_coeff[0]*(rsq + 2*yu*yu) + 2*t_coeff[1]*xu*yu)*tsum;
}
if( fabs(xd*xd - xu*xu) < 0.0000000001 )
sx = 1.0;
else
sx = xd / xu;
if( fabs(yd*yd - yu*yu) < 0.0000000001 )
sy = 1.0;
else
sy = yd / yu;
pixel[j].red = sx;
pixel[j].green = sy;
pixel[j].blue = 1.0;
}
bits += pitch;
}
FreeImage_Save( FIF_TIFF, dib, fname, 0 );
FreeImage_Unload( dib );
}
FreeImage_DeInitialise();
return 1;
}
This plugin was modified to support the ability to apply distortion to rendered images via the newly developed dsp_distort2 plugin. This allows the implementation of the Brown-Conrady distortion model which accounts for both radial and tangential distortion effects common in optical imaging systems. This update adds the following Tcl commands to the dsp_poster2 plugin.
doug.plugin dsp_poster2.distort_program set [<prog_name>]
doug.plugin dsp_poster2.distort_program get
doug.plugin dsp_poster2.distort_options set -gridsize <hor_val> <ver_val>
doug.plugin dsp_poster2.distort_options get -gridsize
doug.plugin dsp_poster2.distort_parameter [<prog_name>.]<param_name> set <vals>
doug.plugin dsp_poster2.distort_parameter [<prog_name>.]<param_name> get
The "programs" developed to run on the GPU and referenced above as <prog_name> and the parameters referenced above as <param_name> are defined in greater detail in the dsp_distort2 plugin documentation above.
This plugin was modified to support the ability to apply distortion similar to the changes made to dsp_poster2 except the distortion will be applied to the real time displayed image. This allows the implementation of the Brown-Conrady distortion model which accounts for both radial and tangential distortion effects common in optical imaging systems. This update adds the following Tcl commands to the dsp_speedtest3 plugin.
doug.plugin dsp_speedtest3.distort_program set [<prog_name>]
doug.plugin dsp_speedtest3.distort_program get
doug.plugin dsp_speedtest3.distort_options set -gridsize <hor_val> <ver_val>
doug.plugin dsp_speedtest3.distort_options get -gridsize
doug.plugin dsp_speedtest3.distort_parameter [<prog_name>.]<param_name> set <vals>
doug.plugin dsp_speedtest3.distort_parameter [<prog_name>.]<param_name> get
The "programs" developed to run on the GPU and referenced above as <prog_name> and the parameters referenced above as <param_name> are defined in greater detail in the dsp_distort2 plugin documentation above.
« Allowing For Offscreen Light Flares And Blooms | EDGE User’s Guide | Print Out Any Node Changes In The Scene »