Skip to content

Commit

Permalink
postfx: use designated tmu for depth
Browse files Browse the repository at this point in the history
  • Loading branch information
qreeves committed Aug 19, 2024
1 parent afac236 commit 98fa4e3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions config/glsl/hud.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ hudglass = [
uniform vec3 glassfocuscoc, camera;
uniform mat4 linearworldmatrix;

@(gfetchdefs [refractdepth])
@(gfetchdefs tex7)
])

uniform float time;
Expand Down Expand Up @@ -337,7 +337,7 @@ hudglass = [
if(distance(curcoord, vec2(0, 0)) > maxsize) continue;

vec2 duv = guv + curcoord * glassdepth.xy + vec2(i * 0.5, j * 0.5);
float depth = dot(gfetch(refractdepth, duv).rgb, gdepthunpackparams);
float depth = dot(gfetch(tex7, duv).rgb, gdepthunpackparams);
vec3 pos = (linearworldmatrix * vec4(depth * texcoord0, depth, 1.0)).xyz;
float maxdist = distance(camera, pos);

Expand Down Expand Up @@ -568,7 +568,7 @@ shader $SHADER_DEFAULT "hudfocus" [
uniform vec2 focussize;
uniform vec3 focusparams;

@(gfetchdefs refractdepth)
@(gfetchdefs tex7)
@(ginterpdepth)

fragdata(0) vec4 fragcolor;
Expand All @@ -577,7 +577,7 @@ shader $SHADER_DEFAULT "hudfocus" [
{
if(focusparams.y > 0.0)
{
@(gdepthunpack curdepth [gfetch(refractdepth, focussize)])
@(gdepthunpack curdepth [gfetch(tex7, focussize)])
@(gdepthunpack prvdepth [texture2D(tex0, vec2(0.5))])

if(curdepth != prvdepth)
Expand Down
2 changes: 1 addition & 1 deletion src/engine/renderfx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1010,7 +1010,7 @@ bool VisorSurface::render(int w, int h, GLenum f, GLenum t, int count)


// final operations on the viewport before overlaying the UI/visor elements
bindtex(DEPTH, TEX_REFRACT_DEPTH);
bindtex(DEPTH, DEPTH);

if(wantblur || !hasglass())
{
Expand Down

0 comments on commit 98fa4e3

Please sign in to comment.