1 | /* |
---|
2 | ----------------------------------------------------------------------------- |
---|
3 | This source file is part of LEXIExporter |
---|
4 | |
---|
5 | Copyright 2006 NDS Limited |
---|
6 | |
---|
7 | Author(s): |
---|
8 | Mark Folkenberg, |
---|
9 | Bo Krohn |
---|
10 | |
---|
11 | This program is free software; you can redistribute it and/or modify it under |
---|
12 | the terms of the GNU Lesser General Public License as published by the Free Software |
---|
13 | Foundation; either version 2 of the License, or (at your option) any later |
---|
14 | version. |
---|
15 | |
---|
16 | This program is distributed in the hope that it will be useful, but WITHOUT |
---|
17 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS |
---|
18 | FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. |
---|
19 | |
---|
20 | You should have received a copy of the GNU Lesser General Public License along with |
---|
21 | this program; if not, write to the Free Software Foundation, Inc., 59 Temple |
---|
22 | Place - Suite 330, Boston, MA 02111-1307, USA, or go to |
---|
23 | http://www.gnu.org/copyleft/lesser.txt. |
---|
24 | ----------------------------------------------------------------------------- |
---|
25 | */ |
---|
26 | |
---|
27 | #include "LexiIntermediateAPI.h" |
---|
28 | |
---|
29 | class COgreMaterialCompiler |
---|
30 | { |
---|
31 | public: |
---|
32 | |
---|
33 | COgreMaterialCompiler( CIntermediateMaterial* pIntermediateMaterial ); |
---|
34 | virtual ~COgreMaterialCompiler(); |
---|
35 | |
---|
36 | bool WriteOgreMaterial( const Ogre::String& sFilename ); |
---|
37 | Ogre::MaterialPtr GetOgreMaterial( void ); |
---|
38 | void CopyTextureMaps( Ogre::String outPath ); |
---|
39 | void CopyShaderSources( Ogre::String outPath ); |
---|
40 | protected: |
---|
41 | |
---|
42 | void InitializeOgreComponents( void ); |
---|
43 | |
---|
44 | private: |
---|
45 | |
---|
46 | void CreateOgreMaterial( void ); |
---|
47 | void ParseMaterialMaps( Ogre::Pass* pass ); |
---|
48 | void CreateTextureUnits( Ogre::Pass* pass, STextureMapInfo texInfo ); |
---|
49 | |
---|
50 | void CreatePureBlinn( Ogre::Pass* pass); |
---|
51 | void CreateDiffuse( Ogre::Pass* pass ); |
---|
52 | void CreateSpecularColor( Ogre::Pass* pass ); |
---|
53 | void CreateSpecularLevel( Ogre::Pass* pass ); |
---|
54 | void CreateSelfIllumination( Ogre::Pass* pass ); |
---|
55 | void CreateDiffuseAndOpacity( Ogre::Pass* pass ); |
---|
56 | |
---|
57 | static int doFileCopy(Ogre::String inFile, Ogre::String outFile); |
---|
58 | |
---|
59 | Ogre::MaterialPtr m_pOgreMaterial; |
---|
60 | CIntermediateMaterial* m_pIMaterial; |
---|
61 | |
---|
62 | bool m_bReindex; |
---|
63 | bool m_bExportNormals; |
---|
64 | bool m_bExportColours; |
---|
65 | bool m_bExportTexUVs; |
---|
66 | |
---|
67 | }; |
---|