Billboards
This commit is contained in:
parent
9edf6fd4bc
commit
2fd6d6e649
|
@ -118,9 +118,14 @@ def make_base(con_mesh, parse_opacity):
|
|||
if write_vertex_attribs != None:
|
||||
written = write_vertex_attribs(vert)
|
||||
if written == False:
|
||||
vert.add_uniform('mat4 WVP', '_worldViewProjectionMatrix')
|
||||
billboard = mat_state.material.arm_billboard
|
||||
if billboard == 'spherical':
|
||||
vert.add_uniform('mat4 WVP', '_worldViewProjectionMatrixSphere')
|
||||
elif billboard == 'cylindrical':
|
||||
vert.add_uniform('mat4 WVP', '_worldViewProjectionMatrixCylinder')
|
||||
else: # none
|
||||
vert.add_uniform('mat4 WVP', '_worldViewProjectionMatrix')
|
||||
vert.write('gl_Position = WVP * spos;')
|
||||
|
||||
frag.add_include('../../Shaders/compiled.glsl')
|
||||
|
||||
written = False
|
||||
|
|
|
@ -87,6 +87,12 @@ 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')
|
||||
vert.write('gl_Position = LWVP * spos;')
|
||||
|
||||
|
|
|
@ -270,8 +270,8 @@ def init_properties():
|
|||
bpy.types.Material.arm_two_sided = bpy.props.BoolProperty(name="Two-Sided", default=False)
|
||||
bpy.types.Material.arm_cull_mode = EnumProperty(
|
||||
items=[('none', 'Both', 'None'),
|
||||
('clockwise', 'Front', 'Clockwise'),
|
||||
('counter_clockwise', 'Back', 'Counter-Clockwise')],
|
||||
('clockwise', 'Front', 'Clockwise'),
|
||||
('counter_clockwise', 'Back', 'Counter-Clockwise')],
|
||||
name="", default='clockwise', description="Draw geometry faces")
|
||||
bpy.types.Material.arm_discard = bpy.props.BoolProperty(name="Discard", default=False)
|
||||
bpy.types.Material.arm_discard_opacity = bpy.props.FloatProperty(name="Mesh Opacity", default=0.2, min=0, max=1)
|
||||
|
@ -283,6 +283,11 @@ def init_properties():
|
|||
bpy.types.Material.arm_tess_shadows_inner = bpy.props.IntProperty(name="Inner", description="Inner tessellation level for shadows", default=7)
|
||||
bpy.types.Material.arm_tess_shadows_outer = bpy.props.IntProperty(name="Outer", description="Outer tessellation level for shadows", default=7)
|
||||
bpy.types.Material.arm_custom_material = bpy.props.StringProperty(name="Custom Material", description="Write custom material", default='')
|
||||
bpy.types.Material.arm_billboard = EnumProperty(
|
||||
items=[('none', 'None', 'None'),
|
||||
('spherical', 'Spherical', 'Spherical'),
|
||||
('cylindrical', 'Cylindrical', 'Cylindrical')],
|
||||
name="Billboard", default='none', description="Track camera")
|
||||
# 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)
|
||||
|
|
|
@ -242,6 +242,7 @@ class MaterialPropsPanel(bpy.types.Panel):
|
|||
columnb.prop(mat, 'arm_tess_shadows_outer')
|
||||
|
||||
layout.prop(mat, 'arm_custom_material')
|
||||
layout.prop(mat, 'arm_billboard')
|
||||
|
||||
layout.operator("arm.invalidate_material_cache")
|
||||
|
||||
|
|
Loading…
Reference in a new issue