SO3Engine
SO3RtssClipPlane.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) 2023 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
32#ifndef __SO3RTSS_CLIPPLANE_H__
33#define __SO3RTSS_CLIPPLANE_H__
34
36#include "SO3Renderer/SO3Root.h"
37
38namespace SO3
39{
40 extern const Ogre::String SRS_CLIP_PLANE;
41 class FFPClipPLane : public Ogre::RTShader::SubRenderState
42 {
43
44 private:
45 Ogre::RTShader::UniformParameterPtr mWorldMatrix;
46 Ogre::RTShader::UniformParameterPtr mPSClipPlaneRef;
47 Ogre::RTShader::ParameterPtr mVSInPosition;
48 Ogre::RTShader::ParameterPtr mVSOutPosition;
49 Ogre::RTShader::ParameterPtr mPSInPosition;
50
51
52 protected:
53
57 bool resolveParameters(Ogre::RTShader::ProgramSet* programSet) override;
58
62 bool resolveDependencies(Ogre::RTShader::ProgramSet* programSet) override;
63
67 bool addFunctionInvocations(Ogre::RTShader::ProgramSet* programSet) override;
68
69 public:
73 const Ogre::String& getType() const override;
74
78 int getExecutionOrder() const override;
79
83 bool preAddToRenderState(const Ogre::RTShader::RenderState* renderState, Ogre::Pass* srcPass, Ogre::Pass* dstPass) override;
84
88 void copyFrom(const Ogre::RTShader::SubRenderState& rhs) override;
89
93 void updateGpuProgramsParams(Ogre::Renderable* rend, const Ogre::Pass* pass, const Ogre::AutoParamDataSource* source, const Ogre::LightList* pLightList) override;
94
95 };
96
97 class FFPClipPLaneFactory : public Ogre::RTShader::SubRenderStateFactory
98 {
99
100 public:
101 static Ogre::String Type;
102
106 const Ogre::String& getType() const override;
107
108 protected:
109
113 Ogre::RTShader::SubRenderState* createInstanceImpl() override;
114 };
115
116}
117
118#endif
librairies include
const Ogre::String & getType() const override
static Ogre::String Type
Ogre::RTShader::SubRenderState * createInstanceImpl() override
void updateGpuProgramsParams(Ogre::Renderable *rend, const Ogre::Pass *pass, const Ogre::AutoParamDataSource *source, const Ogre::LightList *pLightList) override
bool resolveParameters(Ogre::RTShader::ProgramSet *programSet) override
int getExecutionOrder() const override
bool preAddToRenderState(const Ogre::RTShader::RenderState *renderState, Ogre::Pass *srcPass, Ogre::Pass *dstPass) override
bool resolveDependencies(Ogre::RTShader::ProgramSet *programSet) override
const Ogre::String & getType() const override
bool addFunctionInvocations(Ogre::RTShader::ProgramSet *programSet) override
void copyFrom(const Ogre::RTShader::SubRenderState &rhs) override
const Ogre::String SRS_CLIP_PLANE