Color attachment format
This commit is contained in:
parent
9a71b5b664
commit
967f69b24a
|
@ -8,7 +8,8 @@
|
|||
"links": [],
|
||||
"texture_params": [],
|
||||
"vertex_shader": "../include/pass.vert.glsl",
|
||||
"fragment_shader": "clear_pass.frag.glsl"
|
||||
"fragment_shader": "clear_pass.frag.glsl",
|
||||
"color_attachment": "_HDR"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
@ -108,7 +108,8 @@
|
|||
],
|
||||
"texture_params": [],
|
||||
"vertex_shader": "world_pass.vert.glsl",
|
||||
"fragment_shader": "world_pass.frag.glsl"
|
||||
"fragment_shader": "world_pass.frag.glsl",
|
||||
"color_attachment": "_HDR"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
@ -34,11 +34,17 @@ def parse_context(c, sres, asset, defs, vert=None, frag=None):
|
|||
if con['tesseval_shader'] not in asset:
|
||||
asset.append(con['tesseval_shader'])
|
||||
|
||||
if 'color_attachment' in c:
|
||||
con['color_attachment'] = c['color_attachment']
|
||||
if con['color_attachment'] == '_HDR':
|
||||
con['color_attachment'] = 'RGBA32' if '_LDR' in defs else 'RGBA64'
|
||||
|
||||
# Params
|
||||
params = ['depth_write', 'compare_mode', 'cull_mode', \
|
||||
'blend_source', 'blend_destination', 'blend_operation', \
|
||||
'alpha_blend_source', 'alpha_blend_destination', 'alpha_blend_operation' \
|
||||
'color_writes_red', 'color_writes_green', 'color_writes_blue', 'color_writes_alpha', \
|
||||
'color_attachment_count', \
|
||||
'conservative_raster']
|
||||
|
||||
for p in params:
|
||||
|
|
|
@ -16,6 +16,7 @@ write_material_attribs_post = None
|
|||
write_vertex_attribs = None
|
||||
|
||||
def make(context_id, rpasses):
|
||||
wrd = bpy.data.worlds['Arm']
|
||||
rpdat = arm.utils.get_rp()
|
||||
rid = rpdat.rp_renderer
|
||||
|
||||
|
@ -42,6 +43,9 @@ def make(context_id, rpasses):
|
|||
con['depth_write'] = False
|
||||
con['compare_mode'] = 'equal'
|
||||
|
||||
if '_LDR' not in wrd.world_defs:
|
||||
con['color_attachment'] = 'RGBA64'
|
||||
|
||||
con_mesh = mat_state.data.add_context(con)
|
||||
mat_state.con_mesh = con_mesh
|
||||
|
||||
|
|
|
@ -65,6 +65,10 @@ class ShaderContext:
|
|||
self.data['color_writes_blue'] = props['color_writes_blue']
|
||||
if 'color_writes_alpha' in props:
|
||||
self.data['color_writes_alpha'] = props['color_writes_alpha']
|
||||
if 'color_attachment_count' in props:
|
||||
self.data['color_attachment_count'] = props['color_attachment_count']
|
||||
if 'color_attachment' in props:
|
||||
self.data['color_attachment'] = props['color_attachment']
|
||||
|
||||
self.data['texture_units'] = []
|
||||
self.tunits = self.data['texture_units']
|
||||
|
|
Loading…
Reference in a new issue