mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-07-22 01:19:19 +02:00
milek7/sim branch opengl 3.3 renderer import
This commit is contained in:
@@ -9,12 +9,12 @@ http://mozilla.org/MPL/2.0/.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "GL/glew.h"
|
||||
#include "renderer.h"
|
||||
#include "opengllight.h"
|
||||
#include "openglcamera.h"
|
||||
#include "openglparticles.h"
|
||||
#include "openglskydome.h"
|
||||
#include "openglprecipitation.h"
|
||||
#include "lightarray.h"
|
||||
#include "scene.h"
|
||||
#include "simulationenvironment.h"
|
||||
@@ -70,14 +70,24 @@ public:
|
||||
Bind_Material( material_handle const Material ) override;
|
||||
opengl_material const &
|
||||
Material( material_handle const Material ) const override;
|
||||
// shader methods
|
||||
auto Fetch_Shader( std::string const &name ) -> std::shared_ptr<gl::program> override;
|
||||
// texture methods
|
||||
texture_handle
|
||||
Fetch_Texture( std::string const &Filename, bool const Loadnow = true ) override;
|
||||
Fetch_Texture( std::string const &Filename, bool const Loadnow = true, GLint format_hint = GL_SRGB_ALPHA ) override;
|
||||
void
|
||||
Bind_Texture( texture_handle const Texture );
|
||||
Bind_Texture( texture_handle const Texture ) override;
|
||||
void
|
||||
Bind_Texture( std::size_t const Unit, texture_handle const Texture ) override;
|
||||
opengl_texture &
|
||||
Texture( texture_handle const Texture ) override;
|
||||
opengl_texture const &
|
||||
Texture( texture_handle const Texture ) const override;
|
||||
// utility methods
|
||||
void
|
||||
Pick_Control( std::function<void( TSubModel const * )> Callback ) override;
|
||||
void
|
||||
Pick_Node( std::function<void( scene::basic_node * )> Callback ) override;
|
||||
TSubModel const *
|
||||
Pick_Control() const override { return m_pickcontrolitem; }
|
||||
scene::basic_node const *
|
||||
@@ -87,9 +97,9 @@ public:
|
||||
// maintenance methods
|
||||
void
|
||||
Update( double const Deltatime ) override;
|
||||
TSubModel *
|
||||
void
|
||||
Update_Pick_Control() override;
|
||||
scene::basic_node *
|
||||
void
|
||||
Update_Pick_Node() override;
|
||||
glm::dvec3
|
||||
Update_Mouse_Position() override;
|
||||
@@ -249,6 +259,7 @@ private:
|
||||
opengl_light m_sunlight;
|
||||
opengllight_array m_lights;
|
||||
opengl_skydome m_skydomerenderer;
|
||||
opengl_precipitation m_precipitationrenderer;
|
||||
opengl_particles m_particlerenderer; // particle visualization subsystem
|
||||
/*
|
||||
float m_sunandviewangle; // cached dot product of sunlight and camera vectors
|
||||
@@ -288,7 +299,7 @@ private:
|
||||
GLuint m_environmentdepthbuffer { 0 };
|
||||
bool m_environmentcubetexturesupport { false }; // indicates whether we can use the dynamic environment cube map
|
||||
int m_environmentcubetextureface { 0 }; // helper, currently processed cube map face
|
||||
int m_environmentupdatetime { 0 }; // time of the most recent environment map update
|
||||
double m_environmentupdatetime { 0.0 }; // time of the most recent environment map update
|
||||
glm::dvec3 m_environmentupdatelocation; // coordinates of most recent environment map update
|
||||
|
||||
int m_helpertextureunit { GL_TEXTURE0 };
|
||||
@@ -325,6 +336,8 @@ private:
|
||||
std::vector<scene::basic_node *> m_picksceneryitems;
|
||||
scene::basic_node *m_picksceneryitem { nullptr };
|
||||
glm::vec3 m_worldmousecoordinates { 0.f };
|
||||
std::vector<std::function<void( TSubModel const * )>> m_control_pick_requests;
|
||||
std::vector<std::function<void( scene::basic_node * )>> m_node_pick_requests;
|
||||
#ifdef EU07_USE_DEBUG_CAMERA
|
||||
renderpass_config m_worldcamera; // debug item
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user