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 vtkTypeRevisionMacro(vtkDepthPeelingPass,vtkRenderPass);
00056 void PrintSelf(ostream& os, vtkIndent indent);
00057
00060 virtual void Render(const vtkRenderState *s);
00061
00064 void ReleaseGraphicsResources(vtkWindow *w);
00065
00067
00070 vtkGetObjectMacro(TranslucentPass,vtkRenderPass);
00071 virtual void SetTranslucentPass(vtkRenderPass *translucentPass);
00073
00075
00082 vtkSetClampMacro(OcclusionRatio,double,0.0,0.5);
00083 vtkGetMacro(OcclusionRatio,double);
00085
00087
00090 vtkSetMacro(MaximumNumberOfPeels,int);
00091 vtkGetMacro(MaximumNumberOfPeels,int);
00093
00095
00097 vtkGetMacro(LastRenderingUsedDepthPeeling,bool);
00099
00104 int GetDepthPeelingHigherLayer();
00105
00106 protected:
00108 vtkDepthPeelingPass();
00109
00111 virtual ~vtkDepthPeelingPass();
00112
00115 void CheckSupport(vtkOpenGLRenderWindow *w);
00116
00118 void CheckCompilation(unsigned int fragmentShader);
00119
00121
00125 int RenderPeel(const vtkRenderState *s,
00126 int layer);
00128
00129 vtkRenderPass *TranslucentPass;
00130 vtkTimeStamp CheckTime;
00131 bool IsChecked;
00132 bool IsSupported;
00133
00135
00136 int ViewportX;
00137 int ViewportY;
00138 int ViewportWidth;
00139 int ViewportHeight;
00141
00144 unsigned int DepthFormat;
00145
00153 double OcclusionRatio;
00154
00158 int MaximumNumberOfPeels;
00159
00160 bool LastRenderingUsedDepthPeeling;
00161
00163 vtkDepthPeelingPassLayerList *LayerList;
00164
00165 unsigned int OpaqueLayerZ;
00166 unsigned int TransparentLayerZ;
00167
00168
00169
00170
00171
00172
00173 int DepthPeelingHigherLayer;
00174
00175 vtkShaderProgram2 *Prog;
00176 vtkShader2 *Shader;
00177
00178 int ShadowTexUnit;
00179 int OpaqueShadowTexUnit;
00180
00181 private:
00182 vtkDepthPeelingPass(const vtkDepthPeelingPass&);
00183 void operator=(const vtkDepthPeelingPass&);
00184 };
00185
00186 #endif