Skylicht Engine
Toggle main menu visibility
Loading...
Searching...
No Matches
ParticleSystem
Particles
Renderers
CCPURenderer.h
1
/*
2
!@
3
MIT License
4
5
Copyright (c) 2020 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 "IRenderer.h"
28
#include "ParticleSystem/Particles/CParticle.h"
29
30
namespace
Skylicht
31
{
32
namespace
Particle
33
{
40
class
COMPONENT_API CCPURenderer :
public
IRenderer
41
{
42
public
:
47
enum
EBillboardType
48
{
49
Billboard
,
50
Frontal
,
51
Velocity
,
52
RotateY
53
};
54
59
enum
ETransparentType
60
{
61
Addtive
,
62
Transparent
63
};
64
65
protected
:
66
static
const
u32
NB_INDICES_PER_QUAD = 6;
67
static
const
u32
NB_VERTICES_PER_QUAD = 4;
68
69
EBillboardType
m_billboardType;
70
ETransparentType m_transparentType;
71
72
public
:
73
CCPURenderer
();
74
75
virtual
~CCPURenderer
();
76
78
virtual
void
getParticleBuffer
(
IMeshBuffer
* buffer);
79
81
virtual
void
updateParticleBuffer
(
IMeshBuffer
* buffer,
CParticle
* particles,
int
num);
82
83
virtual
CObjectSerializable
*
createSerializable
();
84
85
virtual
void
loadSerializable
(
CObjectSerializable
*
object
);
86
88
inline
EBillboardType
getBillboardType
()
89
{
90
return
m_billboardType;
91
}
92
94
inline
void
setBillboardType
(
EBillboardType
type)
95
{
96
m_billboardType = type;
97
}
98
99
DECLARE_GETTYPENAME(
CCPURenderer
)
100
};
101
}
102
}
Skylicht::CObjectSerializable
Definition
CObjectSerializable.h:36
Skylicht::Particle::CCPURenderer
A non-instanced renderer that builds the particle vertex buffer on the CPU every frame.
Definition
CCPURenderer.h:41
Skylicht::Particle::CCPURenderer::updateParticleBuffer
virtual void updateParticleBuffer(IMeshBuffer *buffer, CParticle *particles, int num)
Rebuilds the entire vertex buffer on the CPU based on current particle positions.
Skylicht::Particle::CCPURenderer::EBillboardType
EBillboardType
Orientation modes for particles generated on CPU.
Definition
CCPURenderer.h:48
Skylicht::Particle::CCPURenderer::Billboard
@ Billboard
Definition
CCPURenderer.h:49
Skylicht::Particle::CCPURenderer::RotateY
@ RotateY
Definition
CCPURenderer.h:52
Skylicht::Particle::CCPURenderer::Velocity
@ Velocity
Definition
CCPURenderer.h:51
Skylicht::Particle::CCPURenderer::Frontal
@ Frontal
Definition
CCPURenderer.h:50
Skylicht::Particle::CCPURenderer::setBillboardType
void setBillboardType(EBillboardType type)
Sets current billboarding mode.
Definition
CCPURenderer.h:94
Skylicht::Particle::CCPURenderer::getBillboardType
EBillboardType getBillboardType()
Gets current billboarding mode.
Definition
CCPURenderer.h:88
Skylicht::Particle::CCPURenderer::ETransparentType
ETransparentType
Blending modes.
Definition
CCPURenderer.h:60
Skylicht::Particle::CCPURenderer::Transparent
@ Transparent
Definition
CCPURenderer.h:62
Skylicht::Particle::CCPURenderer::Addtive
@ Addtive
Definition
CCPURenderer.h:61
Skylicht::Particle::CCPURenderer::createSerializable
virtual CObjectSerializable * createSerializable()
Creates a serializable object for property editing or saving.
Skylicht::Particle::CCPURenderer::loadSerializable
virtual void loadSerializable(CObjectSerializable *object)
Loads properties from a serializable object.
Skylicht::Particle::CCPURenderer::getParticleBuffer
virtual void getParticleBuffer(IMeshBuffer *buffer)
Prepares the mesh buffer for CPU updates.
Skylicht::Particle::CParticle
Individual particle data structure.
Definition
CParticle.h:65
irr::scene::IMeshBuffer
Struct for holding a mesh with a single material.
Definition
IMeshBuffer.h:42
Skylicht::Particle::EBillboardType
EBillboardType
Billboard orientation modes for quad particles.
Definition
CQuadRenderer.h:39
Skylicht
Everything in the Skylicht Engine. You can start by looking at the topics.
Definition
AudioDebugLog.h:29
irr::u32
unsigned int u32
32 bit unsigned variable.
Definition
irrTypes.h:58
Generated by
1.17.0