diff --git a/leenkx/Sources/leenkx/logicnode/GetWorldOrientationNode.hx b/leenkx/Sources/leenkx/logicnode/GetWorldOrientationNode.hx index c587196..2fba059 100644 --- a/leenkx/Sources/leenkx/logicnode/GetWorldOrientationNode.hx +++ b/leenkx/Sources/leenkx/logicnode/GetWorldOrientationNode.hx @@ -3,7 +3,7 @@ package leenkx.logicnode; import iron.object.Object; import iron.math.Vec4; -class GetWorldNode extends LogicNode { +class GetWorldOrientationNode extends LogicNode { public var property0: String; diff --git a/leenkx/Sources/leenkx/logicnode/SetParticleDataNode.hx b/leenkx/Sources/leenkx/logicnode/SetParticleDataNode.hx index ef67c50..d9cb727 100644 --- a/leenkx/Sources/leenkx/logicnode/SetParticleDataNode.hx +++ b/leenkx/Sources/leenkx/logicnode/SetParticleDataNode.hx @@ -55,9 +55,9 @@ class SetParticleDataNode extends LogicNode { @:privateAccess psys.aligny = vel.y; @:privateAccess psys.alignz = vel.z; case 'Velocity Random': - psys.r.factor_random = inputs[3].get(); + @:privateAccess psys.r.factor_random = inputs[3].get(); case 'Weight Gravity': - psys.r.weight_gravity = inputs[3].get(); + @:privateAccess psys.r.weight_gravity = inputs[3].get(); if (iron.Scene.active.raw.gravity != null) { @:privateAccess psys.gx = iron.Scene.active.raw.gravity[0] * @:privateAccess psys.r.weight_gravity; @:privateAccess psys.gy = iron.Scene.active.raw.gravity[1] * @:privateAccess psys.r.weight_gravity; diff --git a/leenkx/blender/lnx/material/cycles_nodes/nodes_input.py b/leenkx/blender/lnx/material/cycles_nodes/nodes_input.py index c493685..14c5700 100644 --- a/leenkx/blender/lnx/material/cycles_nodes/nodes_input.py +++ b/leenkx/blender/lnx/material/cycles_nodes/nodes_input.py @@ -313,17 +313,22 @@ def parse_texcoord(node: bpy.types.ShaderNodeTexCoord, out_socket: bpy.types.Nod state.dxdy_varying_input_value = True return 'mposition' elif out_socket == node.outputs[4]: # Camera - return 'vec3(0.0)' # 'vposition' + 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' 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 - if state.context == ParserContext.WORLD: - state.dxdy_varying_input_value = True - return 'n' - return 'vec3(0.0)' + 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' def parse_uvmap(node: bpy.types.ShaderNodeUVMap, out_socket: bpy.types.NodeSocket, state: ParserState) -> vec3str: diff --git a/lib/aura/Sources/aura/dsp/panner/StereoPanner.hx b/lib/aura/Sources/aura/dsp/panner/StereoPanner.hx index a19a78a..7e7248c 100644 --- a/lib/aura/Sources/aura/dsp/panner/StereoPanner.hx +++ b/lib/aura/Sources/aura/dsp/panner/StereoPanner.hx @@ -61,7 +61,7 @@ class StereoPanner extends Panner { public inline function setBalance(balance: Balance) { this._balance = balance; - final volumeLeft = Math.sqrt(~balance);Add commentMore actions + final volumeLeft = Math.sqrt(~balance); final volumeRight = Math.sqrt(balance); sendMessage({ id: StereoPannerMessageID.PVolumeLeft, data: volumeLeft }); sendMessage({ id: StereoPannerMessageID.PVolumeRight, data: volumeRight });