16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-07-19 14:39:18 +02:00
This commit is contained in:
VB
2017-03-03 13:12:00 +01:00
22 changed files with 564 additions and 512 deletions

View File

@@ -23,8 +23,8 @@ opengl_renderer::Init() {
light.id = GL_LIGHT1 + idx;
light.position[ 3 ] = 1.0f;
::glLightf( light.id, GL_SPOT_CUTOFF, 20.0f );
::glLightf( light.id, GL_SPOT_EXPONENT, 10.0f );
::glLightf( light.id, GL_SPOT_CUTOFF, 7.5f );
::glLightf( light.id, GL_SPOT_EXPONENT, 7.5f );
::glLightf( light.id, GL_CONSTANT_ATTENUATION, 0.0f );
::glLightf( light.id, GL_LINEAR_ATTENUATION, 0.035f );
@@ -66,7 +66,7 @@ opengl_renderer::Update_Lights( light_array const &Lights ) {
renderlight->ambient[ 1 ] = scenelight.color.y * scenelight.intensity;
renderlight->ambient[ 2 ] = scenelight.color.z * scenelight.intensity;
::glLightf( renderlight->id, GL_LINEAR_ATTENUATION, 0.3f / std::pow( scenelight.count, 2 ) );
::glLightf( renderlight->id, GL_LINEAR_ATTENUATION, (0.25f * scenelight.count) / std::pow( scenelight.count, 2 ) );
::glEnable( renderlight->id );
renderlight->apply_intensity();
@@ -85,9 +85,9 @@ opengl_renderer::Update_Lights( light_array const &Lights ) {
void
opengl_renderer::Disable_Lights() {
for( int idx = 0; idx < m_lights.size() + 1; ++idx ) {
for( size_t idx = 0; idx < m_lights.size() + 1; ++idx ) {
::glDisable( GL_LIGHT0 + idx );
::glDisable( GL_LIGHT0 + (int)idx );
}
}
//---------------------------------------------------------------------------