forked from LeenkxTeam/LNXSDK
Group Nodes, Shaders, Textures, Displacement
This commit is contained in:
@ -31,7 +31,8 @@ else:
|
||||
|
||||
def make(context_id, rpasses, shadowmap=False, shadowmap_transparent=False):
|
||||
|
||||
is_disp = mat_utils.disp_linked(mat_state.output_node)
|
||||
disp_geom = cycles.disp_mode(mat_state.output_node)[0]
|
||||
is_disp = disp_geom != 'off'
|
||||
|
||||
vs = [{'name': 'pos', 'data': 'short4norm'}]
|
||||
if is_disp or shadowmap_transparent:
|
||||
@ -116,7 +117,7 @@ def make(context_id, rpasses, shadowmap=False, shadowmap_transparent=False):
|
||||
make_particle.write(vert, shadowmap=shadowmap)
|
||||
|
||||
if is_disp:
|
||||
if rpdat.lnx_rp_displacement == 'Vertex':
|
||||
if disp_geom == 'vertex':
|
||||
frag.ins = vert.outs
|
||||
vert.add_uniform('mat3 N', '_normalMatrix')
|
||||
vert.write('vec3 wnormal = normalize(N * vec3(nor.xy, pos.w));')
|
||||
@ -137,7 +138,7 @@ def make(context_id, rpasses, shadowmap=False, shadowmap_transparent=False):
|
||||
if con_depth.is_elem('col'):
|
||||
vert.add_out('vec3 vcolor')
|
||||
vert.write_attrib('vcolor = col.rgb;')
|
||||
vert.write('wposition += wnormal * disp;')
|
||||
vert.write('wposition += disp;')
|
||||
if shadowmap:
|
||||
vert.add_uniform('mat4 LVP', '_lightViewProjectionMatrix')
|
||||
vert.write('gl_Position = LVP * vec4(wposition, 1.0);')
|
||||
|
||||
Reference in New Issue
Block a user