mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-07-19 04:19:19 +02:00
merge
This commit is contained in:
10
renderer.cpp
10
renderer.cpp
@@ -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 );
|
||||
}
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user