mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-08 12:31:51 +00:00
move sky sprites to environment
This commit is contained in:
parent
28b7713648
commit
4aaa5b2d7e
4 changed files with 70 additions and 44 deletions
|
|
@ -10,7 +10,6 @@
|
|||
#include "typedefs.hpp"
|
||||
#include "world/Environment.hpp"
|
||||
|
||||
|
||||
template <typename VertexStructure>
|
||||
class Mesh;
|
||||
class Shader;
|
||||
|
|
@ -28,14 +27,6 @@ struct SkyboxVertex {
|
|||
{VertexAttribute::Type::FLOAT, false, 2}, {{}, 0}};
|
||||
};
|
||||
|
||||
struct SkySprite {
|
||||
std::string texture;
|
||||
float phase;
|
||||
float distance;
|
||||
bool emissive;
|
||||
float altitude;
|
||||
};
|
||||
|
||||
class Skybox {
|
||||
SkyMode mode = SkyMode::SOLID;
|
||||
uint size;
|
||||
|
|
@ -47,7 +38,6 @@ class Skybox {
|
|||
|
||||
std::unique_ptr<Mesh<SkyboxVertex>> mesh;
|
||||
std::unique_ptr<Batch3D> batch3d;
|
||||
std::vector<SkySprite> sprites;
|
||||
int frameid = 0;
|
||||
|
||||
float prevMie = -1.0f;
|
||||
|
|
@ -58,7 +48,12 @@ class Skybox {
|
|||
|
||||
void drawStars(float angle, float opacity);
|
||||
void drawBackground(const Camera& camera, int width, int height);
|
||||
void drawSkySprites(float daytime, float angle, float opacity);
|
||||
void drawSkySprites(
|
||||
float daytime,
|
||||
float angle,
|
||||
float opacity,
|
||||
const std::vector<SkySprite>& sprites
|
||||
);
|
||||
void refreshFace(uint face, Cubemap& cubemap);
|
||||
public:
|
||||
Skybox(uint size, const Assets& assets);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue