Fix vertex structures
This commit is contained in:
parent
30770c8d3e
commit
793d616fa9
|
@ -19,9 +19,8 @@ void main() {
|
|||
float revealage = 1.0 - accum.a;
|
||||
|
||||
// Save the blending and color texture fetch cost
|
||||
if (revealage >= 1.0) {
|
||||
// discard;
|
||||
fragColor = vec4(accum.rgb, 1.0);
|
||||
if (revealage == 0.0) {
|
||||
discard;
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -30,6 +29,5 @@ void main() {
|
|||
}
|
||||
|
||||
float f = texelFetch(gbuffer1, ivec2(texCoord * texSize), 0).r;
|
||||
|
||||
fragColor = vec4(accum.rgb / clamp(f, 1e-4, 5e4), revealage);
|
||||
}
|
||||
|
|
|
@ -1835,8 +1835,6 @@ class ArmoryExporter:
|
|||
for con in o['contexts']: # TODO: blend context
|
||||
if con['name'] == 'mesh' and material.arm_blending:
|
||||
con['name'] = 'blend'
|
||||
# TODO: use array and remove duplis to ensure correctness
|
||||
material.vertex_structure = vs_str
|
||||
|
||||
if (material.export_tangents != tang_export) or \
|
||||
(material.export_uvs != uv_export) or \
|
||||
|
@ -2107,23 +2105,6 @@ class ArmoryExporter:
|
|||
|
||||
self.output['material_datas'] = []
|
||||
self.export_materials()
|
||||
|
||||
# Ensure same vertex structure for object materials
|
||||
if not wrd.arm_deinterleaved_buffers:
|
||||
for bobject in scene_objects:
|
||||
if len(bobject.material_slots) > 1:
|
||||
mat = self.slot_to_material(bobject, bobject.material_slots[0])
|
||||
if mat == None:
|
||||
continue
|
||||
vs = mat.vertex_structure
|
||||
for i in range(1, len(bobject.material_slots)):
|
||||
nmat = self.slot_to_material(bobject, bobject.material_slots[i])
|
||||
if nmat == None:
|
||||
continue
|
||||
if vs != nmat.vertex_structure:
|
||||
log.warn('Object ' + bobject.name + ' - unable to bind materials to vertex data, please separate object by material (select object - edit mode - P - By Material) or enable Deinterleaved Buffers in Armory Project - Flags')
|
||||
break
|
||||
|
||||
self.export_particle_systems()
|
||||
self.output['world_datas'] = []
|
||||
self.export_worlds()
|
||||
|
|
|
@ -150,26 +150,6 @@ def make(context_id, rpasses, shadowmap=False):
|
|||
if con_depth.is_elem('col'):
|
||||
vert.add_out('vec3 vcolor')
|
||||
vert.write('vcolor = col;')
|
||||
|
||||
# TODO: interleaved buffer has to match vertex structure of mesh context
|
||||
if not bpy.data.worlds['Arm'].arm_deinterleaved_buffers:
|
||||
con_depth.add_elem('nor', 3)
|
||||
if mat_state.con_mesh != None:
|
||||
if mat_state.con_mesh.is_elem('tex'):
|
||||
con_depth.add_elem('tex', 2)
|
||||
if mat_state.con_mesh.is_elem('tex1'):
|
||||
con_depth.add_elem('tex1', 2)
|
||||
if mat_state.con_mesh.is_elem('col'):
|
||||
con_depth.add_elem('col', 3)
|
||||
if mat_state.con_mesh.is_elem('tang'):
|
||||
con_depth.add_elem('tang', 4)
|
||||
|
||||
# TODO: pass vbuf with proper struct
|
||||
gapi = arm.utils.get_gapi()
|
||||
if gapi.startswith('direct3d') and bpy.data.worlds['Arm'].arm_deinterleaved_buffers == False:
|
||||
vert.write('vec3 t1 = nor; // TODO: Temp for d3d')
|
||||
if con_depth.is_elem('tex'):
|
||||
vert.write('vec2 t2 = tex; // TODO: Temp for d3d')
|
||||
|
||||
if parse_opacity:
|
||||
opac = mat_state.material.arm_discard_opacity_shadows
|
||||
|
|
|
@ -299,7 +299,6 @@ def init_properties():
|
|||
bpy.types.Material.export_uvs = BoolProperty(name="Export UVs", default=False)
|
||||
bpy.types.Material.export_vcols = BoolProperty(name="Export VCols", default=False)
|
||||
bpy.types.Material.export_tangents = BoolProperty(name="Export Tangents", default=False)
|
||||
bpy.types.Material.vertex_structure = StringProperty(name="Vertex Structure", default='')
|
||||
bpy.types.Material.arm_skip_context = StringProperty(name="Skip Context", default='')
|
||||
bpy.types.Material.arm_material_id = IntProperty(name="ID", default=0)
|
||||
bpy.types.NodeSocket.is_uniform = BoolProperty(name="Is Uniform", description="Mark node sockets to be processed as material uniforms", default=False)
|
||||
|
|
Loading…
Reference in a new issue