diff options
author | Dave Parks <davep@lindenlab.com> | 2022-05-04 16:07:50 +0000 |
---|---|---|
committer | Dave Parks <davep@lindenlab.com> | 2022-05-04 16:07:50 +0000 |
commit | 93260cfeff2382dd1ffeecaef208d37bf21c2a01 (patch) | |
tree | a51461dd9f27c27931e2feb288920f7feff71480 /indra/llrender/llcubemap.cpp | |
parent | 82311e4b44a863078fb1f47d56e9543abaae210c (diff) |
SL-17283 LLReflectionMapManager prototype. Remove snapshot code related overhead from reflection map renders. Add parallax correction and support for multiple reflection maps.
Diffstat (limited to 'indra/llrender/llcubemap.cpp')
-rw-r--r-- | indra/llrender/llcubemap.cpp | 26 |
1 files changed, 26 insertions, 0 deletions
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<LLPointer<LLImageRaw> >& 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<LLPointer<LLImageRaw> >& rawimages) { llassert(rawimages.size() == 6); @@ -203,6 +216,19 @@ void LLCubeMap::initEnvironmentMap(const std::vector<LLPointer<LLImageRaw> >& 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(); |