SO3Engine
SO3GBuffer.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_H__
26#define __SO3_DEFERRED_SHADING_GBUFFER_H__
27
29#include "OgreStringConverter.h"
30
31namespace SO3
32{
33
36class _SO3_Export SGBuffer : public SData
37{
38public:
40 {
41 SO3_GBUFFER_NONE = 0x00,
42 SO3_GBUFFER_DIFFUSE = 0x01, // Mandatory, diffuse color of the texel in view space
43 SO3_GBUFFER_NORMALS = 0x02, // Mandatory, normal of the texel, relative to the camera, in view space
44 SO3_GBUFFER_DEPTH = 0x04, // Mandatory, Z position (depth) of the texel, relative to the camera, in view space
45 SO3_GBUFFER_SPECULAR = 0x08, // Specular colour of the (unlit) texel
46 SO3_GBUFFER_SHININESS = 0x0F, // Shininess power of the specular component. If shininess is supported by the gbuffer, but not specular component, the 'lit' specular colour will be computed using an approximation of the specular light contribution.
47 SO3_GBUFFER_EMISSIVE = 0x10, // Emissive power of the texel. This is not the standard emissive colour, diffuse colour will be used instead of it. A sum of the standard emissive colour components is done, and then divided by 3 (alpha is ignored) to compute the emissive power.
48 SO3_GBUFFER_VELOCITY = 0x20, // Velocity vector from one frame to another, for motion blur
49 SO3_GBUFFER_MATERIAL_ID = 0x40, // Material ID to switch light processing method in shaders
50 SO3_GBUFFER_MANDATORY_MASK = 0x04 // Useful mask to extract ony mandatory components.
51 };
52protected:
53 Ogre::uint32 channels;
54private:
55 const unsigned int numberMrt;
56
57public:
60 unsigned int GetNumberMrt() const;
61
64 Ogre::String GetGBufferMaterialPixelOutputStructureTypeName();
65
68 Ogre::String GenerateGBufferMaterialPixelOutputStructure();
69
72 Ogre::String GetGBufferCompositorPixelInputStructureTypeName();
73
76 Ogre::String GenerateGBufferCompositorPixelInputStructure();
77
81 Ogre::uint32 GetChannels();
82protected:
88 SGBuffer(Ogre::String gbufferId, unsigned int gbufferMrtNumber);
89
94
99
104
109private:
113 SGBuffer();
114
118 Ogre::String GenerateGBufferBaseMaterialPixelOutputStructure();
119
123 Ogre::String GenerateGBufferBaseCompositorPixelInputStructure();
124};
125
126}
127
128#endif
Ogre::uint32 channels
Definition SO3GBuffer.h:53
virtual Ogre::String GenerateGBufferCompositorPixelInputStructureImpl()=0
virtual Ogre::String GenerateGBufferMaterialPixelOutputStructureImpl()=0
virtual Ogre::String GetGBufferMaterialPixelOutputStructureTypeNameImpl()=0
virtual Ogre::String GetGBufferCompositorPixelInputStructureTypeNameImpl()=0