Skip to content

Commit da9d494

Browse files
TAA uses velocity only on h3d.scene.pbr.Renderer
1 parent 50d93d2 commit da9d494

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

hrt/prefab/rfx/TemporalFiltering.hx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -251,11 +251,13 @@ class TemporalFiltering extends hrt.prefab.rfx.RendererFX {
251251
s.VARIANCE_CLIPPING = varianceClipping;
252252
s.CATMULL_ROM = catmullRom;
253253
s.VARIANCE_CLIPPING = varianceClipping;
254-
if ( velocity ) {
254+
var pbrRenderer = Std.downcast(r, h3d.scene.pbr.Renderer);
255+
var useVelocity = velocity && pbrRenderer != null;
256+
if ( useVelocity ) {
255257
s.velocityBuffer = ctx.getGlobal("velocity");
256258
s.velocityBuffer.filter = Nearest;
257-
s.VELOCITY = velocity;
258259
}
260+
s.VELOCITY = useVelocity;
259261

260262
s.KEEP_SKY_ALPHA = keepSkyAlpha;
261263

0 commit comments

Comments
 (0)