mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-19 20:23:54 +00:00
allow non-power-of-2 sized cubemaps
This commit is contained in:
parent
902862aa8b
commit
2b5f147545
1 changed files with 1 additions and 3 deletions
|
@ -683,9 +683,6 @@ namespace MWRender
|
||||||
else if (screenshotMapping == 2)
|
else if (screenshotMapping == 2)
|
||||||
screenshotH = screenshotW; // use square resolution for planet mapping
|
screenshotH = screenshotW; // use square resolution for planet mapping
|
||||||
|
|
||||||
if (!rawCubemap)
|
|
||||||
cubeSize = pow(2,round(log2(cubeSize))); // select closest power of 2 for GPU
|
|
||||||
|
|
||||||
std::vector<osg::ref_ptr<osg::Image>> images;
|
std::vector<osg::ref_ptr<osg::Image>> images;
|
||||||
|
|
||||||
for (int i = 0; i < 6; ++i)
|
for (int i = 0; i < 6; ++i)
|
||||||
|
@ -745,6 +742,7 @@ namespace MWRender
|
||||||
// run on GPU now:
|
// run on GPU now:
|
||||||
|
|
||||||
osg::ref_ptr<osg::TextureCubeMap> cubeTexture (new osg::TextureCubeMap);
|
osg::ref_ptr<osg::TextureCubeMap> cubeTexture (new osg::TextureCubeMap);
|
||||||
|
cubeTexture->setResizeNonPowerOfTwoHint(false);
|
||||||
|
|
||||||
cubeTexture->setWrap(osg::Texture::WRAP_S, osg::Texture::CLAMP_TO_EDGE);
|
cubeTexture->setWrap(osg::Texture::WRAP_S, osg::Texture::CLAMP_TO_EDGE);
|
||||||
cubeTexture->setWrap(osg::Texture::WRAP_T, osg::Texture::CLAMP_TO_EDGE);
|
cubeTexture->setWrap(osg::Texture::WRAP_T, osg::Texture::CLAMP_TO_EDGE);
|
||||||
|
|
Loading…
Reference in a new issue