[vtkusers] Can refractive index be set in VTK?

Tuhin Sinha tk.sinha at vanderbilt.edu
Mon Sep 6 11:41:07 EDT 2004


>From the opengl FAQ:

How can I achieve a refraction lighting effect?
        First, consider whether OpenGL [the backbone of VTK] is the
        right API for you. You might need to use a ray tracer to achieve
        complex light affects such as refraction.
        
        If you're certain that you want to use OpenGL, you need to keep
        in mind that OpenGL doesn’t provide functionality to produce a
        refraction effect. You'll need to fake it. The most likely
        solution is to calculate an image corresponding to the refracted
        rendering, and texture map it onto the surface of the primitive
        that's refracting the light.
        

Having said that... I think you could also do what you want to do want
to do with a GLSLang/Cg shader and then derive a special
vtkRefractiveShaderMapper/Actor that will correctly draw the object into
the scene.  If you want to explore this option I recommend reviewing the
"Raytraced Refraction" demo at Nvidia's developer site:
http://developer.nvidia.com/object/cg_effects_explained.html and look
through vtkOpenGLActor.cxx and vtkOpenGLPolyDataMapper.cxx in
${VTK_DIR}/Rendering to get an idea of where you may want to implement
the shader.

Hope this helps,

Tuhin Sinha
        


On Mon, 2004-09-06 at 07:12, s comp wrote:
> Can refractive index, (or any other optical properties other than
> opacity) be set for particular regions in VTK. If not what classes
> should I Iook at modifying/inheriting from to do this (Although I
> don't expect to do this in the near future it would be interesting to
> know)
> 
> 
> 
> ______________________________________________________________________
> Find local movie times and trailers on Yahoo! Movies.
> 
> 
> ______________________________________________________________________
> _______________________________________________
> This is the private VTK discussion list. 
> Please keep messages on-topic. Check the FAQ at: <http://public.kitware.com/cgi-bin/vtkfaq>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers




More information about the vtkusers mailing list