|
@@ -18,7 +18,6 @@ class TemporalFilteringShader extends h3d.shader.ScreenShader {
|
|
@param var prevCamMat : Mat4;
|
|
@param var prevCamMat : Mat4;
|
|
@param var cameraInverseViewProj : Mat4;
|
|
@param var cameraInverseViewProj : Mat4;
|
|
|
|
|
|
- @const var PACKED_DEPTH : Bool;
|
|
|
|
@param var depthChannel : Channel;
|
|
@param var depthChannel : Channel;
|
|
@param var depthTexture : Sampler2D;
|
|
@param var depthTexture : Sampler2D;
|
|
|
|
|
|
@@ -71,7 +70,7 @@ class TemporalFilteringShader extends h3d.shader.ScreenShader {
|
|
var isSky : Bool;
|
|
var isSky : Bool;
|
|
|
|
|
|
function getPixelPosition( uv : Vec2 ) : Vec3 {
|
|
function getPixelPosition( uv : Vec2 ) : Vec3 {
|
|
- var d = PACKED_DEPTH ? unpack(depthTexture.get(uv)) : depthChannel.get(uv).r;
|
|
|
|
|
|
+ var d = depthChannel.get(uv).r;
|
|
var tmp = vec4(uvToScreen(uv), d, 1) * cameraInverseViewProj;
|
|
var tmp = vec4(uvToScreen(uv), d, 1) * cameraInverseViewProj;
|
|
tmp.xyz /= tmp.w;
|
|
tmp.xyz /= tmp.w;
|
|
isSky = d == 1.0;
|
|
isSky = d == 1.0;
|
|
@@ -172,21 +171,15 @@ class TemporalFiltering extends hrt.prefab.rfx.RendererFX {
|
|
s.prevFrame = prevFrame;
|
|
s.prevFrame = prevFrame;
|
|
s.amount = amount;
|
|
s.amount = amount;
|
|
|
|
|
|
- s.PACKED_DEPTH = depthMap.packed != null && depthMap.packed == true;
|
|
|
|
- if( s.PACKED_DEPTH ) {
|
|
|
|
- s.depthTexture = depthMap.texture;
|
|
|
|
- }
|
|
|
|
- else {
|
|
|
|
- s.depthChannel = depthMap.texture;
|
|
|
|
- s.depthChannelChannel = depthMap.channel == null ? hxsl.Channel.R : depthMap.channel;
|
|
|
|
- }
|
|
|
|
|
|
+ s.depthChannel = depthMap.texture;
|
|
|
|
+ s.depthChannelChannel = depthMap.channel == null ? hxsl.Channel.R : depthMap.channel;
|
|
|
|
|
|
s.resolution.set(output.width, output.height);
|
|
s.resolution.set(output.width, output.height);
|
|
s.VARIANCE_CLIPPING = varianceClipping;
|
|
s.VARIANCE_CLIPPING = varianceClipping;
|
|
s.YCOCG = ycocg;
|
|
s.YCOCG = ycocg;
|
|
s.UNJITTER = unjitter;
|
|
s.UNJITTER = unjitter;
|
|
|
|
|
|
- r.setTarget(output);
|
|
|
|
|
|
+ r.setTarget(output, ReadOnly);
|
|
pass.render();
|
|
pass.render();
|
|
|
|
|
|
h3d.pass.Copy.run(output, prevFrame);
|
|
h3d.pass.Copy.run(output, prevFrame);
|