Stencil buffers.
This commit is contained in:
parent
4306d0c6fb
commit
72fc9b1aef
|
@ -47,6 +47,7 @@ class ClearTargetNode(Node, CGPipelineTreeNode):
|
|||
self.inputs.new('NodeSocketShader', "Stage")
|
||||
self.inputs.new('NodeSocketBool', "Color")
|
||||
self.inputs.new('NodeSocketBool', "Depth")
|
||||
self.inputs.new('NodeSocketBool', "Stencil")
|
||||
|
||||
self.outputs.new('NodeSocketShader', "Stage")
|
||||
|
||||
|
@ -86,6 +87,7 @@ class TargetNode(Node, CGPipelineTreeNode):
|
|||
self.inputs.new('NodeSocketInt', "Height")
|
||||
self.inputs.new('NodeSocketInt', "Color Buffers")
|
||||
self.inputs.new('NodeSocketBool', "Depth Buffer")
|
||||
self.inputs.new('NodeSocketBool', "Stencil Buffer")
|
||||
self.inputs.new('NodeSocketString', "Format")
|
||||
|
||||
self.outputs.new('NodeSocketShader', "Target")
|
||||
|
@ -296,6 +298,8 @@ def buildNode(res, node, node_group, last_bind_target, shader_references, asset_
|
|||
stage.params.append('color')
|
||||
if node.inputs[2].default_value == True:
|
||||
stage.params.append('depth')
|
||||
if node.inputs[3].default_value == True:
|
||||
stage.params.append('stencil')
|
||||
|
||||
elif node.bl_idname == 'DrawGeometryNodeType':
|
||||
stage.command = 'draw_geometry'
|
||||
|
@ -363,6 +367,7 @@ def get_render_targets(node_group):
|
|||
target.height = n.inputs[2].default_value
|
||||
target.color_buffers = n.inputs[3].default_value
|
||||
target.depth_buffer = n.inputs[4].default_value
|
||||
target.format = n.inputs[5].default_value
|
||||
target.stencil_buffer = n.inputs[5].default_value
|
||||
target.format = n.inputs[6].default_value
|
||||
render_targets.append(target)
|
||||
return render_targets
|
||||
|
|
|
@ -1,72 +0,0 @@
|
|||
{
|
||||
"pipeline_resources": [
|
||||
{
|
||||
"id": "forward_pipeline",
|
||||
"render_targets": [],
|
||||
"stages": [
|
||||
|
||||
{
|
||||
"command": "set_target",
|
||||
"params": [""]
|
||||
},
|
||||
{
|
||||
"command": "clear_target",
|
||||
"params": ["depth", "color"]
|
||||
},
|
||||
{
|
||||
"command": "draw_geometry",
|
||||
"params": ["forward"]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "deferred_pipeline",
|
||||
"render_targets": [
|
||||
{
|
||||
"id": "gbuffer",
|
||||
"width": 0,
|
||||
"height": 0,
|
||||
"color_buffers": 3,
|
||||
"depth": true,
|
||||
"format": "RGBA128"
|
||||
}
|
||||
],
|
||||
"stages": [
|
||||
{
|
||||
"command": "set_target",
|
||||
"params": ["gbuffer"]
|
||||
},
|
||||
{
|
||||
"command": "clear_target",
|
||||
"params": ["depth", "color"]
|
||||
},
|
||||
{
|
||||
"command": "draw_geometry",
|
||||
"params": ["attrib_pass"]
|
||||
},
|
||||
|
||||
|
||||
{
|
||||
"command": "set_target",
|
||||
"params": [""]
|
||||
},
|
||||
{
|
||||
"command": "clear_target",
|
||||
"params": ["depth", "color"]
|
||||
},
|
||||
{
|
||||
"command": "draw_quad",
|
||||
"params": ["material_resource/material1/env_map"]
|
||||
},
|
||||
{
|
||||
"command": "bind_target",
|
||||
"params": ["gbuffer", "gbuffer"]
|
||||
},
|
||||
{
|
||||
"command": "draw_quad",
|
||||
"params": ["material_resource/material_deferred/deferred_pass"]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
|
@ -22,6 +22,18 @@
|
|||
{
|
||||
"id": "blend_destination",
|
||||
"value": "blend_zero"
|
||||
},
|
||||
{
|
||||
"id": "stencil_pass",
|
||||
"value": "keep"
|
||||
},
|
||||
{
|
||||
"id": "stencil_fail",
|
||||
"value": "keep"
|
||||
},
|
||||
{
|
||||
"id": "stencil_reference_value",
|
||||
"value": 0
|
||||
}
|
||||
],
|
||||
"links": [],
|
||||
|
|
|
@ -22,6 +22,18 @@
|
|||
{
|
||||
"id": "blend_destination",
|
||||
"value": "blend_zero"
|
||||
},
|
||||
{
|
||||
"id": "stencil_pass",
|
||||
"value": "keep"
|
||||
},
|
||||
{
|
||||
"id": "stencil_fail",
|
||||
"value": "keep"
|
||||
},
|
||||
{
|
||||
"id": "stencil_reference_value",
|
||||
"value": 0
|
||||
}
|
||||
],
|
||||
"links": [],
|
||||
|
|
|
@ -22,6 +22,18 @@
|
|||
{
|
||||
"id": "blend_destination",
|
||||
"value": "blend_zero"
|
||||
},
|
||||
{
|
||||
"id": "stencil_pass",
|
||||
"value": "keep"
|
||||
},
|
||||
{
|
||||
"id": "stencil_fail",
|
||||
"value": "keep"
|
||||
},
|
||||
{
|
||||
"id": "stencil_reference_value",
|
||||
"value": 0
|
||||
}
|
||||
],
|
||||
"links": [],
|
||||
|
|
|
@ -86,5 +86,4 @@ void main() {
|
|||
gl_FragData[0] = vec4(n.xyz, depth);
|
||||
gl_FragData[1] = vec4(position.xyz, roughness);
|
||||
gl_FragData[2] = vec4(baseColor.rgb, metalness);
|
||||
// gl_FragData[3] = vec4(vn.rgb, 1.0);
|
||||
}
|
||||
|
|
|
@ -22,6 +22,18 @@
|
|||
{
|
||||
"id": "blend_destination",
|
||||
"value": "blend_zero"
|
||||
},
|
||||
{
|
||||
"id": "stencil_pass",
|
||||
"value": "keep"
|
||||
},
|
||||
{
|
||||
"id": "stencil_fail",
|
||||
"value": "keep"
|
||||
},
|
||||
{
|
||||
"id": "stencil_reference_value",
|
||||
"value": 0
|
||||
}
|
||||
],
|
||||
"links": [
|
||||
|
@ -84,6 +96,18 @@
|
|||
{
|
||||
"id": "blend_destination",
|
||||
"value": "blend_zero"
|
||||
},
|
||||
{
|
||||
"id": "stencil_pass",
|
||||
"value": "keep"
|
||||
},
|
||||
{
|
||||
"id": "stencil_fail",
|
||||
"value": "keep"
|
||||
},
|
||||
{
|
||||
"id": "stencil_reference_value",
|
||||
"value": 0
|
||||
}
|
||||
],
|
||||
"links": [
|
||||
|
|
|
@ -22,6 +22,18 @@
|
|||
{
|
||||
"id": "blend_destination",
|
||||
"value": "blend_zero"
|
||||
},
|
||||
{
|
||||
"id": "stencil_pass",
|
||||
"value": "keep"
|
||||
},
|
||||
{
|
||||
"id": "stencil_fail",
|
||||
"value": "keep"
|
||||
},
|
||||
{
|
||||
"id": "stencil_reference_value",
|
||||
"value": 0
|
||||
}
|
||||
],
|
||||
"links": [
|
||||
|
|
|
@ -22,6 +22,18 @@
|
|||
{
|
||||
"id": "blend_destination",
|
||||
"value": "blend_zero"
|
||||
},
|
||||
{
|
||||
"id": "stencil_pass",
|
||||
"value": "keep"
|
||||
},
|
||||
{
|
||||
"id": "stencil_fail",
|
||||
"value": "keep"
|
||||
},
|
||||
{
|
||||
"id": "stencil_reference_value",
|
||||
"value": 0
|
||||
}
|
||||
],
|
||||
"links": [
|
||||
|
|
|
@ -22,6 +22,18 @@
|
|||
{
|
||||
"id": "blend_destination",
|
||||
"value": "blend_zero"
|
||||
},
|
||||
{
|
||||
"id": "stencil_pass",
|
||||
"value": "keep"
|
||||
},
|
||||
{
|
||||
"id": "stencil_fail",
|
||||
"value": "keep"
|
||||
},
|
||||
{
|
||||
"id": "stencil_reference_value",
|
||||
"value": 0
|
||||
}
|
||||
],
|
||||
"links": [
|
||||
|
|
|
@ -22,6 +22,18 @@
|
|||
{
|
||||
"id": "blend_destination",
|
||||
"value": "blend_zero"
|
||||
},
|
||||
{
|
||||
"id": "stencil_pass",
|
||||
"value": "keep"
|
||||
},
|
||||
{
|
||||
"id": "stencil_fail",
|
||||
"value": "keep"
|
||||
},
|
||||
{
|
||||
"id": "stencil_reference_value",
|
||||
"value": 0
|
||||
}
|
||||
],
|
||||
"links": [],
|
||||
|
|
|
@ -22,6 +22,18 @@
|
|||
{
|
||||
"id": "blend_destination",
|
||||
"value": "blend_zero"
|
||||
},
|
||||
{
|
||||
"id": "stencil_pass",
|
||||
"value": "keep"
|
||||
},
|
||||
{
|
||||
"id": "stencil_fail",
|
||||
"value": "keep"
|
||||
},
|
||||
{
|
||||
"id": "stencil_reference_value",
|
||||
"value": 0
|
||||
}
|
||||
],
|
||||
"links": [
|
||||
|
@ -84,6 +96,18 @@
|
|||
{
|
||||
"id": "blend_destination",
|
||||
"value": "blend_zero"
|
||||
},
|
||||
{
|
||||
"id": "stencil_pass",
|
||||
"value": "keep"
|
||||
},
|
||||
{
|
||||
"id": "stencil_fail",
|
||||
"value": "keep"
|
||||
},
|
||||
{
|
||||
"id": "stencil_reference_value",
|
||||
"value": 0
|
||||
}
|
||||
],
|
||||
"links": [
|
||||
|
|
|
@ -22,6 +22,18 @@
|
|||
{
|
||||
"id": "blend_destination",
|
||||
"value": "blend_zero"
|
||||
},
|
||||
{
|
||||
"id": "stencil_pass",
|
||||
"value": "keep"
|
||||
},
|
||||
{
|
||||
"id": "stencil_fail",
|
||||
"value": "keep"
|
||||
},
|
||||
{
|
||||
"id": "stencil_reference_value",
|
||||
"value": 0
|
||||
}
|
||||
],
|
||||
"links": [],
|
||||
|
|
|
@ -51,6 +51,12 @@ def writeResource(res, defs, json_data, base_name):
|
|||
con.depth_write = False
|
||||
elif p['id'] == 'compare_mode':
|
||||
con.compare_mode = p['value']
|
||||
elif p['id'] == 'stencil_pass':
|
||||
con.stencil_pass = p['value']
|
||||
elif p['id'] == 'stencil_fail':
|
||||
con.stencil_fail = p['value']
|
||||
elif p['id'] == 'stencil_reference_value':
|
||||
con.stencil_reference_value = p['value']
|
||||
elif p['id'] == 'cull_mode':
|
||||
con.cull_mode = p['value']
|
||||
elif p['id'] == 'blend_source':
|
||||
|
|
|
@ -22,6 +22,18 @@
|
|||
{
|
||||
"id": "blend_destination",
|
||||
"value": "blend_zero"
|
||||
},
|
||||
{
|
||||
"id": "stencil_pass",
|
||||
"value": "keep"
|
||||
},
|
||||
{
|
||||
"id": "stencil_fail",
|
||||
"value": "keep"
|
||||
},
|
||||
{
|
||||
"id": "stencil_reference_value",
|
||||
"value": 0
|
||||
}
|
||||
],
|
||||
"links": [
|
||||
|
|
|
@ -22,6 +22,18 @@
|
|||
{
|
||||
"id": "blend_destination",
|
||||
"value": "blend_zero"
|
||||
},
|
||||
{
|
||||
"id": "stencil_pass",
|
||||
"value": "keep"
|
||||
},
|
||||
{
|
||||
"id": "stencil_fail",
|
||||
"value": "keep"
|
||||
},
|
||||
{
|
||||
"id": "stencil_reference_value",
|
||||
"value": 0
|
||||
}
|
||||
],
|
||||
"links": [],
|
||||
|
|
|
@ -22,6 +22,18 @@
|
|||
{
|
||||
"id": "blend_destination",
|
||||
"value": "blend_zero"
|
||||
},
|
||||
{
|
||||
"id": "stencil_pass",
|
||||
"value": "keep"
|
||||
},
|
||||
{
|
||||
"id": "stencil_fail",
|
||||
"value": "keep"
|
||||
},
|
||||
{
|
||||
"id": "stencil_reference_value",
|
||||
"value": 0
|
||||
}
|
||||
],
|
||||
"links": [
|
||||
|
|
|
@ -22,6 +22,18 @@
|
|||
{
|
||||
"id": "blend_destination",
|
||||
"value": "blend_zero"
|
||||
},
|
||||
{
|
||||
"id": "stencil_pass",
|
||||
"value": "keep"
|
||||
},
|
||||
{
|
||||
"id": "stencil_fail",
|
||||
"value": "keep"
|
||||
},
|
||||
{
|
||||
"id": "stencil_reference_value",
|
||||
"value": 0
|
||||
}
|
||||
],
|
||||
"links": [
|
||||
|
|
|
@ -22,6 +22,18 @@
|
|||
{
|
||||
"id": "blend_destination",
|
||||
"value": "blend_zero"
|
||||
},
|
||||
{
|
||||
"id": "stencil_pass",
|
||||
"value": "keep"
|
||||
},
|
||||
{
|
||||
"id": "stencil_fail",
|
||||
"value": "keep"
|
||||
},
|
||||
{
|
||||
"id": "stencil_reference_value",
|
||||
"value": 0
|
||||
}
|
||||
],
|
||||
"links": [
|
||||
|
|
Loading…
Reference in a new issue