Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/shaders/src/orxonox/RenderQueueListener.h @ 9407

Last change on this file since 9407 was 9407, checked in by davidsa, 12 years ago

orxonox::RenderQueueListener: Implemented a rudimentary RenderQueueListener to enable the use of stencil buffer for elaborate alpha blending shaders without creating artifacts from overlapping faces. Also added a XML Port to assign a Model to a certain RenderQueueGroup. Needs to be improved to allow the use of strings for choosing the group instead of a static int which may change in the feature.

File size: 2.2 KB
Line 
1/*
2 *   ORXONOX - the hottest 3D action shooter ever to exist
3 *                    > www.orxonox.net <
4 *
5 *
6 *   License notice:
7 *
8 *   This program is free software; you can redistribute it and/or
9 *   modify it under the terms of the GNU General Public License
10 *   as published by the Free Software Foundation; either version 2
11 *   of the License, or (at your option) any later version.
12 *
13 *   This program is distributed in the hope that it will be useful,
14 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
15 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 *   GNU General Public License for more details.
17 *
18 *   You should have received a copy of the GNU General Public License
19 *   along with this program; if not, write to the Free Software
20 *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
21 *
22 *   Author:
23 *      Fabian 'x3n' Landau
24 *      Reto Grieder (physics)
25 *   Co-authors:
26 *      ...
27 *
28 */
29
30#ifndef _ORenderQueueListener_H__
31#define _ORenderQueueListener_H__
32
33#include "OrxonoxPrereqs.h"
34
35#include <OgreRenderQueueListener.h>
36
37namespace orxonox
38{
39    /* Defining some render queue groups based around the main render queue to enable a stenicl buffer based glow effect */
40    enum RenderQueueGroupID
41    {
42        RENDER_QUEUE_MAIN = Ogre::RENDER_QUEUE_MAIN,
43        RENDER_QUEUE_STENCIL_OBJECTS = RENDER_QUEUE_MAIN+1,
44        RENDER_QUEUE_STENCIL_GLOW = RENDER_QUEUE_MAIN+2,
45        RENDER_QUEUE_STENCIL_LAST = RENDER_QUEUE_STENCIL_GLOW
46    };
47
48    const int STENCIL_VALUE_FOR_GLOW = 1; //if more than one type of stencil mask is to be used it needs to use another value
49    const int STENCIL_FULL_MASK = 0xFFFFFFFF;
50   
51    /* Deriving from the Ogre RenderQueueListener to define our own handling of the different rendering stages to enable alpha based shader/glow effects */
52    class _OrxonoxExport RenderQueueListener : public Ogre::RenderQueueListener
53    {
54        public:
55            virtual void renderQueueStarted(Ogre::uint8 queueGroupId, const Ogre::String& invocation, bool& skipThisInvocation);
56            virtual void renderQueueEnded(Ogre::uint8 queueGroupId, const Ogre::String& invocation, bool& repeatThisInvocation);
57    };
58}
59
60#endif /* _ORenderQueueListener_H__ */
Note: See TracBrowser for help on using the repository browser.