mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-07-21 19:29:19 +02:00
build 170424. basic shadow mapping implementation, multi texturing unit setup
This commit is contained in:
41
renderer.h
41
renderer.h
@@ -159,7 +159,7 @@ public:
|
||||
TGroundNode const *
|
||||
Update_Pick_Node();
|
||||
// debug performance string
|
||||
std::string const &
|
||||
std::string
|
||||
Info() const;
|
||||
|
||||
// members
|
||||
@@ -169,6 +169,7 @@ public:
|
||||
private:
|
||||
// types
|
||||
enum class rendermode {
|
||||
none,
|
||||
color,
|
||||
shadows,
|
||||
pickcontrols,
|
||||
@@ -194,12 +195,30 @@ private:
|
||||
Render_pass( rendermode const Mode );
|
||||
// configures projection matrix for the current render pass
|
||||
void
|
||||
Render_projection();
|
||||
setup_projection();
|
||||
void
|
||||
setup_projection_world();
|
||||
void
|
||||
setup_projection_light_ortho();
|
||||
void
|
||||
setup_projection_light_perspective();
|
||||
// configures camera for the current render pass
|
||||
void
|
||||
Render_camera();
|
||||
setup_camera();
|
||||
void
|
||||
Render_setup( bool const Alpha = false );
|
||||
setup_camera_world( glm::dmat4 &Viewmatrix );
|
||||
void
|
||||
setup_camera_light_ortho( glm::dmat4 &Viewmatrix );
|
||||
void
|
||||
setup_camera_light_perspective( glm::dmat4 &Viewmatrix );
|
||||
void
|
||||
setup_drawing( bool const Alpha = false );
|
||||
void
|
||||
setup_units( bool const Diffuse, bool const Shadows, bool const Reflections );
|
||||
void
|
||||
setup_shadow_color( glm::vec4 const &Shadowcolor );
|
||||
void
|
||||
toggle_units( bool const Diffuse, bool const Shadows, bool const Reflections );
|
||||
bool
|
||||
Render( world_environment *Environment );
|
||||
bool
|
||||
@@ -213,7 +232,7 @@ private:
|
||||
bool
|
||||
Render( TDynamicObject *Dynamic );
|
||||
bool
|
||||
Render( TModel3d *Model, material_data const *Material, Math3D::vector3 const &Position, Math3D::vector3 const &Angle );
|
||||
Render( TModel3d *Model, material_data const *Material, double const Squaredistance, Math3D::vector3 const &Position, Math3D::vector3 const &Angle );
|
||||
bool
|
||||
Render( TModel3d *Model, material_data const *Material, double const Squaredistance );
|
||||
void
|
||||
@@ -233,7 +252,7 @@ private:
|
||||
bool
|
||||
Render_Alpha( TDynamicObject *Dynamic );
|
||||
bool
|
||||
Render_Alpha( TModel3d *Model, material_data const *Material, Math3D::vector3 const &Position, Math3D::vector3 const &Angle );
|
||||
Render_Alpha( TModel3d *Model, material_data const *Material, double const Squaredistance, Math3D::vector3 const &Position, Math3D::vector3 const &Angle );
|
||||
bool
|
||||
Render_Alpha( TModel3d *Model, material_data const *Material, double const Squaredistance );
|
||||
void
|
||||
@@ -257,13 +276,19 @@ private:
|
||||
#endif
|
||||
GLuint m_shadowframebuffer { 0 };
|
||||
GLuint m_shadowtexture { 0 };
|
||||
int m_shadowbuffersize { 2048 };
|
||||
int m_shadowbuffersize { 4096 };
|
||||
glm::mat4 m_shadowtexturematrix;
|
||||
glm::vec4 m_shadowcolor{ 0.5f, 0.5f, 0.5f, 1.f };
|
||||
GLUquadricObj *m_quadric { nullptr }; // helper object for drawing debug mode scene elements
|
||||
int m_shadowtextureunit { GL_TEXTURE1 };
|
||||
int m_helpertextureunit { GL_TEXTURE0 };
|
||||
int m_diffusetextureunit { GL_TEXTURE2 };
|
||||
|
||||
geometry_handle m_billboardgeometry { 0, 0 };
|
||||
texture_handle m_glaretexture { -1 };
|
||||
texture_handle m_suntexture { -1 };
|
||||
texture_handle m_moontexture { -1 };
|
||||
texture_handle m_reflectiontexture { -1 };
|
||||
|
||||
float m_drawtime { 1000.0f / 30.0f * 20.0f }; // start with presumed 'neutral' average of 30 fps
|
||||
double m_updateaccumulator { 0.0 };
|
||||
@@ -274,9 +299,7 @@ private:
|
||||
float m_speculartranslucentscalefactor { 1.0f };
|
||||
|
||||
bool m_framebuffersupport { false };
|
||||
rendermode m_texenvmode { rendermode::color }; // last configured texture environment
|
||||
renderpass_config m_renderpass;
|
||||
// std::stack<renderpass_config> m_renderpasses;
|
||||
bool m_renderspecular { false }; // controls whether to include specular component in the calculations
|
||||
std::vector<TGroundNode const *> m_picksceneryitems;
|
||||
std::vector<TSubModel const *> m_pickcontrolsitems;
|
||||
|
||||
Reference in New Issue
Block a user