Skylicht Engine
Toggle main menu visibility
Loading...
Searching...
No Matches
RenderPipeline
CRenderToTextureRP.h
1
/*
2
!@
3
MIT License
4
5
Copyright (c) 2025 Skylicht Technology CO., LTD
6
7
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files
8
(the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify,
9
merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
10
subject to the following conditions:
11
12
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
13
14
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
15
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
16
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
17
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
19
20
This file is part of the "Skylicht Engine".
21
https://github.com/skylicht-lab/skylicht-engine
22
!#
23
*/
24
25
#pragma once
26
27
#include "CBaseRP.h"
28
29
namespace
Skylicht
30
{
91
class
SKYLICHT_API CRenderToTextureRP :
public
CBaseRP
92
{
93
protected
:
94
int
m_id;
95
bool
m_enable;
96
core::matrix4
m_bias;
97
float
m_scale;
98
core::dimension2du
m_size;
99
core::dimension2du
m_customSize;
100
CCamera
* m_customCamera;
101
ITexture
* m_renderTarget;
102
IRenderPipeline
* m_customPipleline;
103
video::ECOLOR_FORMAT
m_format;
104
bool
m_autoGenerateMipmap;
105
106
public
:
107
CRenderToTextureRP(
u32
id
,
video::ECOLOR_FORMAT
format,
const
core::dimension2du
& customSize =
core::dimension2du
(),
float
scale = 1.0f);
108
109
virtual
~CRenderToTextureRP();
110
111
virtual
void
initRender(
int
w,
int
h);
112
113
virtual
void
resize(
int
w,
int
h);
114
115
virtual
void
render(
ITexture
* target,
CCamera
* camera,
CEntityManager
* entityManager,
const
core::recti
& viewport,
int
cubeFaceId = -1,
IRenderPipeline
* lastRP = NULL);
116
117
inline
void
setCustomCamera(
CCamera
* camera)
118
{
119
m_customCamera = camera;
120
}
121
122
inline
CCamera
* getCustomCamera()
123
{
124
return
m_customCamera;
125
}
126
127
inline
int
getId()
128
{
129
return
m_id;
130
}
131
132
inline
bool
isEnable()
133
{
134
return
m_enable;
135
}
136
137
inline
void
setEnable(
bool
b)
138
{
139
m_enable = b;
140
}
141
142
inline
ITexture
* getTarget()
143
{
144
return
m_renderTarget;
145
}
146
147
inline
void
setCustomPipleline(
IRenderPipeline
* pipeline)
148
{
149
m_customPipleline = pipeline;
150
}
151
152
inline
void
enableAutoGenerateMipmap(
bool
b)
153
{
154
m_autoGenerateMipmap = b;
155
}
156
157
inline
bool
isAutoGenerateMipmap()
158
{
159
return
m_autoGenerateMipmap;
160
}
161
162
static
const
float
* getMatrix(
int
id
);
163
164
protected
:
165
166
void
initRTT(
int
w,
int
h);
167
168
void
releaseRTT();
169
};
170
}
Skylicht::CCamera
This is an object class used to set up the camera, including its position, viewing angle,...
Definition
CCamera.h:70
Skylicht::CEntityManager
This object class manages all entities within a scene.
Definition
CEntityManager.h:89
Skylicht::IRenderPipeline
Definition
IRenderPipeline.h:37
irr::video::ITexture
Interface of a Video Driver dependent Texture.
Definition
ITexture.h:119
Skylicht
Everything in the Skylicht Engine. You can start by looking at the topics.
Definition
AudioDebugLog.h:29
irr::core::recti
rect< s32 > recti
Rectangle with int values.
Definition
rect.h:273
irr::core::matrix4
CMatrix4< f32 > matrix4
Typedef for f32 matrix.
Definition
matrix4.h:2241
irr::core::dimension2du
dimension2d< u32 > dimension2du
Typedef for an unsigned integer dimension.
Definition
dimension2d.h:212
irr::video::ECOLOR_FORMAT
ECOLOR_FORMAT
An enum for the color format of textures used by the Irrlicht Engine.
Definition
SColor.h:18
irr::u32
unsigned int u32
32 bit unsigned variable.
Definition
irrTypes.h:58
Generated by
1.17.0