Project

General

Profile

SO3Engine
SO3GBufferMaterialPermutation.h
Go to the documentation of this file.
1/*
2-----------------------------------------------------------------------------
3This source file is part of OpenSpace3D
4For the latest info, see http://www.openspace3d.com
5
6Copyright (c) 2012 I-maginer
7
8This program is free software; you can redistribute it and/or modify it under
9the terms of the GNU Lesser General Public License as published by the Free Software
10Foundation; either version 2 of the License, or (at your option) any later
11version.
12
13This program is distributed in the hope that it will be useful, but WITHOUT
14ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
15FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
16
17You should have received a copy of the GNU Lesser General Public License along with
18this program; if not, write to the Free Software Foundation, Inc., 59 Temple
19Place - Suite 330, Boston, MA 02111-1307, USA, or go to
20http://www.gnu.org/copyleft/lesser.txt
21
22-----------------------------------------------------------------------------
23*/
24
25#ifndef __SO3_DEFERRED_SHADING_GBUFFER_MATERIAL_PERMUTATION_H__
26#define __SO3_DEFERRED_SHADING_GBUFFER_MATERIAL_PERMUTATION_H__
27
29#include <Ogre.h>
30
31namespace SO3
32{
33
37{
38public:
39 //The relevant options for objects that are rendered to the GBuffer
41 {
42 //(Regular) Textures
43 SO3_GBP_NO_TEXTURES = 0x00000000,
44 SO3_GBP_ONE_TEXTURE = 0x00000001,
48
49 //Material properties
54
55 //The number of texture coordinate sets
60
61 // Do we have a normal map
62 SO3_GBP_NORMAL_MAP = 0x00000800,
63
64 // Do we have a lightmap
65 SO3_GBP_LIGHT_MAP = 0x00001000,
66
67 // Do we have a specular map?
69
70 //Are we skinned?
71 SO3_GBP_SKINNED = 0x00010000
72 };
73 static const Ogre::uint32 SO3_GBUFFER_MAT_MASK = 0xFF00FFFF; // The mask of the flags that matter for generating the material
74 static const Ogre::uint32 SO3_GBUFFER_VS_MASK = 0x00FFFF00; // The mask of the flags that matter for generating the vertex shader
75 static const Ogre::uint32 SO3_GBUFFER_FS_MASK = 0x0000FFFF; // The mask of the flags that matter for generating the fragment shader
76 Ogre::uint32 flags;
77protected:
78private:
79
80public:
84
87 Ogre::uint32 operator &(const GBufferPermutations& perms);
88
91 Ogre::uint32 operator |(const GBufferPermutations& perms);
92
95 Ogre::uint32 operator |=(const GBufferPermutations& perms);
96protected:
100 virtual Ogre::uint32 GetPermutationsImpl();
101
105 virtual Ogre::uint32 GetMaterialPermutationsImpl();
106
110 virtual Ogre::uint32 GetVertexPermutationsImpl();
111
115 virtual Ogre::uint32 GetFragmentPermutationsImpl();
116
120 virtual std::string ToStringImpl();
121private:
122};
123
124}
125
126#endif
Ogre::uint32 operator&(const GBufferPermutations &perms)
Ogre::uint32 operator|=(const GBufferPermutations &perms)
Ogre::uint32 operator|(const GBufferPermutations &perms)