[vtk-developers] vtkShadowRenderer

Wylie, Brian bnwylie at sandia.gov
Mon Mar 31 15:15:23 EST 2003


Attached are some images from the new vtkShadowRenderer we are working on.
In 'theory' a VTK app can just replace its vtkRenderer with a
vtkShadowRenderer and 'viola' shadows (including self shadows).

Anyway, we had to comment out some lines in the main trunk in order for the
vtkShadowRenderer to work.

I had to comment out the 2 following lines...

vtkOpenGLPolyDataMapper.cxx -- line 126
ren->GetRenderWindow()->MakeCurrent();

and

vtkOpenGLProperty.cxx -- line 51
glDisable(GL_TEXTURE_2D);

I believe that the 'makecurrent' line is just a safety check and really not
necessary. The disable texture line may also not be necessary but I
understand that an object oriented system cannot make assumptions about
existing state. So that one may require some thought.

Also (this change will be beneficial even without vtkShadowRenderer). When
specifying the pixel format, the bit depth for Z is specified as 32.
Intuitively this should be fine, because if ChoosePixelFormat can't give you
that it should give you something close (24 bit). Well in practice, (my
empirical experience which has been quite a number of different cards)
trying to get 32, will most often 'fail' down to a 16 bit Z. While
specifying 24 will always get you 24 (unless you have some really old card
that doesn't have 24, in which case it should 'fail' down to 16).

Since none of the popular cards support 32 bit Z, it might be better to just
try for 24.

So I'm looking for feedback from the developers to see if they believe the
proposed changes could be made.

I will provide Kitware with the source code for vtkShadowRenderer soon.

Best regards,

	Brian Wylie
	Sandia National Laboratories
	MS 0822 - Org 9227 - Building 880/A1-J
     (505) 844-2238   FAX (505) 845-0833

-------------- next part --------------
A non-text attachment was scrubbed...
Name: cow_without_shadow.jpg
Type: image/jpeg
Size: 15363 bytes
Desc: not available
URL: <http://www.vtk.org/pipermail/vtk-developers/attachments/20030331/56bdce72/attachment.jpg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cow_with_shadow.jpg
Type: image/jpeg
Size: 17239 bytes
Desc: not available
URL: <http://www.vtk.org/pipermail/vtk-developers/attachments/20030331/56bdce72/attachment-0001.jpg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: llnl_with_shadow_sm.jpg
Type: image/jpeg
Size: 82585 bytes
Desc: not available
URL: <http://www.vtk.org/pipermail/vtk-developers/attachments/20030331/56bdce72/attachment-0002.jpg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: llnl_without_shadow_sm.jpg
Type: image/jpeg
Size: 94934 bytes
Desc: not available
URL: <http://www.vtk.org/pipermail/vtk-developers/attachments/20030331/56bdce72/attachment-0003.jpg>


More information about the vtk-developers mailing list