View Single Post
  #4  
Old 03-25-2010, 02:19 PM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
The vizlens module simply creates a post-process shader that modifies the rendered image. If you are familiar with OpenGL shaders, it is very easy to create your own post-process shader. Here is a basic template for your own shader:
Code:
import viz
import vizpp
viz.go()

viz.add('gallery.ive')

distortionShader = """
uniform sampler2D vizpp_InputTex;
void main()
{
	vec2 texCoord = gl_TexCoord[0].st;
	
	//Perform distorion of texCoord
	
	gl_FragColor = texture2D(vizpp_InputTex, texCoord);
}
"""

distortionEffect = vizpp.ShaderEffect(frag=distortionShader)

vizpp.addEffect( distortionEffect )
Reply With Quote