fix critical damage effect when temporal upscaling was enabled.

This commit is contained in:
Xonk 2024-07-07 21:21:55 -04:00
parent 396c9edba7
commit cdd12d441e
4 changed files with 7 additions and 9 deletions

View File

@ -399,7 +399,7 @@ void main() {
//////////////////////////////// //////////////////////////////// //////////////////////////////// ////////////////////////////////
float textureLOD = bias(); float textureLOD = bias();
vec4 Albedo = texture2D_POMSwitch(texture, adjustedTexCoord.xy, vec4(dcdx,dcdy), ifPOM, textureLOD) * color; vec4 Albedo = texture2D_POMSwitch(texture, adjustedTexCoord.xy, vec4(dcdx,dcdy), ifPOM, textureLOD) * color;
#if defined HAND #if defined HAND
if (Albedo.a < 0.1) discard; if (Albedo.a < 0.1) discard;
#endif #endif
@ -553,7 +553,7 @@ void main() {
vec2 PackLightmaps = vec2(torchlightmap, lmtexcoord.w); vec2 PackLightmaps = vec2(torchlightmap, lmtexcoord.w);
vec4 data1 = clamp( encode(viewToWorld(normal), PackLightmaps), 0.0, 1.0); vec4 data1 = clamp( encode(viewToWorld(normal), PackLightmaps), 0.0, 1.0);
gl_FragData[0] = vec4(encodeVec2(Albedo.x,data1.x), encodeVec2(Albedo.y,data1.y), encodeVec2(Albedo.z,data1.z), encodeVec2(data1.w,Albedo.w)); gl_FragData[0] = vec4(encodeVec2(Albedo.x,data1.x), encodeVec2(Albedo.y,data1.y), encodeVec2(Albedo.z,data1.z), encodeVec2(data1.w,Albedo.w));
gl_FragData[2] = vec4(FlatNormals * 0.5 + 0.5, VanillaAO); gl_FragData[2] = vec4(FlatNormals * 0.5 + 0.5, VanillaAO);

View File

@ -41,11 +41,11 @@ const bool colortex15Clear = false;
#ifdef SCREENSHOT_MODE #ifdef SCREENSHOT_MODE
/* /*
const int colortex5Format = RGBA32F; //TAA buffer (everything) const int colortex5Format = RGBA32F;// TAA buffer (everything)
*/ */
#else #else
/* /*
const int colortex5Format = RGBA16F; //TAA buffer (everything) const int colortex5Format = R11F_G11F_B10F; // TAA buffer (everything)
*/ */
#endif #endif
@ -374,7 +374,7 @@ vec4 computeTAA(vec2 texcoord, bool hand){
#endif #endif
#ifdef DAMAGE_TAKEN_EFFECT #ifdef DAMAGE_TAKEN_EFFECT
// when this triggers, use current frame UV to sample history, for a funny trailing effect. // when this triggers, use current frame UV to sample history, for a funny trailing effect.
if(CriticalDamageTaken > 0.01) previousPosition.xy = adjTC; if(CriticalDamageTaken > 0.01) previousPosition.xy = texcoord;
#endif #endif
vec3 frameHistory = max(FastCatmulRom(colortex5, previousPosition.xy, vec4(texelSize, 1.0/texelSize), 0.75).xyz,0.0); vec3 frameHistory = max(FastCatmulRom(colortex5, previousPosition.xy, vec4(texelSize, 1.0/texelSize), 0.75).xyz,0.0);
@ -410,10 +410,7 @@ vec4 computeTAA(vec2 texcoord, bool hand){
void main() { void main() {
/* DRAWBUFFERS:5 */ /* DRAWBUFFERS:5 */
#ifdef TAA #ifdef TAA
vec2 taauTC = clamp(texcoord*RENDER_SCALE, vec2(0.0), RENDER_SCALE - texelSize*2.0); vec2 taauTC = clamp(texcoord*RENDER_SCALE, vec2(0.0), RENDER_SCALE - texelSize*2.0);
float dataUnpacked = decodeVec2(texelFetch2D(colortex1,ivec2(gl_FragCoord.xy*RENDER_SCALE),0).w).y; float dataUnpacked = decodeVec2(texelFetch2D(colortex1,ivec2(gl_FragCoord.xy*RENDER_SCALE),0).w).y;

View File

@ -3,6 +3,7 @@ const float LpvBlockBrightness = 1.0;
float lpvCurve(float values) { float lpvCurve(float values) {
// return values;
return pow(1.0 - sqrt(1.0-values), 2.0); return pow(1.0 - sqrt(1.0-values), 2.0);
} }

View File

@ -1,4 +1,4 @@
#define SHADER_VERSION_LABEL 478 // [478] #define SHADER_VERSION_LABEL 479 // [479]
#define saturate(x) clamp(x,0.0,1.0) #define saturate(x) clamp(x,0.0,1.0)