Small Sync
This commit is contained in:
parent
8520186939
commit
30a8243285
|
@ -1,7 +1,7 @@
|
||||||
[gd_resource type="Resource" script_class="HighlightEffect" load_steps=7 format=3 uid="uid://di1vy33cwab4s"]
|
[gd_resource type="Resource" script_class="HighlightEffect" load_steps=7 format=3 uid="uid://di1vy33cwab4s"]
|
||||||
|
|
||||||
[ext_resource type="Script" path="res://addons/rokojori_action_library/Runtime/Animation/HDRColor.cs" id="1_3edxo"]
|
[ext_resource type="Script" uid="uid://dncqth3uf3tb3" path="res://addons/rokojori_action_library/Runtime/Animation/HDRColor.cs" id="1_3edxo"]
|
||||||
[ext_resource type="Script" path="res://addons/rokojori_action_library/Runtime/Animation/Highlight/HighlightEffect.cs" id="2_itc7c"]
|
[ext_resource type="Script" uid="uid://dkbln8rf5p0pu" path="res://addons/rokojori_action_library/Runtime/Animation/Highlight/HighlightEffect.cs" id="2_itc7c"]
|
||||||
[ext_resource type="Resource" uid="uid://h6oi6vkj4c2m" path="res://addons/rokojori_action_library/Runtime/Time/TimeLines/RealTime.tres" id="3_ttsky"]
|
[ext_resource type="Resource" uid="uid://h6oi6vkj4c2m" path="res://addons/rokojori_action_library/Runtime/Time/TimeLines/RealTime.tres" id="3_ttsky"]
|
||||||
|
|
||||||
[sub_resource type="Resource" id="Resource_27v41"]
|
[sub_resource type="Resource" id="Resource_27v41"]
|
||||||
|
|
|
@ -0,0 +1,25 @@
|
||||||
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Text.RegularExpressions;
|
||||||
|
using System.Text;
|
||||||
|
using Godot;
|
||||||
|
|
||||||
|
namespace Rokojori
|
||||||
|
{
|
||||||
|
|
||||||
|
[Tool]
|
||||||
|
[GlobalClass]
|
||||||
|
public partial class SetPointableHighlightEffect:Action
|
||||||
|
{
|
||||||
|
[Export]
|
||||||
|
public Pointable pointable;
|
||||||
|
|
||||||
|
[Export]
|
||||||
|
public HighlightEffect effect;
|
||||||
|
|
||||||
|
protected override void _OnTrigger()
|
||||||
|
{
|
||||||
|
pointable.highlightEffect = effect;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1 @@
|
||||||
|
uid://df8jef254lau7
|
|
@ -48,14 +48,14 @@ namespace Rokojori.PointClouds
|
||||||
|
|
||||||
public MeshGeometry GenerateMeshGeometry( float normalOffset = 0f )
|
public MeshGeometry GenerateMeshGeometry( float normalOffset = 0f )
|
||||||
{
|
{
|
||||||
var mg = new MeshGeometry( true, false, true, false );
|
var mg = new MeshGeometry( false, false, false, false );
|
||||||
mg.customMeshAttributes.Add( new MeshAttributeVector4List( 0 ) );
|
mg.customMeshAttributes.Add( new MeshAttributeVector4List( 0 ) );
|
||||||
mg.customMeshAttributes.Add( new MeshAttributeVector4List( 1 ) );
|
mg.customMeshAttributes.Add( new MeshAttributeVector4List( 1 ) );
|
||||||
|
|
||||||
points.ForEach(
|
points.ForEach(
|
||||||
( p ) =>
|
( p ) =>
|
||||||
{
|
{
|
||||||
mg.AddPoint( p.position + p.normal * normalOffset, p.color.srgbToLinear(), p.normal, 0, p.uv, 1 );
|
mg.AddPoint( p.position + p.normal * normalOffset, p.normal, 0, p.uv, 1 );
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
@ -58,6 +58,8 @@ namespace Rokojori.PointClouds
|
||||||
[Export]
|
[Export]
|
||||||
bool working = false;
|
bool working = false;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
[Export]
|
[Export]
|
||||||
public string[] outputInfos = [];
|
public string[] outputInfos = [];
|
||||||
|
|
||||||
|
|
|
@ -828,6 +828,14 @@ namespace Rokojori
|
||||||
indices.Add( indices.Count );
|
indices.Add( indices.Count );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void AddPoint( Vector3 position, Vector3 normal, int normalIndex, Vector2 uv, int uvIndex )
|
||||||
|
{
|
||||||
|
vertices.Add( position );
|
||||||
|
( (MeshAttributeVector4List) customMeshAttributes[ normalIndex ] ).values.Add( new Vector4( normal.X, normal.Y, normal.Z, 0.0f ) );
|
||||||
|
( (MeshAttributeVector4List) customMeshAttributes[ uvIndex ] ).values.Add( new Vector4( uv.X, uv.Y, 0.0f, 0.0f ) );
|
||||||
|
|
||||||
|
indices.Add( indices.Count );
|
||||||
|
}
|
||||||
|
|
||||||
public void Add( MeshGeometry sourceGeometry, Transform3D? optionalTransform = null, List<int> indicesTarget = null )
|
public void Add( MeshGeometry sourceGeometry, Transform3D? optionalTransform = null, List<int> indicesTarget = null )
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
shader_type spatial;
|
shader_type spatial;
|
||||||
render_mode blend_mix, cull_back, unshaded;
|
render_mode blend_mul, cull_back, unshaded;
|
||||||
|
|
||||||
uniform vec4 shadowTopColor : source_color;
|
uniform vec4 shadowTopColor : source_color;
|
||||||
uniform vec4 shadowBottomColor: source_color;
|
uniform vec4 shadowBottomColor: source_color;
|
||||||
|
@ -15,9 +15,10 @@ void vertex()
|
||||||
void fragment()
|
void fragment()
|
||||||
{
|
{
|
||||||
vec4 mixedColor = mix( shadowTopColor, shadowBottomColor, UV.y );
|
vec4 mixedColor = mix( shadowTopColor, shadowBottomColor, UV.y );
|
||||||
ALBEDO = mixedColor.rgb;
|
|
||||||
|
|
||||||
float d = scaling * length ( UV - vec2( 0.5, 0.5 ) ) / length( vec2( 0.5, 0.5 ));
|
float d = scaling * length ( UV - vec2( 0.5, 0.5 ) ) / length( vec2( 0.5, 0.5 ));
|
||||||
ALPHA *= min( 1.0, mixedColor.a * opacity * d );
|
ALPHA *= min( 1.0, mixedColor.a * opacity * d * 0.7);
|
||||||
|
ALBEDO = mix( mixedColor.rgb, vec3( 1 ), 1.0 - ALPHA );
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue