jak-project/game/graphics/opengl_renderer/SkyRenderer.h
water111 72c27a6eaa
[jak2] More texture animations (#2831)
Added framework to do texture animations entirely in C++. Currently only
works on relatively simple ones, and doesn't handle updating all
parameters - only the speeds.

Connected texture animations to merc and tfrag for skull gems, dark
bomb, and scrolling conveyors.

Cleaned up Tfragment/Tfrag3, which used to be two classes. This was one
of the first C++ renderers, so it had a weird design.
2023-07-16 13:02:53 -04:00

51 lines
1.6 KiB
C++

#pragma once
#include "game/graphics//opengl_renderer/SkyBlendCPU.h"
#include "game/graphics//opengl_renderer/SkyBlendGPU.h"
#include "game/graphics/opengl_renderer/BucketRenderer.h"
#include "game/graphics/opengl_renderer/DirectRenderer.h"
#include "game/graphics/opengl_renderer/background/TFragment.h"
/*!
* Handles texture blending for the sky.
* Will insert the result texture into the texture pool.
*/
class SkyBlendHandler : public BucketRenderer {
public:
SkyBlendHandler(const std::string& name,
int my_id,
int level_id,
std::shared_ptr<SkyBlendGPU> shared_gpu_blender,
std::shared_ptr<SkyBlendCPU> shared_cpu_blender,
const std::vector<GLuint>* anim_slots);
void render(DmaFollower& dma, SharedRenderState* render_state, ScopedProfilerNode& prof) override;
void draw_debug_window() override;
void init_shaders(ShaderLibrary& shaders) override;
private:
void handle_sky_copies(DmaFollower& dma,
SharedRenderState* render_state,
ScopedProfilerNode& prof);
std::shared_ptr<SkyBlendGPU> m_shared_gpu_blender;
std::shared_ptr<SkyBlendCPU> m_shared_cpu_blender;
SkyBlendStats m_gpu_stats;
TFragment m_tfrag_renderer;
};
/*!
* Handles sky drawing.
*/
class SkyRenderer : public BucketRenderer {
public:
SkyRenderer(const std::string& name, int my_id);
void render(DmaFollower& dma, SharedRenderState* render_state, ScopedProfilerNode& prof) override;
void draw_debug_window() override;
private:
DirectRenderer m_direct_renderer;
struct FrameStats {
int gif_packets = 0;
} m_frame_stats;
};