Consolidate and update

This commit is contained in:
2026-10-27 15:58:22 -07:00
parent eb211da457
commit 6c13722fc6
42 changed files with 498 additions and 169 deletions

View File

@ -3,12 +3,14 @@ import bpy
import lnx.material.cycles as cycles
import lnx.material.mat_state as mat_state
import lnx.material.make_finalize as make_finalize
import lnx.material.make_mesh as make_mesh
import lnx.utils
if lnx.is_reload(__name__):
cycles = lnx.reload_module(cycles)
mat_state = lnx.reload_module(mat_state)
make_finalize = lnx.reload_module(make_finalize)
make_mesh = lnx.reload_module(make_mesh)
lnx.utils = lnx.reload_module(lnx.utils)
else:
lnx.enable_reload(__name__)
@ -64,14 +66,8 @@ def make(context_id):
frag.write_attrib(' if (abs(mpos.z) > 1.0) discard;')
frag.write_attrib(' vec2 texCoord = mpos.xy * 0.5 + 0.5;')
frag.write('vec3 basecol;')
frag.write('float roughness;')
frag.write('float metallic;')
frag.write('float occlusion;')
frag.write('float specular;')
frag.write('float opacity;')
frag.write('vec3 emissionCol;') # Declared to prevent compiler errors, but decals currently don't output any emission
frag.write('float ior;')
# Declared to prevent compiler errors, but decals currently don't output any emission
make_mesh._write_material_attribs_default(frag, parse_opacity=True)
cycles.parse(mat_state.nodes, con_decal, vert, frag, geom, tesc, tese)
frag.write('n /= (abs(n.x) + abs(n.y) + abs(n.z));')