mpvShaderManagerPlugin Code
Status: Beta
Brought to you by:
pcastonguay
/* * pluginShaderManager for MPV * Copyright (C) 2008, Patrick Castonguay * * This library is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by the Free * Software Foundation; either version 2.1 of the License, or (at your option) * any later version. * * This library is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public License * along with this library; if not, write to the Free Software Foundation, Inc., * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * * 10/10/2008 Patrick Castonguay * Initial release * */ This plugin uses the shaders.def file to load and manage shaders for MPV. The ShaderManager hold a cache of all the shader programs and groups of programs, for other plugins to use and control the shaders one would have to retreive the ShaderManager from the blackboard. In order to enable the ShaderManager, the following line has to be added to the plugin.def file in the MPV file structure: filename = "libpluginShaderManager"; The Delta3D shader management style was reused for this project and incorporated in the MPV architecture as an indepent plugin. Thanks to the guys at Delta3D for their efforts in developing such architecture and their help throught the development of this project. The current parsing of the ShaderManager was adapted to fit in with the .def file paradigm used by the MPV prject as of the date of development. Delta3D already has support for loading from XML files and if this functionality is needed in the future, the files shaderxml.h and shaderxml.cpp could be reused from the Delta3D project. TODO: Clean up files from referance to "Delta3D commented out" stuff; Assign shaders to entities and scene as specified in a def file; -> This is currently done programaticaly Add more parameter type to shader manager, program & loader; -> oscillator KNOWN BUGS: When searching for a program group that does not exist, program crashes; Some information: The ShaderManager was taken and modified from the Delta3D project http://delta3d.org/ The rest of the work was done by Patrick Castonguay 2008 mailto: pcastonguay@users.sourceforge.net This project is intended for use with the MPV and CIGI https://sourceforge.net/projects/cigi/ The dofppu and hdrppu files are from the osgPPU project and are not used... Just don't know how to removed them from the repository. The solution file was created for VS2005 with SP1 and runs on a WinXP Pro 64bit machine and probably any WinXP machine. The shader files included in this project come from the following sources: osgPPU (Art) subrScene (Rob) msdn the orange book -- hopefully, I have not forgotten anybody...