Billboard shadows
This commit is contained in:
parent
fc5efd6149
commit
c64bc0886c
|
@ -13,7 +13,13 @@ write_material_attribs_post = None
|
|||
write_vertex_attribs = None
|
||||
|
||||
def make(context_id):
|
||||
con_mesh = mat_state.data.add_context({ 'name': context_id, 'depth_write': True, 'compare_mode': 'less', 'cull_mode': 'clockwise' })
|
||||
con = { 'name': context_id, 'depth_write': True, 'compare_mode': 'less', 'cull_mode': 'clockwise' }
|
||||
if mat_state.material.arm_blending:
|
||||
con['blend_source'] = 'blend_one'
|
||||
con['blend_destination'] = 'blend_one'
|
||||
con['blend_operation'] = 'add'
|
||||
con['cull_mode'] = 'none'
|
||||
con_mesh = mat_state.data.add_context(con)
|
||||
|
||||
rpdat = arm.utils.get_rp()
|
||||
rid = rpdat.rp_renderer
|
||||
|
|
|
@ -87,13 +87,13 @@ def make(context_id, rpasses):
|
|||
# No displacement
|
||||
else:
|
||||
frag.ins = vert.outs
|
||||
# billboard = mat_state.material.arm_billboard
|
||||
# if billboard == 'spherical':
|
||||
# vert.add_uniform('mat4 LWVP', '_lampWorldViewProjectionMatrixSphere')
|
||||
# elif billboard == 'cylindrical':
|
||||
# vert.add_uniform('mat4 LWVP', '_lampWorldViewProjectionMatrixCylinder')
|
||||
# else: # none
|
||||
vert.add_uniform('mat4 LWVP', '_lampWorldViewProjectionMatrix')
|
||||
billboard = mat_state.material.arm_billboard
|
||||
if billboard == 'spherical':
|
||||
vert.add_uniform('mat4 LWVP', '_lampWorldViewProjectionMatrixSphere')
|
||||
elif billboard == 'cylindrical':
|
||||
vert.add_uniform('mat4 LWVP', '_lampWorldViewProjectionMatrixCylinder')
|
||||
else: # none
|
||||
vert.add_uniform('mat4 LWVP', '_lampWorldViewProjectionMatrix')
|
||||
vert.write('gl_Position = LWVP * spos;')
|
||||
|
||||
if parse_opacity:
|
||||
|
|
|
@ -291,6 +291,7 @@ def init_properties():
|
|||
('cylindrical', 'Cylindrical', 'Cylindrical')],
|
||||
name="Billboard", default='none', description="Track camera")
|
||||
bpy.types.Material.arm_tilesheet_mat = bpy.props.BoolProperty(name="Tilesheet", description="Generate tilesheet shaders", default=False)
|
||||
bpy.types.Material.arm_blending = bpy.props.BoolProperty(name="Blending", description="Enable additive blending", default=False)
|
||||
# For scene
|
||||
bpy.types.Scene.arm_export = bpy.props.BoolProperty(name="Export", description="Export scene data", default=True)
|
||||
bpy.types.Scene.arm_gp_export = bpy.props.BoolProperty(name="Export GP", description="Export grease pencil data", default=True)
|
||||
|
|
|
@ -253,7 +253,9 @@ class MaterialPropsPanel(bpy.types.Panel):
|
|||
|
||||
layout.prop(mat, 'arm_custom_material')
|
||||
layout.prop(mat, 'arm_billboard')
|
||||
layout.prop(mat, 'arm_tilesheet_mat')
|
||||
row = layout.row()
|
||||
row.prop(mat, 'arm_tilesheet_mat')
|
||||
row.prop(mat, 'arm_blending')
|
||||
|
||||
layout.operator("arm.invalidate_material_cache")
|
||||
|
||||
|
|
Loading…
Reference in a new issue