Expose render target depth via uniform link

This commit is contained in:
luboslenco 2020-08-28 17:34:22 +02:00
parent a576872c72
commit 401ad3a69d

View file

@ -4,6 +4,7 @@ import iron.Scene;
import iron.object.Object;
import iron.data.MaterialData;
import iron.math.Vec4;
using StringTools;
// Structure for setting shader uniforms
class Uniforms {
@ -25,7 +26,7 @@ class Uniforms {
return armory.data.ConstData.ltcMagTex;
}
#end
var target = iron.RenderPath.active.renderTargets.get(link);
var target = iron.RenderPath.active.renderTargets.get(link.endsWith("_depth") ? link.substr(0, link.length - 6) : link);
return target != null ? target.image : null;
}