mirror of
https://github.com/blawar/GLideN64.git
synced 2024-07-07 03:13:49 +00:00
Implement gamma correction.
This commit is contained in:
parent
c079217715
commit
7a16fafedb
|
@ -446,6 +446,8 @@ ShaderCombiner::ShaderCombiner(Combiner & _color, Combiner & _alpha, const gDPCo
|
|||
#endif
|
||||
strFragmentShader.append(" if (uFogUsage == 1) \n");
|
||||
strFragmentShader.append(" fragColor = vec4(mix(fragColor.rgb, uFogColor.rgb, vFogFragCoord), fragColor.a); \n");
|
||||
strFragmentShader.append(" if (uGammaCorrectionEnabled != 0) \n");
|
||||
strFragmentShader.append(" fragColor = vec4(sqrt(fragColor.rgb), fragColor.a); \n");
|
||||
|
||||
strFragmentShader.append(fragment_shader_end);
|
||||
|
||||
|
@ -508,6 +510,7 @@ void ShaderCombiner::_locateUniforms() {
|
|||
LocateUniform(uAlphaCompareMode);
|
||||
LocateUniform(uAlphaDitherMode);
|
||||
LocateUniform(uColorDitherMode);
|
||||
LocateUniform(uGammaCorrectionEnabled);
|
||||
LocateUniform(uEnableLod);
|
||||
LocateUniform(uEnableAlphaTest);
|
||||
LocateUniform(uEnableDepth);
|
||||
|
@ -667,6 +670,7 @@ void ShaderCombiner::updateColors(bool _bForce)
|
|||
_setIUniform(m_uniforms.uAlphaCompareMode, gDP.otherMode.alphaCompare, _bForce);
|
||||
_setIUniform(m_uniforms.uAlphaDitherMode, gDP.otherMode.alphaDither, _bForce);
|
||||
_setIUniform(m_uniforms.uColorDitherMode, gDP.otherMode.colorDither, _bForce);
|
||||
_setIUniform(m_uniforms.uGammaCorrectionEnabled, *REG.VI_STATUS & 8, _bForce);
|
||||
|
||||
const int nDither = (gDP.otherMode.cycleType < G_CYC_COPY) && (gDP.otherMode.colorDither == G_CD_NOISE || gDP.otherMode.alphaDither == G_AD_NOISE || gDP.otherMode.alphaCompare == G_AC_DITHER) ? 1 : 0;
|
||||
if ((m_nInputs & (1<<NOISE)) + nDither != 0)
|
||||
|
|
|
@ -39,7 +39,7 @@ private:
|
|||
uEnableDepth, uEnableDepthCompare, uEnableDepthUpdate,
|
||||
uDepthMode, uFb8Bit, uFbFixedAlpha, uRenderState,
|
||||
uMaxTile, uTextureDetail, uTexturePersp,
|
||||
uAlphaCompareMode, uAlphaDitherMode, uColorDitherMode;
|
||||
uAlphaCompareMode, uAlphaDitherMode, uColorDitherMode, uGammaCorrectionEnabled;
|
||||
|
||||
fUniform uFogMultiplier, uFogOffset, uK4, uK5, uPrimLod, uNoiseTime, uScreenWidth, uScreenHeight,
|
||||
uLodXScale, uLodYScale, uMinLod, uDepthTrans, uDepthScale, uAlphaTestValue;
|
||||
|
|
|
@ -139,6 +139,7 @@ static const char* fragment_shader_header_common_variables =
|
|||
"uniform lowp int uAlphaCompareMode; \n"
|
||||
"uniform lowp int uAlphaDitherMode; \n"
|
||||
"uniform lowp int uColorDitherMode; \n"
|
||||
"uniform lowp int uGammaCorrectionEnabled; \n"
|
||||
"uniform lowp int uFogUsage; \n"
|
||||
"uniform lowp int uFb8Bit; \n"
|
||||
"uniform lowp int uFbFixedAlpha;\n"
|
||||
|
@ -165,6 +166,7 @@ static const char* fragment_shader_header_common_variables =
|
|||
"uniform int uAlphaCompareMode; \n"
|
||||
"uniform int uAlphaDitherMode; \n"
|
||||
"uniform int uColorDitherMode; \n"
|
||||
"uniform int uGammaCorrectionEnabled;\n"
|
||||
"uniform int uFogUsage; \n"
|
||||
"uniform int uFb8Bit; \n"
|
||||
"uniform int uFbFixedAlpha; \n"
|
||||
|
|
Loading…
Reference in New Issue
Block a user