There are no exposed uniform variables since the IDLgrShaderConvol3 object exposes its uniform variables as properties. When you call SetProperty for one of the convolution shader’s properties, it calls SetUniformVariable internally. See IDLgrShaderConvol3 Properties for information on the BASE_BLEND_FACTOR, CONVOL_BLEND_FACTOR, and KERNEL properties.

If you look in located in the lib subdirectory of the IDL distribution, you will see the following uniform variables in the fragment shader program:

uniform sampler2D _IDL_ImageTexture
uniform float BaseBlend
uniform float ConvolBlend
uniform vec2 _IDL_ImageStep
uniform vec4 kernel[9]

The BaseBlend, ConvolBlend and kernel variables relate to object properties. The _IDL_ImageTexture refers to the base IDLgrImage object and _IDL_ImageStep is used by the convolution filtering operation. Both are reserved uniform variables.

See Filter Chain Shaders for more information.

Hardware Shader Program for Filter Chain Example

The fragment and vertex shader programs are incorporated into the IDLgrShaderConvol3 object definition file,, located in the lib subdirectory of the IDL distribution.

Software Fallback for the Filter Chain Shader

The IDLgrShaderConvol3 object definition file includes a software fallback option that can be exercised using the IDLgrFilterChain FORCE_FILTER property. Set the property either on object creation or in the FilterChain object’s Init method. For example, to use the shader_filterchain_doc example with the software fallback, create the object as follows:

obj=OBJ_NEW('shader_filterchain_doc', /FORCE_FILTER)

Switching the value of the FORCE_FILTER property between 0 and 1 in this example allows you to see the execution speed differences between the hardware and software versions of the filter chain. When you create a shader_filterchain_doc object and select mineral.png, you can apply one or more convolution shaders and modify shader parameters as shown in the following figure.