From 4bd2b8b98ba1c562dfd65975a87ef5ee3db35633 Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Fri, 7 Sep 2018 17:24:29 +0100 Subject: Fix createDensityProfileLayer dropping passed in values. Enable sky density panel to update advanced atmo precomputed textures. Take wild stab at appropriate ranges for density parameters in edit panel UI. Clean up debug-only code that isn't necessary anymore. Point autobuild at latest version of libatmosphere package. --- indra/llrender/llatmosphere.cpp | 36 +----------------------------------- 1 file changed, 1 insertion(+), 35 deletions(-) (limited to 'indra/llrender') 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; -- cgit v1.2.3