Jam Updates
This commit is contained in:
parent
e5166dd7cf
commit
08dbd8681b
|
@ -7,7 +7,7 @@ namespace Rokojori
|
||||||
{
|
{
|
||||||
[Tool]
|
[Tool]
|
||||||
[GlobalClass, Icon("res://addons/rokojori_action_library/Icons/OnEvent.svg") ]
|
[GlobalClass, Icon("res://addons/rokojori_action_library/Icons/OnEvent.svg") ]
|
||||||
public partial class OnCollision:Node
|
public partial class OnCollision:Node,iNodeState
|
||||||
{
|
{
|
||||||
[Export]
|
[Export]
|
||||||
public Area3D area;
|
public Area3D area;
|
||||||
|
@ -28,6 +28,24 @@ namespace Rokojori
|
||||||
|
|
||||||
Dictionary<Node,System.Action> _inside = new Dictionary<Node,System.Action>();
|
Dictionary<Node,System.Action> _inside = new Dictionary<Node,System.Action>();
|
||||||
|
|
||||||
|
List<Node> _nodes = new List<Node>();
|
||||||
|
|
||||||
|
public List<Node> GetNodesInside()
|
||||||
|
{
|
||||||
|
_nodes = _nodes.Filter( n => n != null && IsInstanceValid( n ) );
|
||||||
|
|
||||||
|
return _nodes;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void OnNodeStateChanged( bool processEnabled, bool inputEnabled, bool physicsEnabled, bool signalsEnabled,
|
||||||
|
Node.ProcessModeEnum processMode, bool visible )
|
||||||
|
{
|
||||||
|
if ( ! processEnabled || ! physicsEnabled || Node.ProcessModeEnum.Disabled == processMode )
|
||||||
|
{
|
||||||
|
this.LogInfo( "Clearing nodes" );
|
||||||
|
_nodes.Clear();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public override void _Ready()
|
public override void _Ready()
|
||||||
{
|
{
|
||||||
|
@ -56,9 +74,15 @@ namespace Rokojori
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( ! _nodes.Contains( n ) )
|
||||||
|
{
|
||||||
|
_nodes.Add( n );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
this.LogInfo( "Selecting Enter", area.GlobalPosition, HierarchyName.Of( n ), ( (Node3D)n ).GlobalPosition );
|
|
||||||
|
|
||||||
|
// this.LogInfo( "Selecting Enter", area.GlobalPosition, HierarchyName.Of( n ), ( (Node3D)n ).GlobalPosition );
|
||||||
Action.Trigger( onEntered );
|
Action.Trigger( onEntered );
|
||||||
|
|
||||||
if ( onInside == null )
|
if ( onInside == null )
|
||||||
|
@ -81,6 +105,8 @@ namespace Rokojori
|
||||||
|
|
||||||
void TriggerOnExited( Node n )
|
void TriggerOnExited( Node n )
|
||||||
{
|
{
|
||||||
|
_nodes.Remove( n );
|
||||||
|
|
||||||
if ( ! Selector.IsSelecting( selector, n ) )
|
if ( ! Selector.IsSelecting( selector, n ) )
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
|
@ -88,6 +114,8 @@ namespace Rokojori
|
||||||
|
|
||||||
Action.Trigger( onExit );
|
Action.Trigger( onExit );
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if ( ! _inside.ContainsKey( n ) )
|
if ( ! _inside.ContainsKey( n ) )
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -0,0 +1,21 @@
|
||||||
|
|
||||||
|
using Godot;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
namespace Rokojori
|
||||||
|
{
|
||||||
|
[Tool][GlobalClass]
|
||||||
|
public partial class RemoveNode : Action
|
||||||
|
{
|
||||||
|
[Export]
|
||||||
|
public Node target;
|
||||||
|
|
||||||
|
protected override void _OnTrigger()
|
||||||
|
{
|
||||||
|
if ( target != null )
|
||||||
|
{
|
||||||
|
target.SelfDestroy();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1 @@
|
||||||
|
uid://dq5kae8x62gre
|
|
@ -50,8 +50,13 @@ namespace Rokojori
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// [ExportToolButton( "Initialize")]
|
[ExportToolButton( "Initialize")]
|
||||||
// public Callable InitializeButton => Callable.From( Initialize );
|
public Callable InitializeButton => Callable.From( Initialize );
|
||||||
|
|
||||||
|
public override void _Process( double delta )
|
||||||
|
{
|
||||||
|
Engine.MaxFps = _fps;
|
||||||
|
}
|
||||||
|
|
||||||
public void Initialize()
|
public void Initialize()
|
||||||
{
|
{
|
||||||
|
|
|
@ -5,6 +5,13 @@ using System;
|
||||||
|
|
||||||
namespace Rokojori
|
namespace Rokojori
|
||||||
{
|
{
|
||||||
|
public interface iNodeState
|
||||||
|
{
|
||||||
|
public void OnNodeStateChanged( bool processEnabled, bool inputEnabled, bool physicsEnabled, bool signalsEnabled,
|
||||||
|
Node.ProcessModeEnum processMode, bool visible );
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
public static class NodeState
|
public static class NodeState
|
||||||
{
|
{
|
||||||
public static void Configure( Node n, bool processEnabled, bool inputEnabled, bool physicsEnabled, bool signalsEnabled,
|
public static void Configure( Node n, bool processEnabled, bool inputEnabled, bool physicsEnabled, bool signalsEnabled,
|
||||||
|
@ -22,6 +29,12 @@ namespace Rokojori
|
||||||
|
|
||||||
n.ProcessMode = processMode;
|
n.ProcessMode = processMode;
|
||||||
|
|
||||||
|
if ( n is iNodeState ins )
|
||||||
|
{
|
||||||
|
ins.OnNodeStateChanged( processEnabled, inputEnabled, physicsEnabled, signalsEnabled,
|
||||||
|
processMode, visible );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if ( n is Node3D )
|
if ( n is Node3D )
|
||||||
{
|
{
|
||||||
|
|
|
@ -15,6 +15,9 @@ namespace Rokojori
|
||||||
[Export]
|
[Export]
|
||||||
public Sensor button;
|
public Sensor button;
|
||||||
|
|
||||||
|
[Export]
|
||||||
|
public Action onInteract;
|
||||||
|
|
||||||
public override void _Ready()
|
public override void _Ready()
|
||||||
{
|
{
|
||||||
SensorManager.Register( this, button );
|
SensorManager.Register( this, button );
|
||||||
|
|
|
@ -19,6 +19,9 @@ namespace Rokojori
|
||||||
[Export]
|
[Export]
|
||||||
public Pointable pointable;
|
public Pointable pointable;
|
||||||
|
|
||||||
|
[Export]
|
||||||
|
public bool printPointables = false;
|
||||||
|
|
||||||
public override void _Process( double delta )
|
public override void _Process( double delta )
|
||||||
{
|
{
|
||||||
if ( caster == null )
|
if ( caster == null )
|
||||||
|
@ -52,6 +55,11 @@ namespace Rokojori
|
||||||
pointable.UpdatePointerState( this, true );
|
pointable.UpdatePointerState( this, true );
|
||||||
Highlight( HighlightActionType.Start, pointable );
|
Highlight( HighlightActionType.Start, pointable );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( printPointables )
|
||||||
|
{
|
||||||
|
this.LogInfo( pointable );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Highlight( HighlightActionType type, Pointable p )
|
void Highlight( HighlightActionType type, Pointable p )
|
||||||
|
|
|
@ -91,30 +91,30 @@ vec3 limitDeform( vec3 originalWorldPosition, vec3 deformedWorldPosition )
|
||||||
return outputPosition;
|
return outputPosition;
|
||||||
}
|
}
|
||||||
|
|
||||||
void vertex()
|
void vertex()
|
||||||
{
|
{
|
||||||
UV = UV * uv1_scale.xy + uv1_offset.xy;
|
UV = UV * uv1_scale.xy + uv1_offset.xy;
|
||||||
|
|
||||||
vec3 worldVertex = localToWorld( VERTEX, MODEL_MATRIX ).xyz;
|
vec3 worldVertex = localToWorld( VERTEX, MODEL_MATRIX ).xyz;
|
||||||
vec2 worldUV = worldVertex.xz * hslVariationUVScale;
|
vec2 worldUV = worldVertex.xz * hslVariationUVScale;
|
||||||
|
|
||||||
float hslAmountValue = ( 2.0 * texture( windNoise, mod( worldUV, vec2( 1,1 ) ) ).r - 1.0 );
|
float hslAmountValue = ( 2.0 * texture( windNoise, mod( worldUV, vec2( 1,1 ) ) ).r - 1.0 );
|
||||||
|
|
||||||
vec3 albedoHSL = RGBtoHSL( albedo.rgb ) + hslAmountValue * hslVariation.xyz;
|
vec3 albedoHSL = RGBtoHSL( albedo.rgb ) + hslAmountValue * hslVariation.xyz;
|
||||||
//albedoHSL = RGBtoHSL( albedo.rgb );
|
//albedoHSL = RGBtoHSL( albedo.rgb );
|
||||||
//albedoHSL.y *= 1.0;
|
//albedoHSL.y *= 1.0;
|
||||||
albedoHSL.x = mod( albedoHSL.x, 1 );
|
albedoHSL.x = mod( albedoHSL.x, 1 );
|
||||||
albedoHSL = clamp( albedoHSL, vec3( 0,0,0 ), vec3( 1,1,1 ) );
|
albedoHSL = clamp( albedoHSL, vec3( 0,0,0 ), vec3( 1,1,1 ) );
|
||||||
albedoColor = mix( albedo.rgb, HSLtoRGB( albedoHSL ), hslVariation.w );
|
albedoColor = mix( albedo.rgb, HSLtoRGB( albedoHSL ), hslVariation.w );
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if ( windEnabled )
|
if ( windEnabled )
|
||||||
{
|
{
|
||||||
float windAmount = normalizeToRange01( VERTEX.y, windStart, windEnd );
|
float windAmount = normalizeToRange01( VERTEX.y, windStart, windEnd );
|
||||||
float rawWindAmount = windAmount;
|
float rawWindAmount = windAmount;
|
||||||
windAmount = mix( windAmount, windAmount * windAmount, windWeightCurve );
|
windAmount = mix( windAmount, windAmount * windAmount, windWeightCurve );
|
||||||
vec2 windUV = TIME * windSpeed + worldVertex.xz * windScale;
|
vec2 windUV = TIME * windSpeed + worldVertex.xz * windScale;
|
||||||
float angle = texture( windNoise, windUV + windNoiseAngleOffset).r * PI * 2.0;
|
float angle = texture( windNoise, windUV + windNoiseAngleOffset).r * PI * 2.0;
|
||||||
float strength = texture( windNoise, windUV + windNoiseStrengthOffset ).r * windStrength;
|
float strength = texture( windNoise, windUV + windNoiseStrengthOffset ).r * windStrength;
|
||||||
|
@ -127,10 +127,10 @@ void vertex()
|
||||||
|
|
||||||
if ( obstaclesEnabeld )
|
if ( obstaclesEnabeld )
|
||||||
{
|
{
|
||||||
worldVertex = deform( worldVertex, obstacle1 );
|
worldVertex = deform( worldVertex, obstacle1 );
|
||||||
worldVertex = deform( worldVertex, obstacle2 );
|
worldVertex = deform( worldVertex, obstacle2 );
|
||||||
worldVertex = deform( worldVertex, obstacle3 );
|
worldVertex = deform( worldVertex, obstacle3 );
|
||||||
worldVertex = deform( worldVertex, obstacle4 );
|
worldVertex = deform( worldVertex, obstacle4 );
|
||||||
|
|
||||||
worldVertex = limitDeform( originalWorldVertex, worldVertex );
|
worldVertex = limitDeform( originalWorldVertex, worldVertex );
|
||||||
}
|
}
|
||||||
|
@ -138,31 +138,31 @@ void vertex()
|
||||||
VERTEX = worldToLocal( worldVertex, MODEL_MATRIX );
|
VERTEX = worldToLocal( worldVertex, MODEL_MATRIX );
|
||||||
float minY = min( VERTEX.y, 0 ); // VERTEX.y = mix( VERTEX.y, max( 0, VERTEX.y - strength * windAmount), windHeightCompensation * 2.0f );
|
float minY = min( VERTEX.y, 0 ); // VERTEX.y = mix( VERTEX.y, max( 0, VERTEX.y - strength * windAmount), windHeightCompensation * 2.0f );
|
||||||
VERTEX.y = mix( VERTEX.y, max( minY, VERTEX.y - strength * windAmount), windHeightCompensation * 4.0f );
|
VERTEX.y = mix( VERTEX.y, max( minY, VERTEX.y - strength * windAmount), windHeightCompensation * 4.0f );
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void fragment()
|
void fragment()
|
||||||
{
|
{
|
||||||
vec2 base_uv = UV;
|
vec2 base_uv = UV;
|
||||||
|
|
||||||
vec4 albedo_tex = texture(texture_albedo, base_uv);
|
vec4 albedo_tex = texture(texture_albedo, base_uv);
|
||||||
ALBEDO = albedoColor * albedo_tex.rgb;
|
ALBEDO = albedoColor * albedo_tex.rgb;
|
||||||
BACKLIGHT = ALBEDO * albedoToBacklight + backlight;
|
BACKLIGHT = ALBEDO * albedoToBacklight + backlight;
|
||||||
|
|
||||||
|
|
||||||
float metallic_tex = dot(texture(texture_metallic, base_uv), metallic_texture_channel);
|
float metallic_tex = dot(texture(texture_metallic, base_uv), metallic_texture_channel);
|
||||||
METALLIC = metallic_tex * metallic;
|
METALLIC = metallic_tex * metallic;
|
||||||
SPECULAR = specular;
|
SPECULAR = specular;
|
||||||
|
|
||||||
vec4 roughness_texture_channel = vec4(1.0, 0.0, 0.0, 0.0);
|
vec4 roughness_texture_channel = vec4(1.0, 0.0, 0.0, 0.0);
|
||||||
float roughness_tex = dot(texture(texture_roughness, base_uv), roughness_texture_channel);
|
float roughness_tex = dot(texture(texture_roughness, base_uv), roughness_texture_channel);
|
||||||
ROUGHNESS = roughness_tex * roughness;
|
ROUGHNESS = roughness_tex * roughness;
|
||||||
|
|
||||||
NORMAL_MAP = texture(texture_normal, base_uv).rgb;
|
NORMAL_MAP = texture(texture_normal, base_uv).rgb;
|
||||||
NORMAL_MAP_DEPTH = normal_scale;
|
NORMAL_MAP_DEPTH = normal_scale;
|
||||||
|
|
||||||
|
|
||||||
AO = dot(texture(texture_ambient_occlusion, base_uv), ao_texture_channel);
|
AO = dot(texture(texture_ambient_occlusion, base_uv), ao_texture_channel);
|
||||||
AO_LIGHT_AFFECT = ao_light_affect;
|
AO_LIGHT_AFFECT = ao_light_affect;
|
||||||
|
|
|
@ -47,6 +47,7 @@ namespace Rokojori
|
||||||
particles.FractDelta = false;
|
particles.FractDelta = false;
|
||||||
|
|
||||||
particles.CustomAabb = Box3.WithSize( 10000 );
|
particles.CustomAabb = Box3.WithSize( 10000 );
|
||||||
|
|
||||||
|
|
||||||
processMaterial.positionVariance.Set( renderLayer.renderer.noise );
|
processMaterial.positionVariance.Set( renderLayer.renderer.noise );
|
||||||
processMaterial.rotationVariance.Set( renderLayer.renderer.noise );
|
processMaterial.rotationVariance.Set( renderLayer.renderer.noise );
|
||||||
|
@ -60,6 +61,8 @@ namespace Rokojori
|
||||||
particles.DrawPasses = 1;
|
particles.DrawPasses = 1;
|
||||||
particles.DrawPass1 = meshInstance.Mesh;
|
particles.DrawPass1 = meshInstance.Mesh;
|
||||||
|
|
||||||
|
particles.CastShadow = GeometryInstance3D.ShadowCastingSetting.Off;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue