17 #ifndef PARTICLERENDERERITEM_H
18 #define PARTICLERENDERERITEM_H
23 #include "renderer/RenderNode.h"
25 struct ParticleRendererItemFboDesc;
26 class b2ParticleSystem;
151 constexpr
static const float NORMAL_ZOOM_FOV = 8.0f;
152 constexpr
static const int FBO_COUNT = 2;
155 void renderFboContents();
156 void renderParticleSystem(b2ParticleSystem* psystem,
float scale,
const QRectF& worldCullBounds,
157 b2AABB* worldUpdateRegion);
158 void createParticleShader();
159 static void checkExtensions();
161 float mZoomFactor = 0.0f;
162 float mAspectRatio = 1.0f;
163 bool mUpdateRegionEmpty =
false;
165 int mFboIds[FBO_COUNT];
166 int mFboTextureIds[FBO_COUNT];
176 static const ParticleRendererItemFboDesc FBO_DEFINITIONS[];
179 static bool sParticleRendererUseCombinedShader;
183 #endif // PARTICLERENDERERITEM_H
Callback set in a RenderNode which can be used to issues draw calls.
Definition: RenderableInterface.h:26
QPointF shadowOffset
Offset of the inner shadow in world coordinates.
Definition: ParticleRendererItem.h:70
QColor tintColor
Base color of the inner shadow effect, which tints colors beneath this effect.
Definition: ParticleRendererItem.h:66
Base class for visual elements which are part of the game scene, and are rendered through Renderer...
Definition: Graphic.h:34
Graphic which renders LiquidFun particles as blobs with a variety of effects.
Definition: ParticleRendererItem.h:112
float highlightAlpha
Transparency of the highlight effect.
Definition: ParticleRendererItem.h:62
float shadowAlpha
Transparency of the inner shadow effect.
Definition: ParticleRendererItem.h:74
float alpha
Overall transparency of the rendered effect.
Definition: ParticleRendererItem.h:47
virtual void synchronizeForRendering(RenderList *renderList) override
Synchronize and queue RenderNodes for rendering.
static const float PARTICLE_SCALE
Visual size of particles, relative to their physical size.
Definition: ParticleRendererItem.h:132
static constexpr const int FBO_SIZE
Width and height of the main frame buffer object used to render particles to.
Definition: ParticleRendererItem.h:118
QRectF updateRegion
Subsection of the frame buffer and viewport which needs to get rendered.
Definition: ParticleRendererItem.h:39
Structure holding the state for shaders used in ParticleRenderItem.
Definition: ParticleRendererItem.h:35
std::shared_ptr< Texture > TexturePtr
Shared pointer typedef for Texture.
Definition: PointerDeclarations.h:173
float aspectRatio
Aspect ratio of the viewport.
Definition: ParticleRendererItem.h:43
std::shared_ptr< Shader > ShaderPtr
Shared pointer typedef for Shader.
Definition: PointerDeclarations.h:143
static constexpr const int AUX_FBO_SIZE
Width and height of the secondary frame buffer object used to render fake specular lighting to...
Definition: ParticleRendererItem.h:123
Node which queues a callback (RenderableInterface) or MeshInstance for rendering. ...
Definition: RenderNode.h:33
float highlightWidth
Width of the highlight produced by the inner bevel effect.
Definition: ParticleRendererItem.h:58
File containing forward declarations for renderer types and smart pointers.
std::shared_ptr< MeshInstance > MeshInstancePtr
Shared pointer typedef for MeshInstance.
Definition: PointerDeclarations.h:113
List of RenderNodes, sorted by z-depth for rendering.
Definition: RenderList.h:36
float zoomFactor
Amount of zoom relative to a reference zoom amount.
Definition: ParticleRendererItem.h:51
virtual void render(RenderNode *node) override
Implementation of RenderableInterface blending our frame buffers onto the current scene...
TexturePtr texture
Texture referencing the main FBO.
Definition: ParticleRendererItem.h:82
QColor shadowColor
Color of the shadowed parts of the inner shadow effect.
Definition: ParticleRendererItem.h:78
TexturePtr specularTexture
Texture referencing the secondary FBO containing the fake specular lighting.
Definition: ParticleRendererItem.h:86