diff --git a/Runtime/Animation/Highlight/Presets/Yellow Scan Outline - Highlight.tres b/Runtime/Animation/Highlight/Presets/Yellow Scan Outline - Highlight.tres index 4bdf5cb..1d2bf21 100644 --- a/Runtime/Animation/Highlight/Presets/Yellow Scan Outline - Highlight.tres +++ b/Runtime/Animation/Highlight/Presets/Yellow Scan Outline - Highlight.tres @@ -1,7 +1,7 @@ [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" path="res://addons/rokojori_action_library/Runtime/Animation/Highlight/HighlightEffect.cs" id="2_itc7c"] +[ext_resource type="Script" uid="uid://dncqth3uf3tb3" path="res://addons/rokojori_action_library/Runtime/Animation/HDRColor.cs" id="1_3edxo"] +[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"] [sub_resource type="Resource" id="Resource_27v41"] diff --git a/Runtime/Animation/Highlight/SetPointableHighlightEffect.cs b/Runtime/Animation/Highlight/SetPointableHighlightEffect.cs new file mode 100644 index 0000000..de179ff --- /dev/null +++ b/Runtime/Animation/Highlight/SetPointableHighlightEffect.cs @@ -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; + } + } +} \ No newline at end of file diff --git a/Runtime/Animation/Highlight/SetPointableHighlightEffect.cs.uid b/Runtime/Animation/Highlight/SetPointableHighlightEffect.cs.uid new file mode 100644 index 0000000..cfea87f --- /dev/null +++ b/Runtime/Animation/Highlight/SetPointableHighlightEffect.cs.uid @@ -0,0 +1 @@ +uid://df8jef254lau7 diff --git a/Runtime/LOD/PointClouds/PointCloud.cs b/Runtime/LOD/PointClouds/PointCloud.cs index 291cfae..4eb1359 100644 --- a/Runtime/LOD/PointClouds/PointCloud.cs +++ b/Runtime/LOD/PointClouds/PointCloud.cs @@ -48,14 +48,14 @@ namespace Rokojori.PointClouds 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( 1 ) ); points.ForEach( ( 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 ); } ); diff --git a/Runtime/LOD/PointClouds/PointCloudGenerator.cs b/Runtime/LOD/PointClouds/PointCloudGenerator.cs index 4043210..01da5cd 100644 --- a/Runtime/LOD/PointClouds/PointCloudGenerator.cs +++ b/Runtime/LOD/PointClouds/PointCloudGenerator.cs @@ -58,6 +58,8 @@ namespace Rokojori.PointClouds [Export] bool working = false; + + [Export] public string[] outputInfos = []; diff --git a/Runtime/Procedural/Mesh/MeshGeometry.cs b/Runtime/Procedural/Mesh/MeshGeometry.cs index 1f855bf..2f679d0 100644 --- a/Runtime/Procedural/Mesh/MeshGeometry.cs +++ b/Runtime/Procedural/Mesh/MeshGeometry.cs @@ -828,6 +828,14 @@ namespace Rokojori 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 indicesTarget = null ) { diff --git a/Runtime/Reallusion/Shaders/CCEyeOcclusion.gdshader b/Runtime/Reallusion/Shaders/CCEyeOcclusion.gdshader index 9271523..6a79af2 100644 --- a/Runtime/Reallusion/Shaders/CCEyeOcclusion.gdshader +++ b/Runtime/Reallusion/Shaders/CCEyeOcclusion.gdshader @@ -1,5 +1,5 @@ shader_type spatial; -render_mode blend_mix, cull_back, unshaded; +render_mode blend_mul, cull_back, unshaded; uniform vec4 shadowTopColor : source_color; uniform vec4 shadowBottomColor: source_color; @@ -15,9 +15,10 @@ void vertex() void fragment() { 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 )); - 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 ); }