forked from LeenkxTeam/LNXSDK
merge upstream
This commit is contained in:
@ -3,7 +3,7 @@ package leenkx.logicnode;
|
|||||||
import iron.object.Object;
|
import iron.object.Object;
|
||||||
import iron.math.Vec4;
|
import iron.math.Vec4;
|
||||||
|
|
||||||
class GetWorldNode extends LogicNode {
|
class GetWorldOrientationNode extends LogicNode {
|
||||||
|
|
||||||
public var property0: String;
|
public var property0: String;
|
||||||
|
|
||||||
|
@ -55,9 +55,9 @@ class SetParticleDataNode extends LogicNode {
|
|||||||
@:privateAccess psys.aligny = vel.y;
|
@:privateAccess psys.aligny = vel.y;
|
||||||
@:privateAccess psys.alignz = vel.z;
|
@:privateAccess psys.alignz = vel.z;
|
||||||
case 'Velocity Random':
|
case 'Velocity Random':
|
||||||
psys.r.factor_random = inputs[3].get();
|
@:privateAccess psys.r.factor_random = inputs[3].get();
|
||||||
case 'Weight Gravity':
|
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) {
|
if (iron.Scene.active.raw.gravity != null) {
|
||||||
@:privateAccess psys.gx = iron.Scene.active.raw.gravity[0] * @:privateAccess psys.r.weight_gravity;
|
@: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;
|
@:privateAccess psys.gy = iron.Scene.active.raw.gravity[1] * @:privateAccess psys.r.weight_gravity;
|
||||||
|
@ -313,17 +313,22 @@ def parse_texcoord(node: bpy.types.ShaderNodeTexCoord, out_socket: bpy.types.Nod
|
|||||||
state.dxdy_varying_input_value = True
|
state.dxdy_varying_input_value = True
|
||||||
return 'mposition'
|
return 'mposition'
|
||||||
elif out_socket == node.outputs[4]: # Camera
|
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
|
elif out_socket == node.outputs[5]: # Window
|
||||||
# TODO: Don't use gl_FragCoord here, it uses different axes on different graphics APIs
|
# TODO: Don't use gl_FragCoord here, it uses different axes on different graphics APIs
|
||||||
state.frag.add_uniform('vec2 screenSize', link='_screenSize')
|
state.frag.add_uniform('vec2 screenSize', link='_screenSize')
|
||||||
state.dxdy_varying_input_value = True
|
state.dxdy_varying_input_value = True
|
||||||
return f'vec3(gl_FragCoord.xy / screenSize, 0.0)'
|
return f'vec3(gl_FragCoord.xy / screenSize, 0.0)'
|
||||||
elif out_socket == node.outputs[6]: # Reflection
|
elif out_socket == node.outputs[6]: # Reflection
|
||||||
if state.context == ParserContext.WORLD:
|
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
|
state.dxdy_varying_input_value = True
|
||||||
return 'n'
|
return 'reflectionVector'
|
||||||
return 'vec3(0.0)'
|
|
||||||
|
|
||||||
|
|
||||||
def parse_uvmap(node: bpy.types.ShaderNodeUVMap, out_socket: bpy.types.NodeSocket, state: ParserState) -> vec3str:
|
def parse_uvmap(node: bpy.types.ShaderNodeUVMap, out_socket: bpy.types.NodeSocket, state: ParserState) -> vec3str:
|
||||||
|
@ -61,7 +61,7 @@ class StereoPanner extends Panner {
|
|||||||
|
|
||||||
public inline function setBalance(balance: Balance) {
|
public inline function setBalance(balance: Balance) {
|
||||||
this._balance = balance;
|
this._balance = balance;
|
||||||
final volumeLeft = Math.sqrt(~balance);Add commentMore actions
|
final volumeLeft = Math.sqrt(~balance);
|
||||||
final volumeRight = Math.sqrt(balance);
|
final volumeRight = Math.sqrt(balance);
|
||||||
sendMessage({ id: StereoPannerMessageID.PVolumeLeft, data: volumeLeft });
|
sendMessage({ id: StereoPannerMessageID.PVolumeLeft, data: volumeLeft });
|
||||||
sendMessage({ id: StereoPannerMessageID.PVolumeRight, data: volumeRight });
|
sendMessage({ id: StereoPannerMessageID.PVolumeRight, data: volumeRight });
|
||||||
|
Reference in New Issue
Block a user