00001 /*************************************************************************** 00002 * Copyright (c) 2008 Art Tevs * 00003 * * 00004 * This library is free software; you can redistribute it and/or modify * 00005 * it under the terms of the GNU Lesser General Public License as * 00006 * published by the Free Software Foundation; either version 3 of * 00007 * the License, or (at your option) any later version. * 00008 * * 00009 * This library is distributed in the hope that it will be useful, * 00010 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 00011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 00012 * GNU Lesse General Public License for more details. * 00013 * * 00014 * The full license is in LICENSE file included with this distribution. * 00015 ***************************************************************************/ 00016 00017 #ifndef _C_UNIT_CAMERABUFFER_BYPASS_H_ 00018 #define _C_UNIT_CAMERABUFFER_BYPASS_H_ 00019 00020 00021 //------------------------------------------------------------------------- 00022 // Includes 00023 //------------------------------------------------------------------------- 00024 #include <osgPPU/UnitBypass.h> 00025 00026 namespace osgPPU 00027 { 00028 //! Bypass a specified camera attacment into the pipeline 00029 /** 00030 * This unit do not perform any rendering, however it do 00031 * bypass any camera attachment of camera of the parent processor or unit 00032 * to its output texture. 00033 * Per default the unit do bypass the color buffer attachment. 00034 * 00035 * This unit has to be placed directly under the processor, so that the unit 00036 * get access to the processor's attachments. 00037 * 00038 * This unit can also bypass a camera attachment of UnitCamera parent unit. 00039 * For this purpose the unit has to be placed directly under UnitCamera. Camera 00040 * output will then be bypassed. 00041 **/ 00042 class OSGPPU_EXPORT UnitCameraAttachmentBypass : public UnitBypass { 00043 public: 00044 META_Node(osgPPU,UnitCameraAttachmentBypass); 00045 00046 UnitCameraAttachmentBypass(); 00047 UnitCameraAttachmentBypass(const UnitCameraAttachmentBypass& u, const osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY); 00048 00049 virtual ~UnitCameraAttachmentBypass(); 00050 00051 virtual void init(); 00052 00053 /** 00054 * Setup the buffer component which has to be bypassed. 00055 **/ 00056 void setBufferComponent(osg::Camera::BufferComponent c); 00057 00058 /** 00059 * Get current buffer component 00060 **/ 00061 const osg::Camera::BufferComponent getBufferComponent() const { return _bufferComponent; } 00062 00063 protected: 00064 virtual void setupInputsFromParents(); 00065 osg::Camera::BufferComponent _bufferComponent; 00066 00067 }; 00068 }; 00069 00070 #endif
Copyright (C) 2008 by Art Tevs (LGPL)