From 93260cfeff2382dd1ffeecaef208d37bf21c2a01 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Wed, 4 May 2022 16:07:50 +0000 Subject: SL-17283 LLReflectionMapManager prototype. Remove snapshot code related overhead from reflection map renders. Add parallax correction and support for multiple reflection maps. --- indra/llrender/llcubemap.cpp | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'indra/llrender/llcubemap.cpp') diff --git a/indra/llrender/llcubemap.cpp b/indra/llrender/llcubemap.cpp index cc61158aa6..17a487b860 100644 --- a/indra/llrender/llcubemap.cpp +++ b/indra/llrender/llcubemap.cpp @@ -166,6 +166,19 @@ void LLCubeMap::init(const std::vector >& rawimages) } } +void LLCubeMap::initReflectionMap(U32 resolution, U32 components) +{ + U32 texname = 0; + + LLImageGL::generateTextures(1, &texname); + + mImages[0] = new LLImageGL(resolution, resolution, components, TRUE); + mImages[0]->setTexName(texname); + mImages[0]->setTarget(mTargets[0], LLTexUnit::TT_CUBE_MAP); + gGL.getTexUnit(0)->bindManual(LLTexUnit::TT_CUBE_MAP, texname); + mImages[0]->setAddressMode(LLTexUnit::TAM_CLAMP); +} + void LLCubeMap::initEnvironmentMap(const std::vector >& rawimages) { llassert(rawimages.size() == 6); @@ -203,6 +216,19 @@ void LLCubeMap::initEnvironmentMap(const std::vector >& ra disable(); } +void LLCubeMap::generateMipMaps() +{ + mImages[0]->setUseMipMaps(TRUE); + mImages[0]->setHasMipMaps(TRUE); + enableTexture(0); + bind(); + mImages[0]->setFilteringOption(LLTexUnit::TFO_ANISOTROPIC); + glEnable(GL_TEXTURE_CUBE_MAP_SEAMLESS); + glGenerateMipmap(GL_TEXTURE_CUBE_MAP); + gGL.getTexUnit(0)->disable(); + disable(); +} + GLuint LLCubeMap::getGLName() { return mImages[0]->getTexName(); -- cgit v1.2.3