Minor - Rework skysphere from Object to Entity - V14.2.0
Introduces a skysphere entity to the scene. Creates the skysphere during application initialization and manages its visibility via Z-buffer enabling/disabling in the render system. The skysphere is now an ECS entity. The culling thread skips the skybox entity to avoid unnecessary calculations since it's always visible. The position of the skybox is updated with the active camera.
This commit is contained in:
@@ -450,6 +450,8 @@ public:
|
||||
* @return A reference to the global model cache as a map of strings to shared pointers of model_class.
|
||||
*/
|
||||
std::map<std::string, std::shared_ptr<model_class>>& get_model_cache() { return g_model_cache; }
|
||||
|
||||
int get_sky_id() const { return sky_id_; }
|
||||
|
||||
private:
|
||||
/**
|
||||
@@ -530,6 +532,11 @@ private:
|
||||
* The thread function for culling objects in the scene.
|
||||
*/
|
||||
void culling_thread_function();
|
||||
|
||||
/**
|
||||
* Create the skysphere entity.
|
||||
*/
|
||||
bool create_skysphere();
|
||||
|
||||
public :
|
||||
std::vector<ID3D11ShaderResourceView*> textures;
|
||||
@@ -587,7 +594,9 @@ private :
|
||||
float speed_ = 0.1f; // speed for the demo spinning object
|
||||
std::vector<object*> imported_object_;
|
||||
int object_id_ = 0;
|
||||
std::vector<object*> skybox_;
|
||||
//std::vector<object*> skybox_;
|
||||
int sky_id_ = -1;
|
||||
std::shared_ptr<ecs::Entity> sky_entity_;
|
||||
|
||||
// ----------------------------------- //
|
||||
// ------------- LIGHTS -------------- //
|
||||
|
||||
Reference in New Issue
Block a user