mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-07-22 16:19:19 +02:00
files missing from previous commit
This commit is contained in:
12
renderer.cpp
12
renderer.cpp
@@ -827,6 +827,12 @@ opengl_renderer::setup_pass( renderpass_config &Config, rendermode const Mode, f
|
|||||||
std::max( 1.f, (float)Global.iWindowWidth ) / std::max( 1.f, (float)Global.iWindowHeight ),
|
std::max( 1.f, (float)Global.iWindowWidth ) / std::max( 1.f, (float)Global.iWindowHeight ),
|
||||||
znear,
|
znear,
|
||||||
zfar );
|
zfar );
|
||||||
|
/*
|
||||||
|
m_sunandviewangle =
|
||||||
|
glm::dot(
|
||||||
|
m_sunlight.direction,
|
||||||
|
glm::vec3( 0.f, 0.f, -1.f ) * glm::mat3( viewmatrix ) );
|
||||||
|
*/
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case rendermode::shadows: {
|
case rendermode::shadows: {
|
||||||
@@ -2965,7 +2971,7 @@ opengl_renderer::Render_Alpha( TTraction *Traction ) {
|
|||||||
::glColor4fv(
|
::glColor4fv(
|
||||||
glm::value_ptr(
|
glm::value_ptr(
|
||||||
glm::vec4{
|
glm::vec4{
|
||||||
Traction->wire_color(),
|
Traction->wire_color() /* * ( DebugModeFlag ? 1.f : clamp( m_sunandviewangle, 0.25f, 1.f ) ) */,
|
||||||
linealpha } ) );
|
linealpha } ) );
|
||||||
// render
|
// render
|
||||||
m_geometry.draw( Traction->m_geometry );
|
m_geometry.draw( Traction->m_geometry );
|
||||||
@@ -3422,7 +3428,7 @@ opengl_renderer::Update_Pick_Control() {
|
|||||||
return control;
|
return control;
|
||||||
}
|
}
|
||||||
|
|
||||||
editor::basic_node const *
|
scene::basic_node const *
|
||||||
opengl_renderer::Update_Pick_Node() {
|
opengl_renderer::Update_Pick_Node() {
|
||||||
|
|
||||||
#ifdef EU07_USE_PICKING_FRAMEBUFFER
|
#ifdef EU07_USE_PICKING_FRAMEBUFFER
|
||||||
@@ -3457,7 +3463,7 @@ opengl_renderer::Update_Pick_Node() {
|
|||||||
unsigned char pickreadout[4];
|
unsigned char pickreadout[4];
|
||||||
::glReadPixels( pickbufferpos.x, pickbufferpos.y, 1, 1, GL_BGRA, GL_UNSIGNED_BYTE, pickreadout );
|
::glReadPixels( pickbufferpos.x, pickbufferpos.y, 1, 1, GL_BGRA, GL_UNSIGNED_BYTE, pickreadout );
|
||||||
auto const nodeindex = pick_index( glm::ivec3{ pickreadout[ 2 ], pickreadout[ 1 ], pickreadout[ 0 ] } );
|
auto const nodeindex = pick_index( glm::ivec3{ pickreadout[ 2 ], pickreadout[ 1 ], pickreadout[ 0 ] } );
|
||||||
editor::basic_node const *node { nullptr };
|
scene::basic_node const *node { nullptr };
|
||||||
if( ( nodeindex > 0 )
|
if( ( nodeindex > 0 )
|
||||||
&& ( nodeindex <= m_picksceneryitems.size() ) ) {
|
&& ( nodeindex <= m_picksceneryitems.size() ) ) {
|
||||||
node = m_picksceneryitems[ nodeindex - 1 ];
|
node = m_picksceneryitems[ nodeindex - 1 ];
|
||||||
|
|||||||
12
renderer.h
12
renderer.h
@@ -163,14 +163,14 @@ public:
|
|||||||
// utility methods
|
// utility methods
|
||||||
TSubModel const *
|
TSubModel const *
|
||||||
Pick_Control() const { return m_pickcontrolitem; }
|
Pick_Control() const { return m_pickcontrolitem; }
|
||||||
editor::basic_node const *
|
scene::basic_node const *
|
||||||
Pick_Node() const { return m_picksceneryitem; }
|
Pick_Node() const { return m_picksceneryitem; }
|
||||||
// maintenance methods
|
// maintenance methods
|
||||||
void
|
void
|
||||||
Update( double const Deltatime );
|
Update( double const Deltatime );
|
||||||
TSubModel const *
|
TSubModel const *
|
||||||
Update_Pick_Control();
|
Update_Pick_Control();
|
||||||
editor::basic_node const *
|
scene::basic_node const *
|
||||||
Update_Pick_Node();
|
Update_Pick_Node();
|
||||||
// debug methods
|
// debug methods
|
||||||
std::string const &
|
std::string const &
|
||||||
@@ -320,7 +320,9 @@ private:
|
|||||||
texture_manager m_textures;
|
texture_manager m_textures;
|
||||||
opengl_light m_sunlight;
|
opengl_light m_sunlight;
|
||||||
opengllight_array m_lights;
|
opengllight_array m_lights;
|
||||||
|
/*
|
||||||
|
float m_sunandviewangle; // cached dot product of sunlight and camera vectors
|
||||||
|
*/
|
||||||
gfx::geometry_handle m_billboardgeometry { 0, 0 };
|
gfx::geometry_handle m_billboardgeometry { 0, 0 };
|
||||||
texture_handle m_glaretexture { -1 };
|
texture_handle m_glaretexture { -1 };
|
||||||
texture_handle m_suntexture { -1 };
|
texture_handle m_suntexture { -1 };
|
||||||
@@ -386,8 +388,8 @@ private:
|
|||||||
renderpass_config m_cabshadowpass; // parameters of most recent cab shadowmap pass
|
renderpass_config m_cabshadowpass; // parameters of most recent cab shadowmap pass
|
||||||
std::vector<TSubModel const *> m_pickcontrolsitems;
|
std::vector<TSubModel const *> m_pickcontrolsitems;
|
||||||
TSubModel const *m_pickcontrolitem { nullptr };
|
TSubModel const *m_pickcontrolitem { nullptr };
|
||||||
std::vector<editor::basic_node const *> m_picksceneryitems;
|
std::vector<scene::basic_node const *> m_picksceneryitems;
|
||||||
editor::basic_node const *m_picksceneryitem { nullptr };
|
scene::basic_node const *m_picksceneryitem { nullptr };
|
||||||
#ifdef EU07_USE_DEBUG_CAMERA
|
#ifdef EU07_USE_DEBUG_CAMERA
|
||||||
renderpass_config m_worldcamera; // debug item
|
renderpass_config m_worldcamera; // debug item
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user