chore: Multiply shadowres parameter by 1024

This commit is contained in:
Vsevolod Kremianskii 2021-02-15 19:43:58 +07:00
parent b757066244
commit d8479e7c94
2 changed files with 4 additions and 4 deletions

View file

@ -37,7 +37,7 @@ namespace reone {
static const char kConfigFilename[] = "reone.cfg";
static constexpr int kDefaultShadowResolution = 2048;
static constexpr int kDefaultShadowResolution = 2;
static constexpr int kDefaultMusicVolume = 85;
static constexpr int kDefaultVoiceVolume = 85;
static constexpr int kDefaultSoundVolume = 85;

View file

@ -114,7 +114,7 @@ void WorldRenderPipeline::init() {
_shadowsDepth = make_unique<Texture>("shadows_depth", getTextureProperties(TextureUsage::CubeMapDepthBuffer));
_shadowsDepth->init();
_shadowsDepth->bind();
_shadowsDepth->clearPixels(_opts.shadowResolution, _opts.shadowResolution, PixelFormat::Depth);
_shadowsDepth->clearPixels(1024 * _opts.shadowResolution, 1024 * _opts.shadowResolution, PixelFormat::Depth);
_shadows.init();
_shadows.bind();
@ -131,9 +131,9 @@ void WorldRenderPipeline::render() {
}
void WorldRenderPipeline::drawShadows() {
if (!_scene->isShadowLightPresent()) return;
if (!_scene->isShadowLightPresent() || _opts.shadowResolution < 1) return;
withViewport(glm::ivec4(0, 0, _opts.shadowResolution, _opts.shadowResolution), [this]() {
withViewport(glm::ivec4(0, 0, 1024 * _opts.shadowResolution, 1024 * _opts.shadowResolution), [this]() {
_shadows.bind();
glDrawBuffer(GL_NONE);