forked from LeenkxTeam/LNXSDK
Update leenkx/Sources/leenkx/renderpath/RenderPathForward.hx
This commit is contained in:
@ -142,7 +142,7 @@ class RenderPathForward {
|
|||||||
t.width = 0;
|
t.width = 0;
|
||||||
t.height = 0;
|
t.height = 0;
|
||||||
t.displayp = Inc.getDisplayp();
|
t.displayp = Inc.getDisplayp();
|
||||||
t.format = "R32";
|
t.format = "DEPTH24";
|
||||||
t.scale = Inc.getSuperSampling();
|
t.scale = Inc.getSuperSampling();
|
||||||
path.createRenderTarget(t);
|
path.createRenderTarget(t);
|
||||||
|
|
||||||
@ -204,13 +204,6 @@ class RenderPathForward {
|
|||||||
Inc.initGI("voxelsSDF");
|
Inc.initGI("voxelsSDF");
|
||||||
Inc.initGI("voxelsSDFtmp");
|
Inc.initGI("voxelsSDFtmp");
|
||||||
#end
|
#end
|
||||||
#if (rp_voxels == "Voxel GI")
|
|
||||||
Inc.initGI("voxelsLight");
|
|
||||||
Inc.initGI("voxels_diffuse");
|
|
||||||
Inc.initGI("voxels_specular");
|
|
||||||
#else
|
|
||||||
Inc.initGI("voxels_ao");
|
|
||||||
#end
|
|
||||||
iron.RenderPath.clipmaps = new Array<Clipmap>();
|
iron.RenderPath.clipmaps = new Array<Clipmap>();
|
||||||
for (i in 0...Main.voxelgiClipmapCount) {
|
for (i in 0...Main.voxelgiClipmapCount) {
|
||||||
var clipmap = new iron.object.Clipmap();
|
var clipmap = new iron.object.Clipmap();
|
||||||
@ -257,18 +250,25 @@ class RenderPathForward {
|
|||||||
#end
|
#end
|
||||||
#end
|
#end
|
||||||
|
|
||||||
#if rp_volumetriclight
|
#if (rp_volumetriclight || rp_ssgi != "Off")
|
||||||
{
|
{
|
||||||
|
#if (rp_volumetriclight)
|
||||||
path.loadShader("shader_datas/volumetric_light/volumetric_light");
|
path.loadShader("shader_datas/volumetric_light/volumetric_light");
|
||||||
path.loadShader("shader_datas/blur_bilat_pass/blur_bilat_pass_x");
|
path.loadShader("shader_datas/blur_bilat_pass/blur_bilat_pass_x");
|
||||||
path.loadShader("shader_datas/blur_bilat_blend_pass/blur_bilat_blend_pass_y");
|
path.loadShader("shader_datas/blur_bilat_blend_pass/blur_bilat_blend_pass_y");
|
||||||
|
#end
|
||||||
|
|
||||||
|
|
||||||
var t = new RenderTargetRaw();
|
var t = new RenderTargetRaw();
|
||||||
t.name = "singlea";
|
t.name = "singlea";
|
||||||
t.width = 0;
|
t.width = 0;
|
||||||
t.height = 0;
|
t.height = 0;
|
||||||
t.displayp = Inc.getDisplayp();
|
t.displayp = Inc.getDisplayp();
|
||||||
|
#if (rp_ssgi == "SSGI")
|
||||||
|
t.format = "RGBA32";
|
||||||
|
#else
|
||||||
t.format = "R8";
|
t.format = "R8";
|
||||||
|
#end
|
||||||
t.scale = Inc.getSuperSampling();
|
t.scale = Inc.getSuperSampling();
|
||||||
path.createRenderTarget(t);
|
path.createRenderTarget(t);
|
||||||
|
|
||||||
@ -277,7 +277,11 @@ class RenderPathForward {
|
|||||||
t.width = 0;
|
t.width = 0;
|
||||||
t.height = 0;
|
t.height = 0;
|
||||||
t.displayp = Inc.getDisplayp();
|
t.displayp = Inc.getDisplayp();
|
||||||
|
#if (rp_ssgi == "SSGI")
|
||||||
|
t.format = "RGBA32";
|
||||||
|
#else
|
||||||
t.format = "R8";
|
t.format = "R8";
|
||||||
|
#end
|
||||||
t.scale = Inc.getSuperSampling();
|
t.scale = Inc.getSuperSampling();
|
||||||
path.createRenderTarget(t);
|
path.createRenderTarget(t);
|
||||||
}
|
}
|
||||||
@ -315,7 +319,6 @@ class RenderPathForward {
|
|||||||
path.createRenderTarget(t);
|
path.createRenderTarget(t);
|
||||||
}
|
}
|
||||||
#end
|
#end
|
||||||
|
|
||||||
#if rp_ssr
|
#if rp_ssr
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -374,9 +377,6 @@ class RenderPathForward {
|
|||||||
|
|
||||||
if (iron.RenderPath.pre_clear == true)
|
if (iron.RenderPath.pre_clear == true)
|
||||||
{
|
{
|
||||||
#if (rp_voxels == "Voxel GI")
|
|
||||||
path.clearImage("voxelsLight", 0x00000000);
|
|
||||||
#end
|
|
||||||
path.clearImage("voxels", 0x00000000);
|
path.clearImage("voxels", 0x00000000);
|
||||||
path.clearImage("voxelsOut", 0x00000000);
|
path.clearImage("voxelsOut", 0x00000000);
|
||||||
path.clearImage("voxelsOutB", 0x00000000);
|
path.clearImage("voxelsOutB", 0x00000000);
|
||||||
@ -388,9 +388,6 @@ class RenderPathForward {
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
#if (rp_voxels == "Voxel GI")
|
|
||||||
path.clearImage("voxelsLight", 0x00000000);
|
|
||||||
#end
|
|
||||||
path.clearImage("voxels", 0x00000000);
|
path.clearImage("voxels", 0x00000000);
|
||||||
Inc.computeVoxelsOffsetPrev();
|
Inc.computeVoxelsOffsetPrev();
|
||||||
}
|
}
|
||||||
@ -402,25 +399,11 @@ class RenderPathForward {
|
|||||||
path.bindTarget("voxels", "voxels");
|
path.bindTarget("voxels", "voxels");
|
||||||
path.drawMeshes("voxel");
|
path.drawMeshes("voxel");
|
||||||
|
|
||||||
#if (rp_voxels == "Voxel GI")
|
|
||||||
Inc.computeVoxelsLight();
|
|
||||||
#end
|
|
||||||
Inc.computeVoxelsTemporal();
|
Inc.computeVoxelsTemporal();
|
||||||
|
|
||||||
#if (lnx_voxelgi_shadows || (rp_voxels == "Voxel GI"))
|
#if (lnx_voxelgi_shadows || (rp_voxels == "Voxel GI"))
|
||||||
Inc.computeVoxelsSDF();
|
Inc.computeVoxelsSDF();
|
||||||
#end
|
#end
|
||||||
|
|
||||||
if (iron.RenderPath.res_pre_clear == true)
|
|
||||||
{
|
|
||||||
iron.RenderPath.res_pre_clear = false;
|
|
||||||
#if (rp_voxels == "Voxel GI")
|
|
||||||
path.clearImage("voxels_diffuse", 0x00000000);
|
|
||||||
path.clearImage("voxels_specular", 0x00000000);
|
|
||||||
#else
|
|
||||||
path.clearImage("voxels_ao", 0x00000000);
|
|
||||||
#end
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
#end
|
#end
|
||||||
|
|
||||||
@ -449,13 +432,6 @@ class RenderPathForward {
|
|||||||
}
|
}
|
||||||
#end
|
#end
|
||||||
|
|
||||||
#if rp_ssrefr
|
|
||||||
{
|
|
||||||
path.setTarget("gbuffer_refraction");
|
|
||||||
path.clearTarget(0xffffff00);
|
|
||||||
}
|
|
||||||
#end
|
|
||||||
|
|
||||||
RenderPathCreator.setTargetMeshes();
|
RenderPathCreator.setTargetMeshes();
|
||||||
|
|
||||||
#if rp_shadowmap
|
#if rp_shadowmap
|
||||||
@ -472,17 +448,8 @@ class RenderPathForward {
|
|||||||
#if (rp_voxels != "Off")
|
#if (rp_voxels != "Off")
|
||||||
if (leenkx.data.Config.raw.rp_gi != false)
|
if (leenkx.data.Config.raw.rp_gi != false)
|
||||||
{
|
{
|
||||||
#if (rp_voxels == "Voxel AO")
|
|
||||||
Inc.resolveAO();
|
|
||||||
path.bindTarget("voxels_ao", "voxels_ao");
|
|
||||||
#else
|
|
||||||
Inc.resolveDiffuse();
|
|
||||||
Inc.resolveSpecular();
|
|
||||||
path.bindTarget("voxels_diffuse", "voxels_diffuse");
|
|
||||||
path.bindTarget("voxels_specular", "voxels_specular");
|
|
||||||
#end
|
|
||||||
#if lnx_voxelgi_shadows
|
|
||||||
path.bindTarget("voxelsOut", "voxels");
|
path.bindTarget("voxelsOut", "voxels");
|
||||||
|
#if (lnx_voxelgi_shadows || rp_voxels == "Voxel GI")
|
||||||
path.bindTarget("voxelsSDF", "voxelsSDF");
|
path.bindTarget("voxelsSDF", "voxelsSDF");
|
||||||
#end
|
#end
|
||||||
}
|
}
|
||||||
@ -532,7 +499,6 @@ class RenderPathForward {
|
|||||||
}
|
}
|
||||||
#end
|
#end
|
||||||
|
|
||||||
|
|
||||||
#if (rp_voxels != "Off")
|
#if (rp_voxels != "Off")
|
||||||
path.bindTarget("voxelsOut", "voxels");
|
path.bindTarget("voxelsOut", "voxels");
|
||||||
path.bindTarget("voxelsSDF", "voxelsSDF");
|
path.bindTarget("voxelsSDF", "voxelsSDF");
|
||||||
@ -588,6 +554,50 @@ class RenderPathForward {
|
|||||||
}
|
}
|
||||||
#end
|
#end
|
||||||
|
|
||||||
|
#if rp_ssrefr
|
||||||
|
{
|
||||||
|
if (leenkx.data.Config.raw.rp_ssrefr != false)
|
||||||
|
{
|
||||||
|
path.setTarget("gbufferD1");
|
||||||
|
path.bindTarget("_main", "tex");
|
||||||
|
path.drawShader("shader_datas/copy_pass/copy_pass");
|
||||||
|
|
||||||
|
path.setTarget("refr");
|
||||||
|
path.bindTarget("lbuffer0", "tex");
|
||||||
|
path.drawShader("shader_datas/copy_pass/copy_pass");
|
||||||
|
|
||||||
|
path.setTarget("lbuffer0", ["lbuffer1", "gbuffer_refraction"]);
|
||||||
|
|
||||||
|
#if rp_shadowmap
|
||||||
|
{
|
||||||
|
#if lnx_shadowmap_atlas
|
||||||
|
Inc.bindShadowMapAtlas();
|
||||||
|
#else
|
||||||
|
Inc.bindShadowMap();
|
||||||
|
#end
|
||||||
|
}
|
||||||
|
#end
|
||||||
|
|
||||||
|
#if (rp_voxels != "Off")
|
||||||
|
path.bindTarget("voxelsOut", "voxels");
|
||||||
|
path.bindTarget("voxelsSDF", "voxelsSDF");
|
||||||
|
#end
|
||||||
|
|
||||||
|
path.drawMeshes("refraction");
|
||||||
|
|
||||||
|
path.setTarget("lbuffer0");
|
||||||
|
path.bindTarget("lbuffer0", "tex");
|
||||||
|
path.bindTarget("refr", "tex1");
|
||||||
|
path.bindTarget("_main", "gbufferD");
|
||||||
|
path.bindTarget("gbufferD1", "gbufferD1");
|
||||||
|
path.bindTarget("lbuffer1", "gbuffer0");
|
||||||
|
path.bindTarget("gbuffer_refraction", "gbuffer_refraction");
|
||||||
|
|
||||||
|
path.drawShader("shader_datas/ssrefr_pass/ssrefr_pass");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#end
|
||||||
|
|
||||||
#if rp_bloom
|
#if rp_bloom
|
||||||
{
|
{
|
||||||
inline Inc.drawBloom("lbuffer0", bloomDownsampler, bloomUpsampler);
|
inline Inc.drawBloom("lbuffer0", bloomDownsampler, bloomUpsampler);
|
||||||
|
Reference in New Issue
Block a user