diff options
Diffstat (limited to 'indra/llrender/llatmosphere.cpp')
-rw-r--r-- | indra/llrender/llatmosphere.cpp | 36 |
1 files changed, 1 insertions, 35 deletions
diff --git a/indra/llrender/llatmosphere.cpp b/indra/llrender/llatmosphere.cpp index aaa1ff65e1..12c6685354 100644 --- a/indra/llrender/llatmosphere.cpp +++ b/indra/llrender/llatmosphere.cpp @@ -232,26 +232,6 @@ LLAtmosphere::~LLAtmosphere() m_model = nullptr; } -#if DEBUG_ATMO_TEX_GEN -uint8_t* GetTexture2d(int width, int height, int components, GLuint texture) -{ - glActiveTextureARB(GL_TEXTURE0); - glBindTexture(GL_TEXTURE_2D, texture); - uint8_t* storage = (uint8_t*)malloc(width * height * components * sizeof(float)); - glGetTexImage(GL_TEXTURE_2D, 0, components == 3 ? GL_RGB : GL_RGBA, GL_FLOAT, storage); - return storage; -} - -uint8_t* GetTexture3d(int width, int height, int depth, int components, GLuint texture) -{ - glActiveTextureARB(GL_TEXTURE0); - glBindTexture(GL_TEXTURE_3D, texture); - uint8_t* storage = (uint8_t*)malloc(width * height * depth * components * sizeof(float)); - glGetTexImage(GL_TEXTURE_3D, 0, components == 3 ? GL_RGB : GL_RGBA, GL_FLOAT, storage); - return storage; -} -#endif - bool LLAtmosphere::configureAtmosphericModel(AtmosphericModelSettings& settings) { if ((m_model != nullptr) && (settings == m_settings)) @@ -271,8 +251,6 @@ bool LLAtmosphere::configureAtmosphericModel(AtmosphericModelSettings& settings) getIlluminance()->setTexName(0); // Init libatmosphere model - m_config.num_scattering_orders = 4; - m_model = new atmosphere::Model( m_config, m_wavelengths, @@ -303,19 +281,7 @@ bool LLAtmosphere::configureAtmosphericModel(AtmosphericModelSettings& settings) getScattering()->setTexName(m_textures.scattering_texture); getMieScattering()->setTexName(m_textures.single_mie_scattering_texture); getIlluminance()->setTexName(m_textures.illuminance_texture); - -#if DEBUG_ATMO_TEX_GEN - // for debug only... - U8* transmittance = GetTexture2d(m_config.transmittanceTextureWidth, m_config.transmittanceTextureHeight, 3, m_textures.transmittance_texture); - U8* scattering = GetTexture3d(m_config.scatteringTextureWidth, m_config.scatteringTextureHeight, m_config.scatteringTextureDepth, 3, m_textures.scattering_texture); - U8* single_mie_scattering = GetTexture3d(m_config.scatteringTextureWidth, m_config.scatteringTextureHeight, m_config.scatteringTextureDepth, 3, m_textures.single_mie_scattering_texture); - U8* illuminance = GetTexture2d(m_config.illuminanceTextureWidth, m_config.illuminanceTextureHeight, 3, m_textures.illuminance_texture); - free(transmittance); - free(scattering); - free(single_mie_scattering); - free(illuminance); -#endif - + m_settings = settings; } return m_model != nullptr; |