00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00041 #ifndef __vtkDepthPeelingPass_h
00042 #define __vtkDepthPeelingPass_h
00043 
00044 #include "vtkRenderPass.h"
00045 
00046 class vtkOpenGLRenderWindow;
00047 class vtkDepthPeelingPassLayerList; 
00048 class vtkShaderProgram2;
00049 class vtkShader2;
00050 
00051 class VTK_RENDERING_EXPORT vtkDepthPeelingPass : public vtkRenderPass
00052 {
00053 public:
00054   static vtkDepthPeelingPass *New();
00055   vtkTypeMacro(vtkDepthPeelingPass,vtkRenderPass);
00056   void PrintSelf(ostream& os, vtkIndent indent);
00057 
00058   
00060 
00062   virtual void Render(const vtkRenderState *s);
00063   
00065   
00068   void ReleaseGraphicsResources(vtkWindow *w);
00069   
00071 
00074   vtkGetObjectMacro(TranslucentPass,vtkRenderPass);
00075   virtual void SetTranslucentPass(vtkRenderPass *translucentPass);
00077 
00079 
00086   vtkSetClampMacro(OcclusionRatio,double,0.0,0.5);
00087   vtkGetMacro(OcclusionRatio,double);
00089   
00091 
00094   vtkSetMacro(MaximumNumberOfPeels,int);
00095   vtkGetMacro(MaximumNumberOfPeels,int);
00097 
00099 
00101   vtkGetMacro(LastRenderingUsedDepthPeeling,bool);
00103 
00110  protected:
00112   vtkDepthPeelingPass();
00113 
00115   virtual ~vtkDepthPeelingPass();
00116 
00119   void CheckSupport(vtkOpenGLRenderWindow *w);
00120 
00122   void CheckCompilation(unsigned int fragmentShader);
00123   
00125 
00129   int RenderPeel(const vtkRenderState *s,
00130                  int layer);
00132 
00133   vtkRenderPass *TranslucentPass;
00134   vtkTimeStamp CheckTime;
00135   bool IsChecked;
00136   bool IsSupported;
00137 
00139 
00140   int ViewportX;
00141   int ViewportY;
00142   int ViewportWidth;
00143   int ViewportHeight;
00145   
00148   unsigned int DepthFormat;
00149 
00157   double OcclusionRatio;
00158    
00162   int MaximumNumberOfPeels;
00163 
00164   bool LastRenderingUsedDepthPeeling;
00165 
00167   vtkDepthPeelingPassLayerList *LayerList;
00168   
00169   unsigned int OpaqueLayerZ;
00170   unsigned int TransparentLayerZ;
00171 
00172 
00173   
00174   
00175   
00176   
00177   int DepthPeelingHigherLayer;
00178   
00179   vtkShaderProgram2 *Prog;
00180   vtkShader2 *Shader;
00181   
00182   int ShadowTexUnit; 
00183   int OpaqueShadowTexUnit; 
00184   
00185  private:
00186   vtkDepthPeelingPass(const vtkDepthPeelingPass&);  
00187   void operator=(const vtkDepthPeelingPass&);  
00188 };
00189 
00190 #endif