Use per-target color mask

This commit is contained in:
unknown 2019-04-06 13:03:04 +02:00
parent 8ad93763b2
commit 5b2b6428d5
6 changed files with 4 additions and 27 deletions

View File

@ -69,10 +69,6 @@ vec4 SSSSBlur() {
vec4 colorM = textureLod(tex, texCoord, 0.0);
// Initialize the stencil buffer in case it was not already available:
// if (initStencil) // (Checked in compile time, it's optimized away)
// if (SSSS_STREGTH_SOURCE == 0.0) discard;
// Fetch linear depth of current pixel
float depth = textureLod(gbufferD, texCoord, 0.0).r;
float depthM = cameraProj.y / (depth - cameraProj.x);

View File

@ -44,14 +44,6 @@ class CyclesShaderContext {
vertex_elements: Reflect.hasField(props, 'vertex_elements') ? props.vertex_elements : [ {name: "pos", data: 'short4norm'}, {name: "nor", data: 'short2norm'}]
};
if (props.color_write_red != null)
data.color_write_red = props.color_write_red;
if (props.color_write_green != null)
data.color_write_green = props.color_write_green;
if (props.color_write_blue != null)
data.color_write_blue = props.color_write_blue;
if (props.color_write_alpha != null)
data.color_write_alpha = props.color_write_alpha;
if (props.color_writes_red != null)
data.color_writes_red = props.color_writes_red;
if (props.color_writes_green != null)

View File

@ -35,12 +35,9 @@ def parse_context(c, sres, asset, defs, vert=None, frag=None):
asset.append(con['tesseval_shader'])
# Params
params = ['depth_write', 'compare_mode', 'stencil_mode', \
'stencil_pass', 'stencil_fail', 'stencil_reference_value', \
'stencil_read_mask', 'stencil_write_mask', 'cull_mode', \
params = ['depth_write', 'compare_mode', 'cull_mode', \
'blend_source', 'blend_destination', 'blend_operation', \
'alpha_blend_source', 'alpha_blend_destination', 'alpha_blend_operation' \
'color_write_red', 'color_write_green', 'color_write_blue', 'color_write_alpha', \
'color_writes_red', 'color_writes_green', 'color_writes_blue', 'color_writes_alpha', \
'conservative_raster']

View File

@ -18,7 +18,7 @@ def make(context_id, rpasses, shadowmap=False):
if is_disp:
vs.append({'name': 'nor', 'data': 'short2norm'})
con_depth = mat_state.data.add_context({ 'name': context_id, 'vertex_elements': vs, 'depth_write': True, 'compare_mode': 'less', 'cull_mode': 'clockwise', 'color_write_red': False, 'color_write_green': False, 'color_write_blue': False, 'color_write_alpha': False })
con_depth = mat_state.data.add_context({ 'name': context_id, 'vertex_elements': vs, 'depth_write': True, 'compare_mode': 'less', 'cull_mode': 'clockwise', 'color_writes_red': [False], 'color_writes_green': [False], 'color_writes_blue': [False], 'color_writes_alpha': [False] })
vert = con_depth.make_vert()
frag = con_depth.make_frag()

View File

@ -21,7 +21,7 @@ def make(context_id):
return con
def make_gi(context_id):
con_voxel = mat_state.data.add_context({ 'name': context_id, 'depth_write': False, 'compare_mode': 'always', 'cull_mode': 'none', 'color_write_red': False, 'color_write_green': False, 'color_write_blue': False, 'color_write_alpha': False, 'conservative_raster': True })
con_voxel = mat_state.data.add_context({ 'name': context_id, 'depth_write': False, 'compare_mode': 'always', 'cull_mode': 'none', 'color_writes_red': [False], 'color_writes_green': [False], 'color_writes_blue': [False], 'color_writes_alpha': [False], 'conservative_raster': True })
wrd = bpy.data.worlds['Arm']
vert = con_voxel.make_vert()
@ -252,7 +252,7 @@ def make_gi(context_id):
return con_voxel
def make_ao(context_id):
con_voxel = mat_state.data.add_context({ 'name': context_id, 'depth_write': False, 'compare_mode': 'always', 'cull_mode': 'none', 'color_write_red': False, 'color_write_green': False, 'color_write_blue': False, 'color_write_alpha': False, 'conservative_raster': False })
con_voxel = mat_state.data.add_context({ 'name': context_id, 'depth_write': False, 'compare_mode': 'always', 'cull_mode': 'none', 'color_writes_red': [False], 'color_writes_green': [False], 'color_writes_blue': [False], 'color_writes_alpha': [False], 'conservative_raster': False })
wrd = bpy.data.worlds['Arm']
rpdat = arm.utils.get_rp()

View File

@ -57,14 +57,6 @@ class ShaderContext:
self.data['alpha_blend_destination'] = props['alpha_blend_destination']
if 'alpha_blend_operation' in props:
self.data['alpha_blend_operation'] = props['alpha_blend_operation']
if 'color_write_red' in props:
self.data['color_write_red'] = props['color_write_red']
if 'color_write_green' in props:
self.data['color_write_green'] = props['color_write_green']
if 'color_write_blue' in props:
self.data['color_write_blue'] = props['color_write_blue']
if 'color_write_alpha' in props:
self.data['color_write_alpha'] = props['color_write_alpha']
if 'color_writes_red' in props:
self.data['color_writes_red'] = props['color_writes_red']
if 'color_writes_green' in props: