forked from LeenkxTeam/LNXSDK
Repe [T3DU] and Moises Jpelaez updates
This commit is contained in:
@ -248,7 +248,7 @@ def parse_objectinfo(node: bpy.types.ShaderNodeObjectInfo, out_socket: bpy.types
|
||||
|
||||
|
||||
def parse_particleinfo(node: bpy.types.ShaderNodeParticleInfo, out_socket: bpy.types.NodeSocket, state: ParserState) -> Union[floatstr, vec3str]:
|
||||
particles_on = lnx.utils.get_rp().lnx_particles == 'On'
|
||||
particles_on = lnx.utils.get_rp().lnx_particles == 'GPU'
|
||||
|
||||
# Index
|
||||
if out_socket == node.outputs[0]:
|
||||
@ -310,27 +310,23 @@ def parse_texcoord(node: bpy.types.ShaderNodeTexCoord, out_socket: bpy.types.Nod
|
||||
return 'vec3(0.0)'
|
||||
state.con.add_elem('tex', 'short2norm')
|
||||
state.dxdy_varying_input_value = True
|
||||
|
||||
return 'vec3(texCoord.x, 1.0 - texCoord.y, 0.0)'
|
||||
elif out_socket == node.outputs[3]: # Object
|
||||
state.dxdy_varying_input_value = True
|
||||
return 'mposition'
|
||||
elif out_socket == node.outputs[4]: # Camera
|
||||
state.curshader.add_uniform('mat4 V', link='_viewMatrix')
|
||||
if not state.frag.contains('vec3 viewPosition;'):
|
||||
state.frag.write_init('vec3 viewPosition = (V * vec4(wposition, 1.0)).xyz;')
|
||||
state.dxdy_varying_input_value = True
|
||||
return 'viewPosition'
|
||||
return 'vec3(0.0)' # 'vposition'
|
||||
elif out_socket == node.outputs[5]: # Window
|
||||
# TODO: Don't use gl_FragCoord here, it uses different axes on different graphics APIs
|
||||
state.frag.add_uniform('vec2 screenSize', link='_screenSize')
|
||||
state.dxdy_varying_input_value = True
|
||||
return f'vec3(gl_FragCoord.xy / screenSize, 0.0)'
|
||||
elif out_socket == node.outputs[6]: # Reflection
|
||||
state.curshader.add_uniform('vec3 eye', link='_cameraPosition')
|
||||
if not state.frag.contains('vec3 reflectionVector;'):
|
||||
state.frag.write_init('vec3 reflectionVector = reflect(normalize(wposition - eye), normalize(n));')
|
||||
state.dxdy_varying_input_value = True
|
||||
return 'reflectionVector'
|
||||
if state.context == ParserContext.WORLD:
|
||||
state.dxdy_varying_input_value = True
|
||||
return 'n'
|
||||
return 'vec3(0.0)'
|
||||
|
||||
|
||||
def parse_uvmap(node: bpy.types.ShaderNodeUVMap, out_socket: bpy.types.NodeSocket, state: ParserState) -> vec3str:
|
||||
|
||||
Reference in New Issue
Block a user