UnitMipmapInMipmapOut.h

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_MIPMAPINOUT_H_
00018 #define _C_UNIT_MIPMAPINOUT_H_
00019 
00020 
00021 //-------------------------------------------------------------------------
00022 // Includes
00023 //-------------------------------------------------------------------------
00024 #include <osgPPU/Export.h>
00025 #include <osgPPU/UnitInOut.h>
00026 
00027 namespace osgPPU
00028 {
00029     //! Same as UnitInOut however do bypass also mipmap levels
00030     /**
00031     * The functionality of this unit is similar to the UnitInOut. However this 
00032     * unit is also capable to bypass mipmap levels. This means that the output texture 
00033     * will be switched in a mipmap mode and the input textures are passed levelwise
00034     * to the output texture. 
00035     *
00036     * In order that this unit work correctly the input texture and the output should be of the 
00037     * same dimensions, otherwise non 1:1 matching of mipmap levels is possible.
00038     **/
00039     class OSGPPU_EXPORT UnitMipmapInMipmapOut : public UnitInOut {
00040         public:
00041             META_Node(osgPPU,UnitMipmapInMipmapOut);
00042          
00043             UnitMipmapInMipmapOut();
00044             UnitMipmapInMipmapOut(const UnitMipmapInMipmapOut&, const osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY);
00045             
00046             //! Release it and used memory
00047             virtual ~UnitMipmapInMipmapOut();
00048             
00049             //! Initialze the Processoring unit
00050             virtual void init();
00051             
00052         protected:
00053 
00054             //! regenerate io mapmapped data structures
00055             void checkIOMipmappedData();
00056 
00057             bool noticeBeginRendering (osg::RenderInfo&, const osg::Drawable* );
00058 
00059                         std::vector<osg::ref_ptr<osg::FrameBufferObject> > mIOMipmapFBO;
00060             std::vector<osg::ref_ptr<osg::Viewport> > mIOMipmapViewport;
00061             std::vector<osg::ref_ptr<osg::Drawable> > mIOMipmapDrawable;
00062 
00063             osg::ref_ptr<osg::RefMatrix> mProjectionMatrix;
00064             osg::ref_ptr<osg::RefMatrix> mModelviewMatrix;
00065     };
00066 
00067 };
00068 
00069 #endif

Back to Homepage of osgPPU

Copyright (C) 2008 by Art Tevs (LGPL)