Set depth attachment
This commit is contained in:
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -43,7 +43,8 @@ class MaterialShaderContext {
|
||||
fragment_shader: '',
|
||||
vertex_shader: '',
|
||||
vertex_elements: Reflect.hasField(props, 'vertex_elements') ? props.vertex_elements : [ {name: "pos", data: 'short4norm'}, {name: "nor", data: 'short2norm'}],
|
||||
color_attachments: props.color_attachments
|
||||
color_attachments: props.color_attachments,
|
||||
depth_attachment: props.depth_attachment
|
||||
};
|
||||
|
||||
if (props.color_writes_red != null)
|
||||
|
||||
@@ -75,7 +75,6 @@ class RenderPathDeferred {
|
||||
t.height = 0;
|
||||
t.format = "RGBA64";
|
||||
t.scale = Inc.getSuperSampling();
|
||||
t.depth_buffer = "main";
|
||||
path.createRenderTarget(t);
|
||||
}
|
||||
{
|
||||
@@ -151,6 +150,7 @@ class RenderPathDeferred {
|
||||
path.loadShader("shader_datas/compositor_pass/compositor_pass");
|
||||
path.loadShader("shader_datas/copy_pass/copy_pass");
|
||||
path.loadShader("shader_datas/copy_pass/copyR8_pass");
|
||||
//path.loadShader("shader_datas/copy_pass/copyD32_pass");
|
||||
path.loadShader("shader_datas/smaa_edge_detect/smaa_edge_detect");
|
||||
path.loadShader("shader_datas/smaa_blend_weight/smaa_blend_weight");
|
||||
path.loadShader("shader_datas/smaa_neighborhood_blend/smaa_neighborhood_blend");
|
||||
@@ -333,9 +333,6 @@ class RenderPathDeferred {
|
||||
// ---
|
||||
// Deferred light
|
||||
// ---
|
||||
#if (!kha_opengl)
|
||||
path.setDepthFrom("tex", "gbuffer1"); // Unbind depth so we can read it
|
||||
#end
|
||||
path.setTarget("tex");
|
||||
path.bindTarget("_main", "gbufferD");
|
||||
path.bindTarget("gbuffer0", "gbuffer0");
|
||||
@@ -386,12 +383,16 @@ class RenderPathDeferred {
|
||||
#end
|
||||
|
||||
#if (!kha_opengl)
|
||||
path.setDepthFrom("tex", "gbuffer0"); // Re-bind depth
|
||||
path.setDepthFrom("tex", "gbuffer0"); // Bind depth for world pass
|
||||
#end
|
||||
|
||||
path.setTarget("tex"); // Re-binds depth
|
||||
path.setTarget("tex");
|
||||
path.drawSkydome("world_pass/world_pass/world_pass");
|
||||
|
||||
#if (!kha_opengl)
|
||||
path.setDepthFrom("tex", "gbuffer1"); // Unbind depth
|
||||
#end
|
||||
|
||||
if (Config.raw.rp_bloom != false) {
|
||||
|
||||
if (path.renderTargets.get("bloomtex") == null) {
|
||||
|
||||
@@ -39,7 +39,6 @@ class RenderPathPreview {
|
||||
t.height = RenderUtil.matPreviewSize;
|
||||
t.format = "RGBA64";
|
||||
t.scale = Inc.getSuperSampling();
|
||||
t.depth_buffer = "mmain";
|
||||
path.createRenderTarget(t);
|
||||
}
|
||||
|
||||
@@ -100,9 +99,6 @@ class RenderPathPreview {
|
||||
// ---
|
||||
// Deferred light
|
||||
// ---
|
||||
#if (!kha_opengl && !kha_direct3d12)
|
||||
path.setDepthFrom("mtex", "mgbuffer1"); // Unbind depth so we can read it
|
||||
#end
|
||||
path.setTarget("mtex");
|
||||
path.bindTarget("_mmain", "gbufferD");
|
||||
path.bindTarget("mgbuffer0", "gbuffer0");
|
||||
@@ -113,7 +109,7 @@ class RenderPathPreview {
|
||||
path.drawShader("deferred_light/deferred_light/deferred_light");
|
||||
|
||||
#if (!kha_opengl && !kha_direct3d12)
|
||||
path.setDepthFrom("mtex", "mgbuffer0"); // Re-bind depth
|
||||
path.setDepthFrom("mtex", "mgbuffer0"); // Bind depth for world pass
|
||||
#end
|
||||
|
||||
path.setTarget("mtex"); // Re-binds depth
|
||||
@@ -121,6 +117,10 @@ class RenderPathPreview {
|
||||
path.drawSkydome("world_pass/world_pass/world_pass");
|
||||
#end
|
||||
|
||||
#if (!kha_opengl && !kha_direct3d12)
|
||||
path.setDepthFrom("mtex", "mgbuffer1"); // Unbind depth
|
||||
#end
|
||||
|
||||
var framebuffer = "texpreview";
|
||||
var selectedMat = UIHeader.inst.worktab.position == SpaceRender ? Context.materialScene : Context.material;
|
||||
RenderPath.active.renderTargets.get("texpreview").image = selectedMat.image;
|
||||
@@ -152,9 +152,6 @@ class RenderPathPreview {
|
||||
// ---
|
||||
// Deferred light
|
||||
// ---
|
||||
#if (!kha_opengl && !kha_direct3d12)
|
||||
path.setDepthFrom("tex", "gbuffer1"); // Unbind depth so we can read it
|
||||
#end
|
||||
path.setTarget("tex");
|
||||
path.bindTarget("_main", "gbufferD");
|
||||
path.bindTarget("gbuffer0", "gbuffer0");
|
||||
@@ -165,12 +162,16 @@ class RenderPathPreview {
|
||||
path.drawShader("deferred_light/deferred_light/deferred_light");
|
||||
|
||||
#if (!kha_opengl && !kha_direct3d12)
|
||||
path.setDepthFrom("tex", "gbuffer0"); // Re-bind depth
|
||||
path.setDepthFrom("tex", "gbuffer0"); // Bind depth for world pass
|
||||
#end
|
||||
|
||||
path.setTarget("tex"); // Re-binds depth
|
||||
path.setTarget("tex");
|
||||
path.drawSkydome("world_pass/world_pass/world_pass");
|
||||
|
||||
#if (!kha_opengl && !kha_direct3d12)
|
||||
path.setDepthFrom("tex", "gbuffer1"); // Unbind depth
|
||||
#end
|
||||
|
||||
var framebuffer = "texpreview";
|
||||
RenderPath.active.renderTargets.get("texpreview").image = Context.decalImage;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user