-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathatmosphere_renderer.h
More file actions
47 lines (35 loc) · 1.19 KB
/
atmosphere_renderer.h
File metadata and controls
47 lines (35 loc) · 1.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#ifndef ATMOSPHERE_RENDERER_H
#define ATMOSPHERE_RENDERER_H
#include "renderer.h"
#include "tile_texture_manager.h"
class AtmosphereRenderer : public Renderer {
public:
explicit AtmosphereRenderer(float earthRadius);
~AtmosphereRenderer() override;
void initialize() override;
void render(const QMatrix4x4& projection, const QMatrix4x4& view, const QMatrix4x4& model) override;
protected:
void initShaders();
void initGeometry();
void initTextures(); // Добавляем метод для инициализации текстур
private:
QMatrix4x4 cloudRotationMatrix;
float rotationAngle = 0.0f;
void createSphere();
QVector3D sphericalToCartesian(float radius, float phi, float theta) const;
void update(float deltaTime);
float radius;
QOpenGLBuffer ibo{QOpenGLBuffer::IndexBuffer};
// Добавляем текстуру неба
std::unique_ptr<TileTextureManager> skyTexture;
struct Vertex {
QVector3D position;
QVector2D texCoord;
QVector3D normal;
};
QVector<Vertex> vertices;
QVector<GLuint> indices;
const int RINGS = 32;
const int SEGMENTS = 32;
};
#endif // ATMOSPHERE_RENDERER_H