Faster
This commit is contained in:
@@ -35,10 +35,6 @@ class RenderPathDeferred {
|
||||
path.createRenderTarget(t);
|
||||
}
|
||||
|
||||
{
|
||||
path.createDepthBuffer("paintdb", "DEPTH16");
|
||||
}
|
||||
|
||||
{
|
||||
var t = new RenderTargetRaw();
|
||||
t.name = "texpaint_colorid";
|
||||
@@ -190,7 +186,7 @@ class RenderPathDeferred {
|
||||
lastY = mouse.y;
|
||||
|
||||
if (!UITrait.inst.dirty()) {
|
||||
if (mx != lastX || my != lastY || UITrait.inst.ddirty == 0) {
|
||||
if (mx != lastX || my != lastY || UITrait.inst.ddirty == 0 || mouse.locked) {
|
||||
UITrait.inst.ddirty--;
|
||||
path.setTarget("");
|
||||
path.bindTarget(taaFrame % 2 == 0 ? "taa" : "taa2", "tex");
|
||||
@@ -422,7 +418,7 @@ class RenderPathDeferred {
|
||||
#if ((rp_ssgi == "RTGI") || (rp_ssgi == "RTAO"))
|
||||
{
|
||||
var ssgi = armory.data.Config.raw.rp_ssgi != false && UITrait.inst.cameraType == 0;
|
||||
if (ssgi) {
|
||||
if (ssgi && UITrait.inst.ddirty > 0) {
|
||||
path.setTarget("singlea");
|
||||
path.bindTarget("_main", "gbufferD");
|
||||
path.bindTarget("gbuffer0", "gbuffer0");
|
||||
@@ -448,7 +444,7 @@ class RenderPathDeferred {
|
||||
#if rp_voxelao
|
||||
if (armory.data.Config.raw.rp_gi != false)
|
||||
{
|
||||
var voxelize = path.voxelize();
|
||||
var voxelize = path.voxelize() && UITrait.inst.ddirty > 0;
|
||||
|
||||
#if arm_voxelgi_temporal
|
||||
voxelize = ++RenderPathCreator.voxelFrame % RenderPathCreator.voxelFreq == 0;
|
||||
|
||||
@@ -13,18 +13,12 @@ class RenderPathPaint {
|
||||
|
||||
var path = RenderPathDeferred.path;
|
||||
var tid = UITrait.inst.selectedLayer.id;
|
||||
|
||||
if (UITrait.inst.depthDirty()) {
|
||||
path.setTarget("texpaint" + tid);
|
||||
path.clearTarget(null, 1.0);
|
||||
path.drawMeshes("depth");
|
||||
}
|
||||
|
||||
if (UITrait.inst.paintDirty()) {
|
||||
if (UITrait.inst.selectedTool == ToolParticle) {
|
||||
path.setTarget("texparticle");
|
||||
path.clearTarget(0x00000000);
|
||||
path.bindTarget("_paintdb", "paintdb");
|
||||
path.bindTarget("_main", "gbufferD");
|
||||
|
||||
var mo:iron.object.MeshObject = cast iron.Scene.active.getChild(".ParticleEmitter");
|
||||
mo.visible = true;
|
||||
@@ -104,14 +98,6 @@ class RenderPathPaint {
|
||||
path.generateMipmaps("voxels");
|
||||
}
|
||||
|
||||
//
|
||||
#if (!kha_opengl)
|
||||
path.setDepthFrom("bufa", "texpaint" + tid); // Unbind depth so we can read it
|
||||
path.setDepthFrom("texpaint" + tid, "texpaint_nor" + tid);
|
||||
path.depthToRenderTarget.set("paintdb", path.renderTargets.get("bufa"));
|
||||
#end
|
||||
//
|
||||
|
||||
var blendA = "texpaint_blend0";
|
||||
var blendB = "texpaint_blend1";
|
||||
path.setTarget(blendB);
|
||||
@@ -120,7 +106,7 @@ class RenderPathPaint {
|
||||
var isMask = UITrait.inst.selectedLayerIsMask;
|
||||
var texpaint = isMask ? "texpaint_mask" + tid : "texpaint" + tid;
|
||||
path.setTarget(texpaint, ["texpaint_nor" + tid, "texpaint_pack" + tid, blendA]);
|
||||
path.bindTarget("_paintdb", "paintdb");
|
||||
path.bindTarget("_main", "gbufferD");
|
||||
path.bindTarget(blendB, "paintmask");
|
||||
if (UITrait.inst.selectedTool == ToolBake && UITrait.inst.bakeType == 0) { // AO
|
||||
path.bindTarget("voxels", "voxels");
|
||||
@@ -138,15 +124,6 @@ class RenderPathPaint {
|
||||
}
|
||||
|
||||
path.drawMeshes("paint");
|
||||
|
||||
//
|
||||
#if (!kha_opengl)
|
||||
path.setDepthFrom("texpaint" + tid, "bufa"); // Re-bind depth
|
||||
path.setDepthFrom("bufa", "texpaint_nor" + tid);
|
||||
var tid0 = UITrait.inst.layers[0].id;
|
||||
path.depthToRenderTarget.set("paintdb", path.renderTargets.get("texpaint" + tid0));
|
||||
#end
|
||||
//
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user