WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 03-23-2010, 08:49 AM
rwgray rwgray is offline
Member
 
Join Date: Mar 2010
Posts: 2
Warping Rendered Scene?

I have a custom Head Mounted Display (HMD). (Stereo = one micro display for each eye.) I need to warp the rendered (stereo) scene to compensate for the optical distortions of the HMD so I can view the scene without distortion.

What is the best way to do this?
Is there some texture mapping I can use, or do I have to write my own rendering functions? Anything in the software that allows for specifying compensation of distortion in the HMD by warping the rendered scene prior to sending to HMD?

Cheers,
Bob Gray
Reply With Quote
  #2  
Old 03-23-2010, 09:25 AM
Jeff Jeff is offline
WorldViz Team Member
 
Join Date: Aug 2008
Posts: 2,466
Take a look at the vizlens module.

http://www.worldviz.com/vizhelp/VizH...correction.htm
Reply With Quote
  #3  
Old 03-25-2010, 01:57 PM
rwgray rwgray is offline
Member
 
Join Date: Mar 2010
Posts: 2
Lens Correction

But this looks like it is only for pincushion distortion.

I need to specify an "arbitrary" warping. The warping is specifyed by the pixel displacement. Instead for pixel (i, j) going to (i, j) it needs to go to (m, n). I have this correspondence for every pixel in the display. The warping is not symmetrical. Any way to specify this in the vizlens?

Cheers,
Bob Gray
Reply With Quote
  #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
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Copying Scene? Brett Lindberg Vizard 0 08-28-2009 11:56 PM
addWindow only in one special scene lilio Vizard 1 08-20-2009 09:45 AM
Active scene Chrissy2009 Vizard 2 07-13-2009 09:49 AM
saving the scene giancamati Vizard 1 12-21-2006 09:25 AM
Collision with avatars and scene not working JvdBosch Vizard 12 09-14-2006 06:01 PM


All times are GMT -7. The time now is 08:26 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2021, vBulletin Solutions, Inc.
Copyright 2002-2018 WorldViz LLC