This commit is contained in:
yvt 2013-08-23 15:10:49 +09:00
parent 5f930ad285
commit 5da6bc6450
4 changed files with 15 additions and 1 deletions

View File

@ -42,5 +42,8 @@
* FXAA
* GUI fix
2013-08-23 yvt <i@yvt.jp>
* Support SRGB

View File

@ -52,6 +52,7 @@ SPADES_SETTING(r_optimizedVoxelModel, "1");
SPADES_SETTING(r_radiosity, "0");
SPADES_SETTING(r_fogShadow, "0");
SPADES_SETTING(r_fxaa, "1");
SPADES_SETTING(r_srgb, "1");
namespace spades {
@ -319,7 +320,8 @@ namespace spades {
device->Enable(IGLDevice::DepthTest, true);
device->Enable(IGLDevice::Texture2D, true);
if(r_srgb)
device->Enable(IGLDevice::FramebufferSRGB, false);
}
@ -489,6 +491,9 @@ namespace spades {
device->Enable(IGLDevice::Blend, true);
if(r_srgb)
device->Enable(IGLDevice::FramebufferSRGB, true);
device->DepthMask(false);
if(!r_softParticles){ // softparticle is a part of postprocess
device->BlendFunc(IGLDevice::One,
@ -536,6 +541,10 @@ namespace spades {
if(r_fxaa)
handle = GLFXAAFilter(this).Filter(handle);
if(r_srgb)
device->Enable(IGLDevice::FramebufferSRGB, false);
// copy buffer to WM given framebuffer
device->BindFramebuffer(IGLDevice::Framebuffer, 0);
device->Enable(IGLDevice::Blend, false);

View File

@ -35,6 +35,7 @@ namespace spades {
CullFace,
Blend,
Multisample,
FramebufferSRGB,
// Parameters
FramebufferBinding,

View File

@ -133,6 +133,7 @@ namespace spades {
case Blend: type = GL_BLEND; break;
case Texture2D: type = GL_TEXTURE_2D; break;
case Multisample: type = GL_MULTISAMPLE; break;
case FramebufferSRGB: type = GL_FRAMEBUFFER_SRGB; break;
default: SPInvalidEnum("state", state);
}
if(b)