- draw the colormap blend after postprocessing, not before it.
- added colormap shader to postprocessing. This replaces the in-place application of fullscreen colormaps if renderbuffers are active. This way the fully composed scene gets inverted, not each element on its own which is highly problematic for additively blended things.
This commit is contained in:
parent
7efae2c8f8
commit
589936f570
12 changed files with 218 additions and 47 deletions
|
|
@ -49,6 +49,7 @@
|
|||
#include "gl/renderer/gl_renderstate.h"
|
||||
#include "gl/renderer/gl_colormap.h"
|
||||
#include "gl/dynlights//gl_lightbuffer.h"
|
||||
#include "gl/renderer/gl_renderbuffers.h"
|
||||
|
||||
void gl_SetTextureMode(int type);
|
||||
|
||||
|
|
@ -220,15 +221,24 @@ bool FRenderState::ApplyShader()
|
|||
{
|
||||
activeShader->muFixedColormap.Set(0);
|
||||
}
|
||||
else if (mColormapState < CM_MAXCOLORMAP)
|
||||
else if (mColormapState > CM_DEFAULT && mColormapState < CM_MAXCOLORMAP)
|
||||
{
|
||||
FSpecialColormap *scm = &SpecialColormaps[gl_fixedcolormap - CM_FIRSTSPECIALCOLORMAP];
|
||||
float m[] = { scm->ColorizeEnd[0] - scm->ColorizeStart[0],
|
||||
scm->ColorizeEnd[1] - scm->ColorizeStart[1], scm->ColorizeEnd[2] - scm->ColorizeStart[2], 0.f };
|
||||
if (FGLRenderBuffers::IsEnabled())
|
||||
{
|
||||
// When using postprocessing to apply the colormap, we must render the image fullbright here.
|
||||
activeShader->muFixedColormap.Set(2);
|
||||
activeShader->muColormapStart.Set(1, 1, 1, 1.f);
|
||||
}
|
||||
else
|
||||
{
|
||||
FSpecialColormap *scm = &SpecialColormaps[gl_fixedcolormap - CM_FIRSTSPECIALCOLORMAP];
|
||||
float m[] = { scm->ColorizeEnd[0] - scm->ColorizeStart[0],
|
||||
scm->ColorizeEnd[1] - scm->ColorizeStart[1], scm->ColorizeEnd[2] - scm->ColorizeStart[2], 0.f };
|
||||
|
||||
activeShader->muFixedColormap.Set(1);
|
||||
activeShader->muColormapStart.Set(scm->ColorizeStart[0], scm->ColorizeStart[1], scm->ColorizeStart[2], 0.f);
|
||||
activeShader->muColormapRange.Set(m);
|
||||
activeShader->muFixedColormap.Set(1);
|
||||
activeShader->muColormapStart.Set(scm->ColorizeStart[0], scm->ColorizeStart[1], scm->ColorizeStart[2], 0.f);
|
||||
activeShader->muColormapRange.Set(m);
|
||||
}
|
||||
}
|
||||
else if (mColormapState == CM_FOGLAYER)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue