SensorManager Fix

This commit is contained in:
Josef 2025-06-12 11:03:02 +02:00
parent 30a8243285
commit b475d5141a
45 changed files with 1322 additions and 133 deletions

View File

@ -188,6 +188,7 @@ namespace Rokojori
}
[Tool]
[GlobalClass, Icon("res://addons/rokojori_action_library/Icons/ActionSequence.svg") ]
public partial class ActionSequence:SequenceAction
{

View File

@ -26,7 +26,7 @@ namespace Rokojori
{
var conditionActive = Condition.Evaluate( condition ) && SceneCondition.Evaluate( sceneCondition );
this.LogInfo( "Condition is", conditionActive );
// this.LogInfo( "Condition is", conditionActive );
if ( conditionActive )
{

View File

@ -1,5 +1,6 @@
using Godot;
using System.Collections.Generic;
namespace Rokojori
{
@ -7,11 +8,91 @@ namespace Rokojori
public partial class PlaySound:Action
{
[Export]
public AudioStreamPlayer player;
public AudioStreamPlayer3D player;
[ExportGroup("Randomize Playback Position")]
[Export]
public bool randomizePlaybackPosition = false;
[Export]
public Duration durationPerSound;
[Export]
public bool generatePools = true;
List<AudioStreamPlayer3D> players = new List<AudioStreamPlayer3D>();
AudioStreamPlayer3D GetFreePlayer()
{
if ( players.Count == 0 )
{
players.Add( player );
}
var freePlayer = players.Find( p => ! p.Playing );
if ( freePlayer != null )
{
return freePlayer;
}
var newPlayer = player.GetParent().CreateChild<AudioStreamPlayer3D>();
newPlayer.Stream = player.Stream;
newPlayer.VolumeDb = player.VolumeDb;
newPlayer.MaxDb = player.MaxDb;
newPlayer.UnitSize = player.UnitSize;
newPlayer.AttenuationModel = player.AttenuationModel;
players.Add( newPlayer );
return newPlayer;
}
protected override void _OnTrigger()
{
player.Play();
var offset = 0f;
var player = generatePools ? GetFreePlayer() : this.player;
if ( randomizePlaybackPosition )
{
var random = LCG.WithSeed( networkSeed );
var length = player.Stream.GetLength();
var numOffsets = Mathf.FloorToInt( length / durationPerSound.GetDurationInSeconds() );
var randomIndex = random.IntegerExclusive( numOffsets );
offset = randomIndex * durationPerSound.GetDurationInSeconds();
// this.LogInfo( "Offset", numOffsets, randomIndex, offset );
}
player.Play( offset );
if ( randomizePlaybackPosition )
{
var tl = TimeLineManager.Ensure( durationPerSound.timeLine );
var start = tl.position;
TimeLineManager.ScheduleSpanIn( durationPerSound.timeLine, 0, durationPerSound.GetDurationInSeconds(),
( span, type )=>
{
var timeNow = tl.position;
var elapsed = timeNow - start;
var phase = span.phase;
if ( type == TimeLineSpanUpdateType.End )
{
player.Stop();
player.Playing = false;
}
}
);
}
}
}
}

View File

@ -25,13 +25,10 @@ namespace Rokojori
}
[Export]
public float duration;
public Duration tickDuration;
[Export]
public float offset;
[Export]
public TimeLine timeLine;
public Duration offsetDuration;
int _eventID = -1;
@ -44,12 +41,18 @@ namespace Rokojori
_active = active;
var timeLine = tickDuration.timeLine;
if ( _active )
{
var duration = tickDuration.GetDurationInSeconds();
var offset = offsetDuration.GetDurationInSeconds();
// this.LogInfo( "duration", duration, "offset", offset );
if ( _eventID != -1 )
{
TimeLineManager.RemoveEvent( timeLine, _eventID );
return;
}
var tle = TimeLineManager.ScheduleLoopEvent( timeLine, duration, offset, tle => Action.Trigger( action ) );

View File

@ -10,7 +10,6 @@ namespace Rokojori
[Export]
public Action action;
[Export]
public int maxNumRepeats = 3;

View File

@ -0,0 +1,27 @@
using Godot;
namespace Rokojori
{
[Tool]
[GlobalClass]
public partial class SetTick: Action
{
[Export]
public OnTick tick;
[Export]
public bool active = true;
protected override void _OnTrigger()
{
if ( tick == null )
{
return;
}
tick.active = active;
}
}
}

View File

@ -0,0 +1 @@
uid://cow7sv7kn0moo

View File

@ -68,7 +68,7 @@ namespace Rokojori
}
);
[ExportToolButton( "Get Material Delta")]
[ExportToolButton( "Log Material Delta")]
public Callable GetMaterialDeltaButton => Callable.From(
() =>
{
@ -98,7 +98,7 @@ namespace Rokojori
var delta = MaterialDelta.Create( fromMaterial, toMaterial );
this.LogInfo( "Delta:", delta );
// this.LogInfo( "Delta:", delta );
colors = delta.colorProperties.ToArray();

View File

@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Text.RegularExpressions;
using System.Text;
using Godot;
using System.Linq;
namespace Rokojori
{
@ -15,13 +16,13 @@ namespace Rokojori
public class HighlightAnimation
{
public HighlightEffect effect;
public Node3D[] targets = new Node3D[ 0 ];
public int tweenID = -1;
public List<Material> materials = new List<Material>();
public float phase;
}
[Tool]
@ -97,9 +98,10 @@ namespace Rokojori
List<HighlightAnimation> _active = new List<HighlightAnimation>();
protected static Dictionary<Node3D,HighlightEffect> highlighted = new Dictionary<Node3D, HighlightEffect>();
public void Highlight( HighlightActionType type, Node3D[] targets )
{
if ( HighlightActionType.Start == type )
{
StartHighlight( targets );
@ -110,10 +112,87 @@ namespace Rokojori
}
}
void ClearHighlight( HighlightAnimation animation )
{
for ( int i = 0; i < animation.targets.Length; i ++ )
{
Materials.RemoveOverlay( animation.targets[ i ], animation.materials[ i ] );
}
_active.Remove( animation );
animation.targets.ForEach(
( t )=>
{
if ( highlighted.ContainsKey( t ) && highlighted[ t ] == this )
{
highlighted.Remove( t );
}
}
);
}
public static void CancelHighlight( Node3D[] targets )
{
RJLog.Log( "CancelHighlight", HierarchyName.Of( targets ) );
targets.ForEach( t => CancelHighlight( t ) );
}
public static void CancelHighlight( Node3D node )
{
RJLog.Log( "CancelHighlight", HierarchyName.Of( node ) );
if ( ! highlighted.ContainsKey( node ) )
{
RJLog.Log( "Not highlighted", node );
return;
}
var highlightEffect = highlighted[ node ];
if ( highlightEffect == null )
{
RJLog.Log( "Not highlighted", node );
return;
}
var animations = highlightEffect._active;
var removals = animations.Filter( a => a.targets.Contains( node ) );
var numRemoved = 0;
removals.ForEach(
( r )=>
{
RJLog.Log( "Removing animation", r );
highlightEffect.ClearHighlight( r );
numRemoved ++;
}
);
RJLog.Log( "Removed animations", numRemoved );
Lists.RemoveRange( animations, removals );
}
void StartHighlight( Node3D[] targets )
{
var animation = _active.Find( a => Arrays.AreEntriesEqual( a.targets, targets ) );
targets.ForEach(
( t )=>
{
highlighted[ t ] = this;
}
);
var hdrColor = color.GetHDRColor();
var colorTransparent = ColorX.Fade( hdrColor, 0 );
@ -194,6 +273,11 @@ namespace Rokojori
return;
}
if ( ! _active.Contains( animation ) )
{
return;
}
var phase = span.phase;
@ -268,6 +352,7 @@ namespace Rokojori
return;
}
var startPhase = animation.phase;
var hdrColor = ColorX.Fade( color.GetHDRColor(), startPhase );
var colorTransparent = ColorX.Fade( hdrColor, 0 );
@ -281,6 +366,11 @@ namespace Rokojori
return;
}
if ( ! _active.Contains( animation ) )
{
return;
}
animation.phase = MathX.Map( span.phase, 0, 1, startPhase, 0 );
var p = animation.phase;
@ -301,12 +391,7 @@ namespace Rokojori
tweenColor = colorTransparent;
animation.phase = 0;
for ( int i = 0; i < animation.targets.Length; i ++ )
{
Materials.RemoveOverlay( targets[ i ], animation.materials[ i ] );
}
_active.Remove( animation );
ClearHighlight( animation );
}
else
{

View File

@ -17,9 +17,20 @@ namespace Rokojori
[Export]
public HighlightEffect effect;
[Export]
public bool startHighlight = false;
protected override void _OnTrigger()
{
this.LogInfo( "Change Hightlight", HierarchyName.Of( effect ) );
pointable.highlightEffect = effect;
if ( effect != null && startHighlight )
{
HighlightEffect.CancelHighlight( pointable.highlightTargets );
effect.Highlight( HighlightActionType.Start, [ pointable ] );
}
}
}
}

View File

@ -1,6 +1,7 @@
using Godot;
using System.Text;
using System.Collections.Generic;
using System.Linq;
namespace Rokojori
{
@ -47,6 +48,11 @@ namespace Rokojori
}
public static string Of( Node[] nodes, string seperator = " ▸ " )
{
return "{\n" + nodes.ToList().Map( n => Of( n, seperator ) ).Join( "\n" ) + "\n}";
}
public static string Of( Node node, string seperator = " ▸ " )
{
if ( node == null )

View File

@ -49,6 +49,21 @@ namespace Rokojori
[Export]
public Smoothing inAirMovementSmoothing = new FrameSmoothing();
bool _onFloor = false;
bool _moving = false;
[Export]
public float movingSpeedTreshold = 0.01f;
[Export]
public Action onStartedMoving;
[Export]
public Action onStoppedMoving;
public bool isOnFloor => _onFloor;
public bool isMoving => _moving;
[ExportGroup( "Rotation" )]
@ -65,9 +80,12 @@ namespace Rokojori
protected CharacterMovementData characterMovementData = new CharacterMovementData();
protected override void _OnTrigger()
{
var onFloor = body.IsOnFloor();
_onFloor = onFloor;
characterMovementData.Reset( this );
@ -122,6 +140,23 @@ namespace Rokojori
smoothedMovement = inAirMovementSmoothing.Smooth( characterMovementData.movement, controller.delta );
}
var wasMoving = _moving;
_moving = smoothedMovement.Length() > movingSpeedTreshold;
if ( wasMoving != _moving )
{
if ( _moving )
{
Trigger( onStartedMoving );
}
else
{
Trigger( onStoppedMoving );
}
this.LogInfo( "Moving:", _moving );
}
Velocity( smoothedMovement, onFloor );
}

View File

@ -0,0 +1,34 @@
using Godot;
using System.Collections;
using System.Collections.Generic;
using Godot.Collections;
namespace Rokojori
{
[Tool]
[GlobalClass]
public partial class CharacterIsMoving:SceneCondition
{
[Export]
public CharacterMovement characterMovement;
[Export]
public Trillean needsToBeOnFloor = Trillean.Any;
public override bool Evaluate()
{
if ( characterMovement == null )
{
return false;
}
if ( ! TrilleanLogic.Matches( needsToBeOnFloor, characterMovement.isOnFloor, true ) )
{
return false;
}
return characterMovement.isMoving;
}
}
}

View File

@ -0,0 +1 @@
uid://bwq7e6cx2oy8n

View File

@ -45,6 +45,7 @@ namespace Rokojori
public override void _Ready()
{
this.LogInfo( "Register" );
SensorManager.Register( this, button );
}

View File

@ -41,8 +41,8 @@ namespace Rokojori
if ( pointable != null )
{
Highlight( HighlightActionType.End, pointable );
pointable.UpdatePointerState( this, false );
Highlight( HighlightActionType.End, pointable );
}
pointable = currentPointable;
@ -66,7 +66,9 @@ namespace Rokojori
return;
}
var highlightEffect = p.highlightEffect ?? defaultHighlighter;
// this.LogInfo( "Set Highlight", highlightEffect == null ? "<null>" : HierarchyName.Of( highlightEffect ) );
highlightEffect.Highlight( type, p.highlightTargets );

View File

@ -714,6 +714,21 @@ namespace Rokojori
return ! ( q.IsFinite() || q.IsZero() );
}
public static bool IsValid( this Vector3 v )
{
if ( float.IsNaN( v.X ) || float.IsNaN( v.Y ) || float.IsNaN( v.Z ) )
{
return false;
}
if ( float.IsInfinity( v.X ) || float.IsInfinity( v.Y ) || float.IsInfinity( v.Z ) )
{
return false;
}
return true;
}
public static Quaternion GetNormalized( this Quaternion q )
{
if ( q.IsValid() )

View File

@ -480,6 +480,8 @@ namespace Rokojori.Reallusion
mat.rootMap.AssignFor( m, customShader.value.GetHairRootMap() );
mat.idMap.AssignFor( m, customShader.value.GetHairIDMap() );
mat.anisotropyRatio.AssignFor( m, settings.configuration.anisotropicRatio );
mat.vertexGreyToColor.AssignFor( m, customShader.value.GetColorVariable( "VertexGrayToColor", 255f, false ) );
mat.vertexColorStrength.AssignFor( m, customShader.value.GetFloatVariable( "VertexColorStrength" ) );
mat.diffuseStrength.AssignFor( m, customShader.value.GetFloatVariable( "Diffuse Strength" ) );

View File

@ -58,6 +58,9 @@ namespace Rokojori.Reallusion
[Export]
public float hairOpacityGamma = 1.2f;
[Export]
public float anisotropicRatio = 1.0f;
[Export]
public CCHairOpacityGammaOverwrite[] hairOpacityGammaOverwrites = [];

View File

@ -1,3 +1,4 @@
#include "res://addons/rokojori_action_library/Runtime/Shading/Library/Colors.gdshaderinc"
#include "res://addons/rokojori_action_library/Runtime/Shading/Library/Textures.gdshaderinc"
#include "res://addons/rokojori_action_library/Runtime/Shading/Library/Math.gdshaderinc"

View File

@ -34,24 +34,20 @@ namespace Rokojori
public static readonly FloatPropertyName strandEndStrength = FloatPropertyName.Create( "strandEndStrength" );
public static readonly FloatPropertyName strandGamma = FloatPropertyName.Create( "strandGamma" );
public static readonly FloatPropertyName maximumHighlightAmount = FloatPropertyName.Create( "maximumHighlightAmount" );
public static readonly FloatPropertyName highlightFadeOutStart = FloatPropertyName.Create( "highlightFadeOutStart" );
public static readonly FloatPropertyName highlightFadeOutEnd = FloatPropertyName.Create( "highlightFadeOutEnd" );
public static readonly FloatPropertyName highlightFadeOutPower = FloatPropertyName.Create( "highlightFadeOutPower" );
public static readonly FloatPropertyName highlightFadeOutAmount = FloatPropertyName.Create( "highlightFadeOutAmount" );
public static readonly ColorPropertyName highlightAColor = ColorPropertyName.Create( "highlightAColor" );
public static readonly FloatPropertyName highlightAStrength = FloatPropertyName.Create( "highlightAStrength" );
public static readonly Vector3PropertyName highlightARange = Vector3PropertyName.Create( "highlightARange" );
public static readonly FloatPropertyName highlightAOverlapEnd = FloatPropertyName.Create( "highlightAOverlapEnd" );
public static readonly FloatPropertyName highlightAInvert = FloatPropertyName.Create( "highlightAInvert" );
public static readonly FloatPropertyName highlightAFadeOutStart = FloatPropertyName.Create( "highlightAFadeOutStart" );
public static readonly FloatPropertyName highlightAFadeOutRange = FloatPropertyName.Create( "highlightAFadeOutRange" );
public static readonly FloatPropertyName highlightAFadeOutPower = FloatPropertyName.Create( "highlightAFadeOutPower" );
public static readonly FloatPropertyName highlightAFadeOutAmount = FloatPropertyName.Create( "highlightAFadeOutAmount" );
public static readonly ColorPropertyName highlightBColor = ColorPropertyName.Create( "highlightBColor" );
public static readonly FloatPropertyName highlightBStrength = FloatPropertyName.Create( "highlightBStrength" );
public static readonly Vector3PropertyName highlightBRange = Vector3PropertyName.Create( "highlightBRange" );
public static readonly FloatPropertyName highlightBOverlapEnd = FloatPropertyName.Create( "highlightBOverlapEnd" );
public static readonly FloatPropertyName highlightBInvert = FloatPropertyName.Create( "highlightBInvert" );
public static readonly FloatPropertyName highlightBFadeOutStart = FloatPropertyName.Create( "highlightBFadeOutStart" );
public static readonly FloatPropertyName highlightBFadeOutRange = FloatPropertyName.Create( "highlightBFadeOutRange" );
public static readonly FloatPropertyName highlightBFadeOutPower = FloatPropertyName.Create( "highlightBFadeOutPower" );
public static readonly FloatPropertyName highlightBFadeOutAmount = FloatPropertyName.Create( "highlightBFadeOutAmount" );
public static readonly FloatPropertyName roughness = FloatPropertyName.Create( "roughness" );
public static readonly FloatPropertyName roughnessOffset = FloatPropertyName.Create( "roughnessOffset" );
public static readonly Texture2DPropertyName textureRoughness = Texture2DPropertyName.Create( "texture_roughness" );
@ -59,12 +55,16 @@ namespace Rokojori
public static readonly FloatPropertyName metallicOffset = FloatPropertyName.Create( "metallicOffset" );
public static readonly Texture2DPropertyName textureMetallic = Texture2DPropertyName.Create( "texture_metallic" );
public static readonly FloatPropertyName specular = FloatPropertyName.Create( "specular" );
public static readonly FloatPropertyName specularOpacityAmount = FloatPropertyName.Create( "specularOpacityAmount" );
public static readonly FloatPropertyName specularOpacityGamma = FloatPropertyName.Create( "specularOpacityGamma" );
public static readonly FloatPropertyName anisotropyRatio = FloatPropertyName.Create( "anisotropy_ratio" );
public static readonly Texture2DPropertyName textureEmission = Texture2DPropertyName.Create( "texture_emission" );
public static readonly ColorPropertyName emission = ColorPropertyName.Create( "emission" );
public static readonly FloatPropertyName emissionEnergy = FloatPropertyName.Create( "emission_energy" );
public static readonly ColorPropertyName backlight = ColorPropertyName.Create( "backlight" );
public static readonly FloatPropertyName albedoToBacklightAmount = FloatPropertyName.Create( "albedoToBacklightAmount" );
public static readonly Texture2DPropertyName textureBacklight = Texture2DPropertyName.Create( "texture_backlight" );
public static readonly FloatPropertyName subsurfaceScatteringStrength = FloatPropertyName.Create( "subsurface_scattering_strength" );
public static readonly Texture2DPropertyName textureAmbientOcclusion = Texture2DPropertyName.Create( "texture_ambient_occlusion" );
public static readonly FloatPropertyName aoLightAffect = FloatPropertyName.Create( "ao_light_affect" );
public static readonly FloatPropertyName ambientOcclusion = FloatPropertyName.Create( "ambientOcclusion" );
@ -73,6 +73,7 @@ namespace Rokojori
public static readonly FloatPropertyName rootOcclusionRange = FloatPropertyName.Create( "rootOcclusionRange" );
public static readonly FloatPropertyName endOcclusionAmount = FloatPropertyName.Create( "endOcclusionAmount" );
public static readonly FloatPropertyName endOcclusionRange = FloatPropertyName.Create( "endOcclusionRange" );
public static readonly FloatPropertyName rootBasedOcclusion = FloatPropertyName.Create( "rootBasedOcclusion" );
}
@ -105,24 +106,20 @@ namespace Rokojori
public readonly CustomMaterialProperty<float> strandEndStrength;
public readonly CustomMaterialProperty<float> strandGamma;
public readonly CustomMaterialProperty<float> maximumHighlightAmount;
public readonly CustomMaterialProperty<float> highlightFadeOutStart;
public readonly CustomMaterialProperty<float> highlightFadeOutEnd;
public readonly CustomMaterialProperty<float> highlightFadeOutPower;
public readonly CustomMaterialProperty<float> highlightFadeOutAmount;
public readonly CustomMaterialProperty<Color> highlightAColor;
public readonly CustomMaterialProperty<float> highlightAStrength;
public readonly CustomMaterialProperty<Vector3> highlightARange;
public readonly CustomMaterialProperty<float> highlightAOverlapEnd;
public readonly CustomMaterialProperty<float> highlightAInvert;
public readonly CustomMaterialProperty<float> highlightAFadeOutStart;
public readonly CustomMaterialProperty<float> highlightAFadeOutRange;
public readonly CustomMaterialProperty<float> highlightAFadeOutPower;
public readonly CustomMaterialProperty<float> highlightAFadeOutAmount;
public readonly CustomMaterialProperty<Color> highlightBColor;
public readonly CustomMaterialProperty<float> highlightBStrength;
public readonly CustomMaterialProperty<Vector3> highlightBRange;
public readonly CustomMaterialProperty<float> highlightBOverlapEnd;
public readonly CustomMaterialProperty<float> highlightBInvert;
public readonly CustomMaterialProperty<float> highlightBFadeOutStart;
public readonly CustomMaterialProperty<float> highlightBFadeOutRange;
public readonly CustomMaterialProperty<float> highlightBFadeOutPower;
public readonly CustomMaterialProperty<float> highlightBFadeOutAmount;
public readonly CustomMaterialProperty<float> roughness;
public readonly CustomMaterialProperty<float> roughnessOffset;
public readonly CustomMaterialProperty<Texture2D> textureRoughness;
@ -130,12 +127,16 @@ namespace Rokojori
public readonly CustomMaterialProperty<float> metallicOffset;
public readonly CustomMaterialProperty<Texture2D> textureMetallic;
public readonly CustomMaterialProperty<float> specular;
public readonly CustomMaterialProperty<float> specularOpacityAmount;
public readonly CustomMaterialProperty<float> specularOpacityGamma;
public readonly CustomMaterialProperty<float> anisotropyRatio;
public readonly CustomMaterialProperty<Texture2D> textureEmission;
public readonly CustomMaterialProperty<Color> emission;
public readonly CustomMaterialProperty<float> emissionEnergy;
public readonly CustomMaterialProperty<Color> backlight;
public readonly CustomMaterialProperty<float> albedoToBacklightAmount;
public readonly CustomMaterialProperty<Texture2D> textureBacklight;
public readonly CustomMaterialProperty<float> subsurfaceScatteringStrength;
public readonly CustomMaterialProperty<Texture2D> textureAmbientOcclusion;
public readonly CustomMaterialProperty<float> aoLightAffect;
public readonly CustomMaterialProperty<float> ambientOcclusion;
@ -144,6 +145,7 @@ namespace Rokojori
public readonly CustomMaterialProperty<float> rootOcclusionRange;
public readonly CustomMaterialProperty<float> endOcclusionAmount;
public readonly CustomMaterialProperty<float> endOcclusionRange;
public readonly CustomMaterialProperty<float> rootBasedOcclusion;
public CCHairAlphaBackMaterial()
{
@ -173,24 +175,20 @@ namespace Rokojori
strandEndStrength = new CustomMaterialProperty<float>( this, CCHairAlphaBackShader.strandEndStrength );
strandGamma = new CustomMaterialProperty<float>( this, CCHairAlphaBackShader.strandGamma );
maximumHighlightAmount = new CustomMaterialProperty<float>( this, CCHairAlphaBackShader.maximumHighlightAmount );
highlightFadeOutStart = new CustomMaterialProperty<float>( this, CCHairAlphaBackShader.highlightFadeOutStart );
highlightFadeOutEnd = new CustomMaterialProperty<float>( this, CCHairAlphaBackShader.highlightFadeOutEnd );
highlightFadeOutPower = new CustomMaterialProperty<float>( this, CCHairAlphaBackShader.highlightFadeOutPower );
highlightFadeOutAmount = new CustomMaterialProperty<float>( this, CCHairAlphaBackShader.highlightFadeOutAmount );
highlightAColor = new CustomMaterialProperty<Color>( this, CCHairAlphaBackShader.highlightAColor );
highlightAStrength = new CustomMaterialProperty<float>( this, CCHairAlphaBackShader.highlightAStrength );
highlightARange = new CustomMaterialProperty<Vector3>( this, CCHairAlphaBackShader.highlightARange );
highlightAOverlapEnd = new CustomMaterialProperty<float>( this, CCHairAlphaBackShader.highlightAOverlapEnd );
highlightAInvert = new CustomMaterialProperty<float>( this, CCHairAlphaBackShader.highlightAInvert );
highlightAFadeOutStart = new CustomMaterialProperty<float>( this, CCHairAlphaBackShader.highlightAFadeOutStart );
highlightAFadeOutRange = new CustomMaterialProperty<float>( this, CCHairAlphaBackShader.highlightAFadeOutRange );
highlightAFadeOutPower = new CustomMaterialProperty<float>( this, CCHairAlphaBackShader.highlightAFadeOutPower );
highlightAFadeOutAmount = new CustomMaterialProperty<float>( this, CCHairAlphaBackShader.highlightAFadeOutAmount );
highlightBColor = new CustomMaterialProperty<Color>( this, CCHairAlphaBackShader.highlightBColor );
highlightBStrength = new CustomMaterialProperty<float>( this, CCHairAlphaBackShader.highlightBStrength );
highlightBRange = new CustomMaterialProperty<Vector3>( this, CCHairAlphaBackShader.highlightBRange );
highlightBOverlapEnd = new CustomMaterialProperty<float>( this, CCHairAlphaBackShader.highlightBOverlapEnd );
highlightBInvert = new CustomMaterialProperty<float>( this, CCHairAlphaBackShader.highlightBInvert );
highlightBFadeOutStart = new CustomMaterialProperty<float>( this, CCHairAlphaBackShader.highlightBFadeOutStart );
highlightBFadeOutRange = new CustomMaterialProperty<float>( this, CCHairAlphaBackShader.highlightBFadeOutRange );
highlightBFadeOutPower = new CustomMaterialProperty<float>( this, CCHairAlphaBackShader.highlightBFadeOutPower );
highlightBFadeOutAmount = new CustomMaterialProperty<float>( this, CCHairAlphaBackShader.highlightBFadeOutAmount );
roughness = new CustomMaterialProperty<float>( this, CCHairAlphaBackShader.roughness );
roughnessOffset = new CustomMaterialProperty<float>( this, CCHairAlphaBackShader.roughnessOffset );
textureRoughness = new CustomMaterialProperty<Texture2D>( this, CCHairAlphaBackShader.textureRoughness );
@ -198,12 +196,16 @@ namespace Rokojori
metallicOffset = new CustomMaterialProperty<float>( this, CCHairAlphaBackShader.metallicOffset );
textureMetallic = new CustomMaterialProperty<Texture2D>( this, CCHairAlphaBackShader.textureMetallic );
specular = new CustomMaterialProperty<float>( this, CCHairAlphaBackShader.specular );
specularOpacityAmount = new CustomMaterialProperty<float>( this, CCHairAlphaBackShader.specularOpacityAmount );
specularOpacityGamma = new CustomMaterialProperty<float>( this, CCHairAlphaBackShader.specularOpacityGamma );
anisotropyRatio = new CustomMaterialProperty<float>( this, CCHairAlphaBackShader.anisotropyRatio );
textureEmission = new CustomMaterialProperty<Texture2D>( this, CCHairAlphaBackShader.textureEmission );
emission = new CustomMaterialProperty<Color>( this, CCHairAlphaBackShader.emission );
emissionEnergy = new CustomMaterialProperty<float>( this, CCHairAlphaBackShader.emissionEnergy );
backlight = new CustomMaterialProperty<Color>( this, CCHairAlphaBackShader.backlight );
albedoToBacklightAmount = new CustomMaterialProperty<float>( this, CCHairAlphaBackShader.albedoToBacklightAmount );
textureBacklight = new CustomMaterialProperty<Texture2D>( this, CCHairAlphaBackShader.textureBacklight );
subsurfaceScatteringStrength = new CustomMaterialProperty<float>( this, CCHairAlphaBackShader.subsurfaceScatteringStrength );
textureAmbientOcclusion = new CustomMaterialProperty<Texture2D>( this, CCHairAlphaBackShader.textureAmbientOcclusion );
aoLightAffect = new CustomMaterialProperty<float>( this, CCHairAlphaBackShader.aoLightAffect );
ambientOcclusion = new CustomMaterialProperty<float>( this, CCHairAlphaBackShader.ambientOcclusion );
@ -212,6 +214,7 @@ namespace Rokojori
rootOcclusionRange = new CustomMaterialProperty<float>( this, CCHairAlphaBackShader.rootOcclusionRange );
endOcclusionAmount = new CustomMaterialProperty<float>( this, CCHairAlphaBackShader.endOcclusionAmount );
endOcclusionRange = new CustomMaterialProperty<float>( this, CCHairAlphaBackShader.endOcclusionRange );
rootBasedOcclusion = new CustomMaterialProperty<float>( this, CCHairAlphaBackShader.rootBasedOcclusion );
}
}

View File

@ -10,7 +10,70 @@ namespace Rokojori
"res://addons/rokojori_action_library/Runtime/Reallusion/Shaders/Hair/Variants/CCHairAlpha.gdshader"
);
public static readonly BoolPropertyName enabled = BoolPropertyName.Create( "enabled" );
public static readonly ColorPropertyName albedo = ColorPropertyName.Create( "albedo" );
public static readonly Texture2DPropertyName textureAlbedo = Texture2DPropertyName.Create( "texture_albedo" );
public static readonly Vector3PropertyName hslOffset = Vector3PropertyName.Create( "hslOffset" );
public static readonly Texture2DPropertyName textureBlend = Texture2DPropertyName.Create( "texture_blend" );
public static readonly FloatPropertyName blendAmount = FloatPropertyName.Create( "blendAmount" );
public static readonly FloatPropertyName naturalColors = FloatPropertyName.Create( "naturalColors" );
public static readonly Texture2DPropertyName textureOpacity = Texture2DPropertyName.Create( "texture_opacity" );
public static readonly FloatPropertyName opacity = FloatPropertyName.Create( "opacity" );
public static readonly FloatPropertyName opacityGamma = FloatPropertyName.Create( "opacityGamma" );
public static readonly Texture2DPropertyName rootMap = Texture2DPropertyName.Create( "rootMap" );
public static readonly Texture2DPropertyName flowMap = Texture2DPropertyName.Create( "flowMap" );
public static readonly Texture2DPropertyName idMap = Texture2DPropertyName.Create( "idMap" );
public static readonly FloatPropertyName diffuseStrength = FloatPropertyName.Create( "diffuseStrength" );
public static readonly FloatPropertyName vertexColorStrength = FloatPropertyName.Create( "vertexColorStrength" );
public static readonly ColorPropertyName vertexGreyToColor = ColorPropertyName.Create( "vertexGreyToColor" );
public static readonly BoolPropertyName activateHairColor = BoolPropertyName.Create( "activateHairColor" );
public static readonly FloatPropertyName baseColorMapStrength = FloatPropertyName.Create( "baseColorMapStrength" );
public static readonly ColorPropertyName strandRootColor = ColorPropertyName.Create( "strandRootColor" );
public static readonly FloatPropertyName strandRootStrength = FloatPropertyName.Create( "strandRootStrength" );
public static readonly ColorPropertyName strandEndColor = ColorPropertyName.Create( "strandEndColor" );
public static readonly FloatPropertyName strandEndStrength = FloatPropertyName.Create( "strandEndStrength" );
public static readonly FloatPropertyName strandGamma = FloatPropertyName.Create( "strandGamma" );
public static readonly FloatPropertyName maximumHighlightAmount = FloatPropertyName.Create( "maximumHighlightAmount" );
public static readonly FloatPropertyName highlightFadeOutStart = FloatPropertyName.Create( "highlightFadeOutStart" );
public static readonly FloatPropertyName highlightFadeOutEnd = FloatPropertyName.Create( "highlightFadeOutEnd" );
public static readonly FloatPropertyName highlightFadeOutPower = FloatPropertyName.Create( "highlightFadeOutPower" );
public static readonly FloatPropertyName highlightFadeOutAmount = FloatPropertyName.Create( "highlightFadeOutAmount" );
public static readonly ColorPropertyName highlightAColor = ColorPropertyName.Create( "highlightAColor" );
public static readonly FloatPropertyName highlightAStrength = FloatPropertyName.Create( "highlightAStrength" );
public static readonly Vector3PropertyName highlightARange = Vector3PropertyName.Create( "highlightARange" );
public static readonly FloatPropertyName highlightAOverlapEnd = FloatPropertyName.Create( "highlightAOverlapEnd" );
public static readonly FloatPropertyName highlightAInvert = FloatPropertyName.Create( "highlightAInvert" );
public static readonly ColorPropertyName highlightBColor = ColorPropertyName.Create( "highlightBColor" );
public static readonly FloatPropertyName highlightBStrength = FloatPropertyName.Create( "highlightBStrength" );
public static readonly Vector3PropertyName highlightBRange = Vector3PropertyName.Create( "highlightBRange" );
public static readonly FloatPropertyName highlightBOverlapEnd = FloatPropertyName.Create( "highlightBOverlapEnd" );
public static readonly FloatPropertyName highlightBInvert = FloatPropertyName.Create( "highlightBInvert" );
public static readonly FloatPropertyName roughness = FloatPropertyName.Create( "roughness" );
public static readonly FloatPropertyName roughnessOffset = FloatPropertyName.Create( "roughnessOffset" );
public static readonly Texture2DPropertyName textureRoughness = Texture2DPropertyName.Create( "texture_roughness" );
public static readonly FloatPropertyName metallic = FloatPropertyName.Create( "metallic" );
public static readonly FloatPropertyName metallicOffset = FloatPropertyName.Create( "metallicOffset" );
public static readonly Texture2DPropertyName textureMetallic = Texture2DPropertyName.Create( "texture_metallic" );
public static readonly FloatPropertyName specular = FloatPropertyName.Create( "specular" );
public static readonly FloatPropertyName specularOpacityAmount = FloatPropertyName.Create( "specularOpacityAmount" );
public static readonly FloatPropertyName specularOpacityGamma = FloatPropertyName.Create( "specularOpacityGamma" );
public static readonly FloatPropertyName anisotropyRatio = FloatPropertyName.Create( "anisotropy_ratio" );
public static readonly Texture2DPropertyName textureEmission = Texture2DPropertyName.Create( "texture_emission" );
public static readonly ColorPropertyName emission = ColorPropertyName.Create( "emission" );
public static readonly FloatPropertyName emissionEnergy = FloatPropertyName.Create( "emission_energy" );
public static readonly ColorPropertyName backlight = ColorPropertyName.Create( "backlight" );
public static readonly FloatPropertyName albedoToBacklightAmount = FloatPropertyName.Create( "albedoToBacklightAmount" );
public static readonly Texture2DPropertyName textureBacklight = Texture2DPropertyName.Create( "texture_backlight" );
public static readonly FloatPropertyName subsurfaceScatteringStrength = FloatPropertyName.Create( "subsurface_scattering_strength" );
public static readonly Texture2DPropertyName textureAmbientOcclusion = Texture2DPropertyName.Create( "texture_ambient_occlusion" );
public static readonly FloatPropertyName aoLightAffect = FloatPropertyName.Create( "ao_light_affect" );
public static readonly FloatPropertyName ambientOcclusion = FloatPropertyName.Create( "ambientOcclusion" );
public static readonly FloatPropertyName aoGamma = FloatPropertyName.Create( "aoGamma" );
public static readonly FloatPropertyName rootOcclusionAmount = FloatPropertyName.Create( "rootOcclusionAmount" );
public static readonly FloatPropertyName rootOcclusionRange = FloatPropertyName.Create( "rootOcclusionRange" );
public static readonly FloatPropertyName endOcclusionAmount = FloatPropertyName.Create( "endOcclusionAmount" );
public static readonly FloatPropertyName endOcclusionRange = FloatPropertyName.Create( "endOcclusionRange" );
public static readonly FloatPropertyName rootBasedOcclusion = FloatPropertyName.Create( "rootBasedOcclusion" );
}
@ -19,13 +82,139 @@ namespace Rokojori
{
public readonly CustomMaterialProperty<bool> enabled;
public readonly CustomMaterialProperty<Color> albedo;
public readonly CustomMaterialProperty<Texture2D> textureAlbedo;
public readonly CustomMaterialProperty<Vector3> hslOffset;
public readonly CustomMaterialProperty<Texture2D> textureBlend;
public readonly CustomMaterialProperty<float> blendAmount;
public readonly CustomMaterialProperty<float> naturalColors;
public readonly CustomMaterialProperty<Texture2D> textureOpacity;
public readonly CustomMaterialProperty<float> opacity;
public readonly CustomMaterialProperty<float> opacityGamma;
public readonly CustomMaterialProperty<Texture2D> rootMap;
public readonly CustomMaterialProperty<Texture2D> flowMap;
public readonly CustomMaterialProperty<Texture2D> idMap;
public readonly CustomMaterialProperty<float> diffuseStrength;
public readonly CustomMaterialProperty<float> vertexColorStrength;
public readonly CustomMaterialProperty<Color> vertexGreyToColor;
public readonly CustomMaterialProperty<bool> activateHairColor;
public readonly CustomMaterialProperty<float> baseColorMapStrength;
public readonly CustomMaterialProperty<Color> strandRootColor;
public readonly CustomMaterialProperty<float> strandRootStrength;
public readonly CustomMaterialProperty<Color> strandEndColor;
public readonly CustomMaterialProperty<float> strandEndStrength;
public readonly CustomMaterialProperty<float> strandGamma;
public readonly CustomMaterialProperty<float> maximumHighlightAmount;
public readonly CustomMaterialProperty<float> highlightFadeOutStart;
public readonly CustomMaterialProperty<float> highlightFadeOutEnd;
public readonly CustomMaterialProperty<float> highlightFadeOutPower;
public readonly CustomMaterialProperty<float> highlightFadeOutAmount;
public readonly CustomMaterialProperty<Color> highlightAColor;
public readonly CustomMaterialProperty<float> highlightAStrength;
public readonly CustomMaterialProperty<Vector3> highlightARange;
public readonly CustomMaterialProperty<float> highlightAOverlapEnd;
public readonly CustomMaterialProperty<float> highlightAInvert;
public readonly CustomMaterialProperty<Color> highlightBColor;
public readonly CustomMaterialProperty<float> highlightBStrength;
public readonly CustomMaterialProperty<Vector3> highlightBRange;
public readonly CustomMaterialProperty<float> highlightBOverlapEnd;
public readonly CustomMaterialProperty<float> highlightBInvert;
public readonly CustomMaterialProperty<float> roughness;
public readonly CustomMaterialProperty<float> roughnessOffset;
public readonly CustomMaterialProperty<Texture2D> textureRoughness;
public readonly CustomMaterialProperty<float> metallic;
public readonly CustomMaterialProperty<float> metallicOffset;
public readonly CustomMaterialProperty<Texture2D> textureMetallic;
public readonly CustomMaterialProperty<float> specular;
public readonly CustomMaterialProperty<float> specularOpacityAmount;
public readonly CustomMaterialProperty<float> specularOpacityGamma;
public readonly CustomMaterialProperty<float> anisotropyRatio;
public readonly CustomMaterialProperty<Texture2D> textureEmission;
public readonly CustomMaterialProperty<Color> emission;
public readonly CustomMaterialProperty<float> emissionEnergy;
public readonly CustomMaterialProperty<Color> backlight;
public readonly CustomMaterialProperty<float> albedoToBacklightAmount;
public readonly CustomMaterialProperty<Texture2D> textureBacklight;
public readonly CustomMaterialProperty<float> subsurfaceScatteringStrength;
public readonly CustomMaterialProperty<Texture2D> textureAmbientOcclusion;
public readonly CustomMaterialProperty<float> aoLightAffect;
public readonly CustomMaterialProperty<float> ambientOcclusion;
public readonly CustomMaterialProperty<float> aoGamma;
public readonly CustomMaterialProperty<float> rootOcclusionAmount;
public readonly CustomMaterialProperty<float> rootOcclusionRange;
public readonly CustomMaterialProperty<float> endOcclusionAmount;
public readonly CustomMaterialProperty<float> endOcclusionRange;
public readonly CustomMaterialProperty<float> rootBasedOcclusion;
public CCHairAlphaMaterial()
{
Shader = CCHairAlphaShader.shader.Get();
enabled = new CustomMaterialProperty<bool>( this, CCHairAlphaShader.enabled );
albedo = new CustomMaterialProperty<Color>( this, CCHairAlphaShader.albedo );
textureAlbedo = new CustomMaterialProperty<Texture2D>( this, CCHairAlphaShader.textureAlbedo );
hslOffset = new CustomMaterialProperty<Vector3>( this, CCHairAlphaShader.hslOffset );
textureBlend = new CustomMaterialProperty<Texture2D>( this, CCHairAlphaShader.textureBlend );
blendAmount = new CustomMaterialProperty<float>( this, CCHairAlphaShader.blendAmount );
naturalColors = new CustomMaterialProperty<float>( this, CCHairAlphaShader.naturalColors );
textureOpacity = new CustomMaterialProperty<Texture2D>( this, CCHairAlphaShader.textureOpacity );
opacity = new CustomMaterialProperty<float>( this, CCHairAlphaShader.opacity );
opacityGamma = new CustomMaterialProperty<float>( this, CCHairAlphaShader.opacityGamma );
rootMap = new CustomMaterialProperty<Texture2D>( this, CCHairAlphaShader.rootMap );
flowMap = new CustomMaterialProperty<Texture2D>( this, CCHairAlphaShader.flowMap );
idMap = new CustomMaterialProperty<Texture2D>( this, CCHairAlphaShader.idMap );
diffuseStrength = new CustomMaterialProperty<float>( this, CCHairAlphaShader.diffuseStrength );
vertexColorStrength = new CustomMaterialProperty<float>( this, CCHairAlphaShader.vertexColorStrength );
vertexGreyToColor = new CustomMaterialProperty<Color>( this, CCHairAlphaShader.vertexGreyToColor );
activateHairColor = new CustomMaterialProperty<bool>( this, CCHairAlphaShader.activateHairColor );
baseColorMapStrength = new CustomMaterialProperty<float>( this, CCHairAlphaShader.baseColorMapStrength );
strandRootColor = new CustomMaterialProperty<Color>( this, CCHairAlphaShader.strandRootColor );
strandRootStrength = new CustomMaterialProperty<float>( this, CCHairAlphaShader.strandRootStrength );
strandEndColor = new CustomMaterialProperty<Color>( this, CCHairAlphaShader.strandEndColor );
strandEndStrength = new CustomMaterialProperty<float>( this, CCHairAlphaShader.strandEndStrength );
strandGamma = new CustomMaterialProperty<float>( this, CCHairAlphaShader.strandGamma );
maximumHighlightAmount = new CustomMaterialProperty<float>( this, CCHairAlphaShader.maximumHighlightAmount );
highlightFadeOutStart = new CustomMaterialProperty<float>( this, CCHairAlphaShader.highlightFadeOutStart );
highlightFadeOutEnd = new CustomMaterialProperty<float>( this, CCHairAlphaShader.highlightFadeOutEnd );
highlightFadeOutPower = new CustomMaterialProperty<float>( this, CCHairAlphaShader.highlightFadeOutPower );
highlightFadeOutAmount = new CustomMaterialProperty<float>( this, CCHairAlphaShader.highlightFadeOutAmount );
highlightAColor = new CustomMaterialProperty<Color>( this, CCHairAlphaShader.highlightAColor );
highlightAStrength = new CustomMaterialProperty<float>( this, CCHairAlphaShader.highlightAStrength );
highlightARange = new CustomMaterialProperty<Vector3>( this, CCHairAlphaShader.highlightARange );
highlightAOverlapEnd = new CustomMaterialProperty<float>( this, CCHairAlphaShader.highlightAOverlapEnd );
highlightAInvert = new CustomMaterialProperty<float>( this, CCHairAlphaShader.highlightAInvert );
highlightBColor = new CustomMaterialProperty<Color>( this, CCHairAlphaShader.highlightBColor );
highlightBStrength = new CustomMaterialProperty<float>( this, CCHairAlphaShader.highlightBStrength );
highlightBRange = new CustomMaterialProperty<Vector3>( this, CCHairAlphaShader.highlightBRange );
highlightBOverlapEnd = new CustomMaterialProperty<float>( this, CCHairAlphaShader.highlightBOverlapEnd );
highlightBInvert = new CustomMaterialProperty<float>( this, CCHairAlphaShader.highlightBInvert );
roughness = new CustomMaterialProperty<float>( this, CCHairAlphaShader.roughness );
roughnessOffset = new CustomMaterialProperty<float>( this, CCHairAlphaShader.roughnessOffset );
textureRoughness = new CustomMaterialProperty<Texture2D>( this, CCHairAlphaShader.textureRoughness );
metallic = new CustomMaterialProperty<float>( this, CCHairAlphaShader.metallic );
metallicOffset = new CustomMaterialProperty<float>( this, CCHairAlphaShader.metallicOffset );
textureMetallic = new CustomMaterialProperty<Texture2D>( this, CCHairAlphaShader.textureMetallic );
specular = new CustomMaterialProperty<float>( this, CCHairAlphaShader.specular );
specularOpacityAmount = new CustomMaterialProperty<float>( this, CCHairAlphaShader.specularOpacityAmount );
specularOpacityGamma = new CustomMaterialProperty<float>( this, CCHairAlphaShader.specularOpacityGamma );
anisotropyRatio = new CustomMaterialProperty<float>( this, CCHairAlphaShader.anisotropyRatio );
textureEmission = new CustomMaterialProperty<Texture2D>( this, CCHairAlphaShader.textureEmission );
emission = new CustomMaterialProperty<Color>( this, CCHairAlphaShader.emission );
emissionEnergy = new CustomMaterialProperty<float>( this, CCHairAlphaShader.emissionEnergy );
backlight = new CustomMaterialProperty<Color>( this, CCHairAlphaShader.backlight );
albedoToBacklightAmount = new CustomMaterialProperty<float>( this, CCHairAlphaShader.albedoToBacklightAmount );
textureBacklight = new CustomMaterialProperty<Texture2D>( this, CCHairAlphaShader.textureBacklight );
subsurfaceScatteringStrength = new CustomMaterialProperty<float>( this, CCHairAlphaShader.subsurfaceScatteringStrength );
textureAmbientOcclusion = new CustomMaterialProperty<Texture2D>( this, CCHairAlphaShader.textureAmbientOcclusion );
aoLightAffect = new CustomMaterialProperty<float>( this, CCHairAlphaShader.aoLightAffect );
ambientOcclusion = new CustomMaterialProperty<float>( this, CCHairAlphaShader.ambientOcclusion );
aoGamma = new CustomMaterialProperty<float>( this, CCHairAlphaShader.aoGamma );
rootOcclusionAmount = new CustomMaterialProperty<float>( this, CCHairAlphaShader.rootOcclusionAmount );
rootOcclusionRange = new CustomMaterialProperty<float>( this, CCHairAlphaShader.rootOcclusionRange );
endOcclusionAmount = new CustomMaterialProperty<float>( this, CCHairAlphaShader.endOcclusionAmount );
endOcclusionRange = new CustomMaterialProperty<float>( this, CCHairAlphaShader.endOcclusionRange );
rootBasedOcclusion = new CustomMaterialProperty<float>( this, CCHairAlphaShader.rootBasedOcclusion );
}
}

View File

@ -7,10 +7,74 @@ namespace Rokojori
public class CCHairDiscardShader
{
public static readonly CachedResource<Shader> shader = new CachedResource<Shader>(
"res://addons/rokojori_action_library/Runtime/Reallusion/Shaders/CCHairDiscard.gdshader"
"res://addons/rokojori_action_library/Runtime/Reallusion/Shaders/Hair/Variants/CCHairDiscard.gdshader"
);
public static readonly BoolPropertyName enabled = BoolPropertyName.Create( "enabled" );
public static readonly ColorPropertyName albedo = ColorPropertyName.Create( "albedo" );
public static readonly Texture2DPropertyName textureAlbedo = Texture2DPropertyName.Create( "texture_albedo" );
public static readonly Vector3PropertyName hslOffset = Vector3PropertyName.Create( "hslOffset" );
public static readonly Texture2DPropertyName textureBlend = Texture2DPropertyName.Create( "texture_blend" );
public static readonly FloatPropertyName blendAmount = FloatPropertyName.Create( "blendAmount" );
public static readonly FloatPropertyName naturalColors = FloatPropertyName.Create( "naturalColors" );
public static readonly Texture2DPropertyName textureOpacity = Texture2DPropertyName.Create( "texture_opacity" );
public static readonly FloatPropertyName opacity = FloatPropertyName.Create( "opacity" );
public static readonly FloatPropertyName opacityGamma = FloatPropertyName.Create( "opacityGamma" );
public static readonly FloatPropertyName alphaDiscardTreshold = FloatPropertyName.Create( "alphaDiscardTreshold" );
public static readonly Texture2DPropertyName rootMap = Texture2DPropertyName.Create( "rootMap" );
public static readonly Texture2DPropertyName flowMap = Texture2DPropertyName.Create( "flowMap" );
public static readonly Texture2DPropertyName idMap = Texture2DPropertyName.Create( "idMap" );
public static readonly FloatPropertyName diffuseStrength = FloatPropertyName.Create( "diffuseStrength" );
public static readonly FloatPropertyName vertexColorStrength = FloatPropertyName.Create( "vertexColorStrength" );
public static readonly ColorPropertyName vertexGreyToColor = ColorPropertyName.Create( "vertexGreyToColor" );
public static readonly BoolPropertyName activateHairColor = BoolPropertyName.Create( "activateHairColor" );
public static readonly FloatPropertyName baseColorMapStrength = FloatPropertyName.Create( "baseColorMapStrength" );
public static readonly ColorPropertyName strandRootColor = ColorPropertyName.Create( "strandRootColor" );
public static readonly FloatPropertyName strandRootStrength = FloatPropertyName.Create( "strandRootStrength" );
public static readonly ColorPropertyName strandEndColor = ColorPropertyName.Create( "strandEndColor" );
public static readonly FloatPropertyName strandEndStrength = FloatPropertyName.Create( "strandEndStrength" );
public static readonly FloatPropertyName strandGamma = FloatPropertyName.Create( "strandGamma" );
public static readonly FloatPropertyName maximumHighlightAmount = FloatPropertyName.Create( "maximumHighlightAmount" );
public static readonly FloatPropertyName highlightFadeOutStart = FloatPropertyName.Create( "highlightFadeOutStart" );
public static readonly FloatPropertyName highlightFadeOutEnd = FloatPropertyName.Create( "highlightFadeOutEnd" );
public static readonly FloatPropertyName highlightFadeOutPower = FloatPropertyName.Create( "highlightFadeOutPower" );
public static readonly FloatPropertyName highlightFadeOutAmount = FloatPropertyName.Create( "highlightFadeOutAmount" );
public static readonly ColorPropertyName highlightAColor = ColorPropertyName.Create( "highlightAColor" );
public static readonly FloatPropertyName highlightAStrength = FloatPropertyName.Create( "highlightAStrength" );
public static readonly Vector3PropertyName highlightARange = Vector3PropertyName.Create( "highlightARange" );
public static readonly FloatPropertyName highlightAOverlapEnd = FloatPropertyName.Create( "highlightAOverlapEnd" );
public static readonly FloatPropertyName highlightAInvert = FloatPropertyName.Create( "highlightAInvert" );
public static readonly ColorPropertyName highlightBColor = ColorPropertyName.Create( "highlightBColor" );
public static readonly FloatPropertyName highlightBStrength = FloatPropertyName.Create( "highlightBStrength" );
public static readonly Vector3PropertyName highlightBRange = Vector3PropertyName.Create( "highlightBRange" );
public static readonly FloatPropertyName highlightBOverlapEnd = FloatPropertyName.Create( "highlightBOverlapEnd" );
public static readonly FloatPropertyName highlightBInvert = FloatPropertyName.Create( "highlightBInvert" );
public static readonly FloatPropertyName roughness = FloatPropertyName.Create( "roughness" );
public static readonly FloatPropertyName roughnessOffset = FloatPropertyName.Create( "roughnessOffset" );
public static readonly Texture2DPropertyName textureRoughness = Texture2DPropertyName.Create( "texture_roughness" );
public static readonly FloatPropertyName metallic = FloatPropertyName.Create( "metallic" );
public static readonly FloatPropertyName metallicOffset = FloatPropertyName.Create( "metallicOffset" );
public static readonly Texture2DPropertyName textureMetallic = Texture2DPropertyName.Create( "texture_metallic" );
public static readonly FloatPropertyName specular = FloatPropertyName.Create( "specular" );
public static readonly FloatPropertyName specularOpacityAmount = FloatPropertyName.Create( "specularOpacityAmount" );
public static readonly FloatPropertyName specularOpacityGamma = FloatPropertyName.Create( "specularOpacityGamma" );
public static readonly FloatPropertyName anisotropyRatio = FloatPropertyName.Create( "anisotropy_ratio" );
public static readonly Texture2DPropertyName textureEmission = Texture2DPropertyName.Create( "texture_emission" );
public static readonly ColorPropertyName emission = ColorPropertyName.Create( "emission" );
public static readonly FloatPropertyName emissionEnergy = FloatPropertyName.Create( "emission_energy" );
public static readonly ColorPropertyName backlight = ColorPropertyName.Create( "backlight" );
public static readonly FloatPropertyName albedoToBacklightAmount = FloatPropertyName.Create( "albedoToBacklightAmount" );
public static readonly Texture2DPropertyName textureBacklight = Texture2DPropertyName.Create( "texture_backlight" );
public static readonly FloatPropertyName subsurfaceScatteringStrength = FloatPropertyName.Create( "subsurface_scattering_strength" );
public static readonly Texture2DPropertyName textureAmbientOcclusion = Texture2DPropertyName.Create( "texture_ambient_occlusion" );
public static readonly FloatPropertyName aoLightAffect = FloatPropertyName.Create( "ao_light_affect" );
public static readonly FloatPropertyName ambientOcclusion = FloatPropertyName.Create( "ambientOcclusion" );
public static readonly FloatPropertyName aoGamma = FloatPropertyName.Create( "aoGamma" );
public static readonly FloatPropertyName rootOcclusionAmount = FloatPropertyName.Create( "rootOcclusionAmount" );
public static readonly FloatPropertyName rootOcclusionRange = FloatPropertyName.Create( "rootOcclusionRange" );
public static readonly FloatPropertyName endOcclusionAmount = FloatPropertyName.Create( "endOcclusionAmount" );
public static readonly FloatPropertyName endOcclusionRange = FloatPropertyName.Create( "endOcclusionRange" );
public static readonly FloatPropertyName rootBasedOcclusion = FloatPropertyName.Create( "rootBasedOcclusion" );
}
@ -19,13 +83,141 @@ namespace Rokojori
{
public readonly CustomMaterialProperty<bool> enabled;
public readonly CustomMaterialProperty<Color> albedo;
public readonly CustomMaterialProperty<Texture2D> textureAlbedo;
public readonly CustomMaterialProperty<Vector3> hslOffset;
public readonly CustomMaterialProperty<Texture2D> textureBlend;
public readonly CustomMaterialProperty<float> blendAmount;
public readonly CustomMaterialProperty<float> naturalColors;
public readonly CustomMaterialProperty<Texture2D> textureOpacity;
public readonly CustomMaterialProperty<float> opacity;
public readonly CustomMaterialProperty<float> opacityGamma;
public readonly CustomMaterialProperty<float> alphaDiscardTreshold;
public readonly CustomMaterialProperty<Texture2D> rootMap;
public readonly CustomMaterialProperty<Texture2D> flowMap;
public readonly CustomMaterialProperty<Texture2D> idMap;
public readonly CustomMaterialProperty<float> diffuseStrength;
public readonly CustomMaterialProperty<float> vertexColorStrength;
public readonly CustomMaterialProperty<Color> vertexGreyToColor;
public readonly CustomMaterialProperty<bool> activateHairColor;
public readonly CustomMaterialProperty<float> baseColorMapStrength;
public readonly CustomMaterialProperty<Color> strandRootColor;
public readonly CustomMaterialProperty<float> strandRootStrength;
public readonly CustomMaterialProperty<Color> strandEndColor;
public readonly CustomMaterialProperty<float> strandEndStrength;
public readonly CustomMaterialProperty<float> strandGamma;
public readonly CustomMaterialProperty<float> maximumHighlightAmount;
public readonly CustomMaterialProperty<float> highlightFadeOutStart;
public readonly CustomMaterialProperty<float> highlightFadeOutEnd;
public readonly CustomMaterialProperty<float> highlightFadeOutPower;
public readonly CustomMaterialProperty<float> highlightFadeOutAmount;
public readonly CustomMaterialProperty<Color> highlightAColor;
public readonly CustomMaterialProperty<float> highlightAStrength;
public readonly CustomMaterialProperty<Vector3> highlightARange;
public readonly CustomMaterialProperty<float> highlightAOverlapEnd;
public readonly CustomMaterialProperty<float> highlightAInvert;
public readonly CustomMaterialProperty<Color> highlightBColor;
public readonly CustomMaterialProperty<float> highlightBStrength;
public readonly CustomMaterialProperty<Vector3> highlightBRange;
public readonly CustomMaterialProperty<float> highlightBOverlapEnd;
public readonly CustomMaterialProperty<float> highlightBInvert;
public readonly CustomMaterialProperty<float> roughness;
public readonly CustomMaterialProperty<float> roughnessOffset;
public readonly CustomMaterialProperty<Texture2D> textureRoughness;
public readonly CustomMaterialProperty<float> metallic;
public readonly CustomMaterialProperty<float> metallicOffset;
public readonly CustomMaterialProperty<Texture2D> textureMetallic;
public readonly CustomMaterialProperty<float> specular;
public readonly CustomMaterialProperty<float> specularOpacityAmount;
public readonly CustomMaterialProperty<float> specularOpacityGamma;
public readonly CustomMaterialProperty<float> anisotropyRatio;
public readonly CustomMaterialProperty<Texture2D> textureEmission;
public readonly CustomMaterialProperty<Color> emission;
public readonly CustomMaterialProperty<float> emissionEnergy;
public readonly CustomMaterialProperty<Color> backlight;
public readonly CustomMaterialProperty<float> albedoToBacklightAmount;
public readonly CustomMaterialProperty<Texture2D> textureBacklight;
public readonly CustomMaterialProperty<float> subsurfaceScatteringStrength;
public readonly CustomMaterialProperty<Texture2D> textureAmbientOcclusion;
public readonly CustomMaterialProperty<float> aoLightAffect;
public readonly CustomMaterialProperty<float> ambientOcclusion;
public readonly CustomMaterialProperty<float> aoGamma;
public readonly CustomMaterialProperty<float> rootOcclusionAmount;
public readonly CustomMaterialProperty<float> rootOcclusionRange;
public readonly CustomMaterialProperty<float> endOcclusionAmount;
public readonly CustomMaterialProperty<float> endOcclusionRange;
public readonly CustomMaterialProperty<float> rootBasedOcclusion;
public CCHairDiscardMaterial()
{
Shader = CCHairDiscardShader.shader.Get();
enabled = new CustomMaterialProperty<bool>( this, CCHairDiscardShader.enabled );
albedo = new CustomMaterialProperty<Color>( this, CCHairDiscardShader.albedo );
textureAlbedo = new CustomMaterialProperty<Texture2D>( this, CCHairDiscardShader.textureAlbedo );
hslOffset = new CustomMaterialProperty<Vector3>( this, CCHairDiscardShader.hslOffset );
textureBlend = new CustomMaterialProperty<Texture2D>( this, CCHairDiscardShader.textureBlend );
blendAmount = new CustomMaterialProperty<float>( this, CCHairDiscardShader.blendAmount );
naturalColors = new CustomMaterialProperty<float>( this, CCHairDiscardShader.naturalColors );
textureOpacity = new CustomMaterialProperty<Texture2D>( this, CCHairDiscardShader.textureOpacity );
opacity = new CustomMaterialProperty<float>( this, CCHairDiscardShader.opacity );
opacityGamma = new CustomMaterialProperty<float>( this, CCHairDiscardShader.opacityGamma );
alphaDiscardTreshold = new CustomMaterialProperty<float>( this, CCHairDiscardShader.alphaDiscardTreshold );
rootMap = new CustomMaterialProperty<Texture2D>( this, CCHairDiscardShader.rootMap );
flowMap = new CustomMaterialProperty<Texture2D>( this, CCHairDiscardShader.flowMap );
idMap = new CustomMaterialProperty<Texture2D>( this, CCHairDiscardShader.idMap );
diffuseStrength = new CustomMaterialProperty<float>( this, CCHairDiscardShader.diffuseStrength );
vertexColorStrength = new CustomMaterialProperty<float>( this, CCHairDiscardShader.vertexColorStrength );
vertexGreyToColor = new CustomMaterialProperty<Color>( this, CCHairDiscardShader.vertexGreyToColor );
activateHairColor = new CustomMaterialProperty<bool>( this, CCHairDiscardShader.activateHairColor );
baseColorMapStrength = new CustomMaterialProperty<float>( this, CCHairDiscardShader.baseColorMapStrength );
strandRootColor = new CustomMaterialProperty<Color>( this, CCHairDiscardShader.strandRootColor );
strandRootStrength = new CustomMaterialProperty<float>( this, CCHairDiscardShader.strandRootStrength );
strandEndColor = new CustomMaterialProperty<Color>( this, CCHairDiscardShader.strandEndColor );
strandEndStrength = new CustomMaterialProperty<float>( this, CCHairDiscardShader.strandEndStrength );
strandGamma = new CustomMaterialProperty<float>( this, CCHairDiscardShader.strandGamma );
maximumHighlightAmount = new CustomMaterialProperty<float>( this, CCHairDiscardShader.maximumHighlightAmount );
highlightFadeOutStart = new CustomMaterialProperty<float>( this, CCHairDiscardShader.highlightFadeOutStart );
highlightFadeOutEnd = new CustomMaterialProperty<float>( this, CCHairDiscardShader.highlightFadeOutEnd );
highlightFadeOutPower = new CustomMaterialProperty<float>( this, CCHairDiscardShader.highlightFadeOutPower );
highlightFadeOutAmount = new CustomMaterialProperty<float>( this, CCHairDiscardShader.highlightFadeOutAmount );
highlightAColor = new CustomMaterialProperty<Color>( this, CCHairDiscardShader.highlightAColor );
highlightAStrength = new CustomMaterialProperty<float>( this, CCHairDiscardShader.highlightAStrength );
highlightARange = new CustomMaterialProperty<Vector3>( this, CCHairDiscardShader.highlightARange );
highlightAOverlapEnd = new CustomMaterialProperty<float>( this, CCHairDiscardShader.highlightAOverlapEnd );
highlightAInvert = new CustomMaterialProperty<float>( this, CCHairDiscardShader.highlightAInvert );
highlightBColor = new CustomMaterialProperty<Color>( this, CCHairDiscardShader.highlightBColor );
highlightBStrength = new CustomMaterialProperty<float>( this, CCHairDiscardShader.highlightBStrength );
highlightBRange = new CustomMaterialProperty<Vector3>( this, CCHairDiscardShader.highlightBRange );
highlightBOverlapEnd = new CustomMaterialProperty<float>( this, CCHairDiscardShader.highlightBOverlapEnd );
highlightBInvert = new CustomMaterialProperty<float>( this, CCHairDiscardShader.highlightBInvert );
roughness = new CustomMaterialProperty<float>( this, CCHairDiscardShader.roughness );
roughnessOffset = new CustomMaterialProperty<float>( this, CCHairDiscardShader.roughnessOffset );
textureRoughness = new CustomMaterialProperty<Texture2D>( this, CCHairDiscardShader.textureRoughness );
metallic = new CustomMaterialProperty<float>( this, CCHairDiscardShader.metallic );
metallicOffset = new CustomMaterialProperty<float>( this, CCHairDiscardShader.metallicOffset );
textureMetallic = new CustomMaterialProperty<Texture2D>( this, CCHairDiscardShader.textureMetallic );
specular = new CustomMaterialProperty<float>( this, CCHairDiscardShader.specular );
specularOpacityAmount = new CustomMaterialProperty<float>( this, CCHairDiscardShader.specularOpacityAmount );
specularOpacityGamma = new CustomMaterialProperty<float>( this, CCHairDiscardShader.specularOpacityGamma );
anisotropyRatio = new CustomMaterialProperty<float>( this, CCHairDiscardShader.anisotropyRatio );
textureEmission = new CustomMaterialProperty<Texture2D>( this, CCHairDiscardShader.textureEmission );
emission = new CustomMaterialProperty<Color>( this, CCHairDiscardShader.emission );
emissionEnergy = new CustomMaterialProperty<float>( this, CCHairDiscardShader.emissionEnergy );
backlight = new CustomMaterialProperty<Color>( this, CCHairDiscardShader.backlight );
albedoToBacklightAmount = new CustomMaterialProperty<float>( this, CCHairDiscardShader.albedoToBacklightAmount );
textureBacklight = new CustomMaterialProperty<Texture2D>( this, CCHairDiscardShader.textureBacklight );
subsurfaceScatteringStrength = new CustomMaterialProperty<float>( this, CCHairDiscardShader.subsurfaceScatteringStrength );
textureAmbientOcclusion = new CustomMaterialProperty<Texture2D>( this, CCHairDiscardShader.textureAmbientOcclusion );
aoLightAffect = new CustomMaterialProperty<float>( this, CCHairDiscardShader.aoLightAffect );
ambientOcclusion = new CustomMaterialProperty<float>( this, CCHairDiscardShader.ambientOcclusion );
aoGamma = new CustomMaterialProperty<float>( this, CCHairDiscardShader.aoGamma );
rootOcclusionAmount = new CustomMaterialProperty<float>( this, CCHairDiscardShader.rootOcclusionAmount );
rootOcclusionRange = new CustomMaterialProperty<float>( this, CCHairDiscardShader.rootOcclusionRange );
endOcclusionAmount = new CustomMaterialProperty<float>( this, CCHairDiscardShader.endOcclusionAmount );
endOcclusionRange = new CustomMaterialProperty<float>( this, CCHairDiscardShader.endOcclusionRange );
rootBasedOcclusion = new CustomMaterialProperty<float>( this, CCHairDiscardShader.rootBasedOcclusion );
}
}

View File

@ -35,24 +35,20 @@ namespace Rokojori
public static readonly FloatPropertyName strandEndStrength = FloatPropertyName.Create( "strandEndStrength" );
public static readonly FloatPropertyName strandGamma = FloatPropertyName.Create( "strandGamma" );
public static readonly FloatPropertyName maximumHighlightAmount = FloatPropertyName.Create( "maximumHighlightAmount" );
public static readonly FloatPropertyName highlightFadeOutStart = FloatPropertyName.Create( "highlightFadeOutStart" );
public static readonly FloatPropertyName highlightFadeOutEnd = FloatPropertyName.Create( "highlightFadeOutEnd" );
public static readonly FloatPropertyName highlightFadeOutPower = FloatPropertyName.Create( "highlightFadeOutPower" );
public static readonly FloatPropertyName highlightFadeOutAmount = FloatPropertyName.Create( "highlightFadeOutAmount" );
public static readonly ColorPropertyName highlightAColor = ColorPropertyName.Create( "highlightAColor" );
public static readonly FloatPropertyName highlightAStrength = FloatPropertyName.Create( "highlightAStrength" );
public static readonly Vector3PropertyName highlightARange = Vector3PropertyName.Create( "highlightARange" );
public static readonly FloatPropertyName highlightAOverlapEnd = FloatPropertyName.Create( "highlightAOverlapEnd" );
public static readonly FloatPropertyName highlightAInvert = FloatPropertyName.Create( "highlightAInvert" );
public static readonly FloatPropertyName highlightAFadeOutStart = FloatPropertyName.Create( "highlightAFadeOutStart" );
public static readonly FloatPropertyName highlightAFadeOutRange = FloatPropertyName.Create( "highlightAFadeOutRange" );
public static readonly FloatPropertyName highlightAFadeOutPower = FloatPropertyName.Create( "highlightAFadeOutPower" );
public static readonly FloatPropertyName highlightAFadeOutAmount = FloatPropertyName.Create( "highlightAFadeOutAmount" );
public static readonly ColorPropertyName highlightBColor = ColorPropertyName.Create( "highlightBColor" );
public static readonly FloatPropertyName highlightBStrength = FloatPropertyName.Create( "highlightBStrength" );
public static readonly Vector3PropertyName highlightBRange = Vector3PropertyName.Create( "highlightBRange" );
public static readonly FloatPropertyName highlightBOverlapEnd = FloatPropertyName.Create( "highlightBOverlapEnd" );
public static readonly FloatPropertyName highlightBInvert = FloatPropertyName.Create( "highlightBInvert" );
public static readonly FloatPropertyName highlightBFadeOutStart = FloatPropertyName.Create( "highlightBFadeOutStart" );
public static readonly FloatPropertyName highlightBFadeOutRange = FloatPropertyName.Create( "highlightBFadeOutRange" );
public static readonly FloatPropertyName highlightBFadeOutPower = FloatPropertyName.Create( "highlightBFadeOutPower" );
public static readonly FloatPropertyName highlightBFadeOutAmount = FloatPropertyName.Create( "highlightBFadeOutAmount" );
public static readonly FloatPropertyName roughness = FloatPropertyName.Create( "roughness" );
public static readonly FloatPropertyName roughnessOffset = FloatPropertyName.Create( "roughnessOffset" );
public static readonly Texture2DPropertyName textureRoughness = Texture2DPropertyName.Create( "texture_roughness" );
@ -60,12 +56,16 @@ namespace Rokojori
public static readonly FloatPropertyName metallicOffset = FloatPropertyName.Create( "metallicOffset" );
public static readonly Texture2DPropertyName textureMetallic = Texture2DPropertyName.Create( "texture_metallic" );
public static readonly FloatPropertyName specular = FloatPropertyName.Create( "specular" );
public static readonly FloatPropertyName specularOpacityAmount = FloatPropertyName.Create( "specularOpacityAmount" );
public static readonly FloatPropertyName specularOpacityGamma = FloatPropertyName.Create( "specularOpacityGamma" );
public static readonly FloatPropertyName anisotropyRatio = FloatPropertyName.Create( "anisotropy_ratio" );
public static readonly Texture2DPropertyName textureEmission = Texture2DPropertyName.Create( "texture_emission" );
public static readonly ColorPropertyName emission = ColorPropertyName.Create( "emission" );
public static readonly FloatPropertyName emissionEnergy = FloatPropertyName.Create( "emission_energy" );
public static readonly ColorPropertyName backlight = ColorPropertyName.Create( "backlight" );
public static readonly FloatPropertyName albedoToBacklightAmount = FloatPropertyName.Create( "albedoToBacklightAmount" );
public static readonly Texture2DPropertyName textureBacklight = Texture2DPropertyName.Create( "texture_backlight" );
public static readonly FloatPropertyName subsurfaceScatteringStrength = FloatPropertyName.Create( "subsurface_scattering_strength" );
public static readonly Texture2DPropertyName textureAmbientOcclusion = Texture2DPropertyName.Create( "texture_ambient_occlusion" );
public static readonly FloatPropertyName aoLightAffect = FloatPropertyName.Create( "ao_light_affect" );
public static readonly FloatPropertyName ambientOcclusion = FloatPropertyName.Create( "ambientOcclusion" );
@ -74,6 +74,7 @@ namespace Rokojori
public static readonly FloatPropertyName rootOcclusionRange = FloatPropertyName.Create( "rootOcclusionRange" );
public static readonly FloatPropertyName endOcclusionAmount = FloatPropertyName.Create( "endOcclusionAmount" );
public static readonly FloatPropertyName endOcclusionRange = FloatPropertyName.Create( "endOcclusionRange" );
public static readonly FloatPropertyName rootBasedOcclusion = FloatPropertyName.Create( "rootBasedOcclusion" );
}
@ -107,24 +108,20 @@ namespace Rokojori
public readonly CustomMaterialProperty<float> strandEndStrength;
public readonly CustomMaterialProperty<float> strandGamma;
public readonly CustomMaterialProperty<float> maximumHighlightAmount;
public readonly CustomMaterialProperty<float> highlightFadeOutStart;
public readonly CustomMaterialProperty<float> highlightFadeOutEnd;
public readonly CustomMaterialProperty<float> highlightFadeOutPower;
public readonly CustomMaterialProperty<float> highlightFadeOutAmount;
public readonly CustomMaterialProperty<Color> highlightAColor;
public readonly CustomMaterialProperty<float> highlightAStrength;
public readonly CustomMaterialProperty<Vector3> highlightARange;
public readonly CustomMaterialProperty<float> highlightAOverlapEnd;
public readonly CustomMaterialProperty<float> highlightAInvert;
public readonly CustomMaterialProperty<float> highlightAFadeOutStart;
public readonly CustomMaterialProperty<float> highlightAFadeOutRange;
public readonly CustomMaterialProperty<float> highlightAFadeOutPower;
public readonly CustomMaterialProperty<float> highlightAFadeOutAmount;
public readonly CustomMaterialProperty<Color> highlightBColor;
public readonly CustomMaterialProperty<float> highlightBStrength;
public readonly CustomMaterialProperty<Vector3> highlightBRange;
public readonly CustomMaterialProperty<float> highlightBOverlapEnd;
public readonly CustomMaterialProperty<float> highlightBInvert;
public readonly CustomMaterialProperty<float> highlightBFadeOutStart;
public readonly CustomMaterialProperty<float> highlightBFadeOutRange;
public readonly CustomMaterialProperty<float> highlightBFadeOutPower;
public readonly CustomMaterialProperty<float> highlightBFadeOutAmount;
public readonly CustomMaterialProperty<float> roughness;
public readonly CustomMaterialProperty<float> roughnessOffset;
public readonly CustomMaterialProperty<Texture2D> textureRoughness;
@ -132,12 +129,16 @@ namespace Rokojori
public readonly CustomMaterialProperty<float> metallicOffset;
public readonly CustomMaterialProperty<Texture2D> textureMetallic;
public readonly CustomMaterialProperty<float> specular;
public readonly CustomMaterialProperty<float> specularOpacityAmount;
public readonly CustomMaterialProperty<float> specularOpacityGamma;
public readonly CustomMaterialProperty<float> anisotropyRatio;
public readonly CustomMaterialProperty<Texture2D> textureEmission;
public readonly CustomMaterialProperty<Color> emission;
public readonly CustomMaterialProperty<float> emissionEnergy;
public readonly CustomMaterialProperty<Color> backlight;
public readonly CustomMaterialProperty<float> albedoToBacklightAmount;
public readonly CustomMaterialProperty<Texture2D> textureBacklight;
public readonly CustomMaterialProperty<float> subsurfaceScatteringStrength;
public readonly CustomMaterialProperty<Texture2D> textureAmbientOcclusion;
public readonly CustomMaterialProperty<float> aoLightAffect;
public readonly CustomMaterialProperty<float> ambientOcclusion;
@ -146,6 +147,7 @@ namespace Rokojori
public readonly CustomMaterialProperty<float> rootOcclusionRange;
public readonly CustomMaterialProperty<float> endOcclusionAmount;
public readonly CustomMaterialProperty<float> endOcclusionRange;
public readonly CustomMaterialProperty<float> rootBasedOcclusion;
public CCHairMaterial()
{
@ -176,24 +178,20 @@ namespace Rokojori
strandEndStrength = new CustomMaterialProperty<float>( this, CCHairShader.strandEndStrength );
strandGamma = new CustomMaterialProperty<float>( this, CCHairShader.strandGamma );
maximumHighlightAmount = new CustomMaterialProperty<float>( this, CCHairShader.maximumHighlightAmount );
highlightFadeOutStart = new CustomMaterialProperty<float>( this, CCHairShader.highlightFadeOutStart );
highlightFadeOutEnd = new CustomMaterialProperty<float>( this, CCHairShader.highlightFadeOutEnd );
highlightFadeOutPower = new CustomMaterialProperty<float>( this, CCHairShader.highlightFadeOutPower );
highlightFadeOutAmount = new CustomMaterialProperty<float>( this, CCHairShader.highlightFadeOutAmount );
highlightAColor = new CustomMaterialProperty<Color>( this, CCHairShader.highlightAColor );
highlightAStrength = new CustomMaterialProperty<float>( this, CCHairShader.highlightAStrength );
highlightARange = new CustomMaterialProperty<Vector3>( this, CCHairShader.highlightARange );
highlightAOverlapEnd = new CustomMaterialProperty<float>( this, CCHairShader.highlightAOverlapEnd );
highlightAInvert = new CustomMaterialProperty<float>( this, CCHairShader.highlightAInvert );
highlightAFadeOutStart = new CustomMaterialProperty<float>( this, CCHairShader.highlightAFadeOutStart );
highlightAFadeOutRange = new CustomMaterialProperty<float>( this, CCHairShader.highlightAFadeOutRange );
highlightAFadeOutPower = new CustomMaterialProperty<float>( this, CCHairShader.highlightAFadeOutPower );
highlightAFadeOutAmount = new CustomMaterialProperty<float>( this, CCHairShader.highlightAFadeOutAmount );
highlightBColor = new CustomMaterialProperty<Color>( this, CCHairShader.highlightBColor );
highlightBStrength = new CustomMaterialProperty<float>( this, CCHairShader.highlightBStrength );
highlightBRange = new CustomMaterialProperty<Vector3>( this, CCHairShader.highlightBRange );
highlightBOverlapEnd = new CustomMaterialProperty<float>( this, CCHairShader.highlightBOverlapEnd );
highlightBInvert = new CustomMaterialProperty<float>( this, CCHairShader.highlightBInvert );
highlightBFadeOutStart = new CustomMaterialProperty<float>( this, CCHairShader.highlightBFadeOutStart );
highlightBFadeOutRange = new CustomMaterialProperty<float>( this, CCHairShader.highlightBFadeOutRange );
highlightBFadeOutPower = new CustomMaterialProperty<float>( this, CCHairShader.highlightBFadeOutPower );
highlightBFadeOutAmount = new CustomMaterialProperty<float>( this, CCHairShader.highlightBFadeOutAmount );
roughness = new CustomMaterialProperty<float>( this, CCHairShader.roughness );
roughnessOffset = new CustomMaterialProperty<float>( this, CCHairShader.roughnessOffset );
textureRoughness = new CustomMaterialProperty<Texture2D>( this, CCHairShader.textureRoughness );
@ -201,12 +199,16 @@ namespace Rokojori
metallicOffset = new CustomMaterialProperty<float>( this, CCHairShader.metallicOffset );
textureMetallic = new CustomMaterialProperty<Texture2D>( this, CCHairShader.textureMetallic );
specular = new CustomMaterialProperty<float>( this, CCHairShader.specular );
specularOpacityAmount = new CustomMaterialProperty<float>( this, CCHairShader.specularOpacityAmount );
specularOpacityGamma = new CustomMaterialProperty<float>( this, CCHairShader.specularOpacityGamma );
anisotropyRatio = new CustomMaterialProperty<float>( this, CCHairShader.anisotropyRatio );
textureEmission = new CustomMaterialProperty<Texture2D>( this, CCHairShader.textureEmission );
emission = new CustomMaterialProperty<Color>( this, CCHairShader.emission );
emissionEnergy = new CustomMaterialProperty<float>( this, CCHairShader.emissionEnergy );
backlight = new CustomMaterialProperty<Color>( this, CCHairShader.backlight );
albedoToBacklightAmount = new CustomMaterialProperty<float>( this, CCHairShader.albedoToBacklightAmount );
textureBacklight = new CustomMaterialProperty<Texture2D>( this, CCHairShader.textureBacklight );
subsurfaceScatteringStrength = new CustomMaterialProperty<float>( this, CCHairShader.subsurfaceScatteringStrength );
textureAmbientOcclusion = new CustomMaterialProperty<Texture2D>( this, CCHairShader.textureAmbientOcclusion );
aoLightAffect = new CustomMaterialProperty<float>( this, CCHairShader.aoLightAffect );
ambientOcclusion = new CustomMaterialProperty<float>( this, CCHairShader.ambientOcclusion );
@ -215,6 +217,7 @@ namespace Rokojori
rootOcclusionRange = new CustomMaterialProperty<float>( this, CCHairShader.rootOcclusionRange );
endOcclusionAmount = new CustomMaterialProperty<float>( this, CCHairShader.endOcclusionAmount );
endOcclusionRange = new CustomMaterialProperty<float>( this, CCHairShader.endOcclusionRange );
rootBasedOcclusion = new CustomMaterialProperty<float>( this, CCHairShader.rootBasedOcclusion );
}
}

View File

@ -35,24 +35,20 @@ namespace Rokojori
public static readonly FloatPropertyName strandEndStrength = FloatPropertyName.Create( "strandEndStrength" );
public static readonly FloatPropertyName strandGamma = FloatPropertyName.Create( "strandGamma" );
public static readonly FloatPropertyName maximumHighlightAmount = FloatPropertyName.Create( "maximumHighlightAmount" );
public static readonly FloatPropertyName highlightFadeOutStart = FloatPropertyName.Create( "highlightFadeOutStart" );
public static readonly FloatPropertyName highlightFadeOutEnd = FloatPropertyName.Create( "highlightFadeOutEnd" );
public static readonly FloatPropertyName highlightFadeOutPower = FloatPropertyName.Create( "highlightFadeOutPower" );
public static readonly FloatPropertyName highlightFadeOutAmount = FloatPropertyName.Create( "highlightFadeOutAmount" );
public static readonly ColorPropertyName highlightAColor = ColorPropertyName.Create( "highlightAColor" );
public static readonly FloatPropertyName highlightAStrength = FloatPropertyName.Create( "highlightAStrength" );
public static readonly Vector3PropertyName highlightARange = Vector3PropertyName.Create( "highlightARange" );
public static readonly FloatPropertyName highlightAOverlapEnd = FloatPropertyName.Create( "highlightAOverlapEnd" );
public static readonly FloatPropertyName highlightAInvert = FloatPropertyName.Create( "highlightAInvert" );
public static readonly FloatPropertyName highlightAFadeOutStart = FloatPropertyName.Create( "highlightAFadeOutStart" );
public static readonly FloatPropertyName highlightAFadeOutRange = FloatPropertyName.Create( "highlightAFadeOutRange" );
public static readonly FloatPropertyName highlightAFadeOutPower = FloatPropertyName.Create( "highlightAFadeOutPower" );
public static readonly FloatPropertyName highlightAFadeOutAmount = FloatPropertyName.Create( "highlightAFadeOutAmount" );
public static readonly ColorPropertyName highlightBColor = ColorPropertyName.Create( "highlightBColor" );
public static readonly FloatPropertyName highlightBStrength = FloatPropertyName.Create( "highlightBStrength" );
public static readonly Vector3PropertyName highlightBRange = Vector3PropertyName.Create( "highlightBRange" );
public static readonly FloatPropertyName highlightBOverlapEnd = FloatPropertyName.Create( "highlightBOverlapEnd" );
public static readonly FloatPropertyName highlightBInvert = FloatPropertyName.Create( "highlightBInvert" );
public static readonly FloatPropertyName highlightBFadeOutStart = FloatPropertyName.Create( "highlightBFadeOutStart" );
public static readonly FloatPropertyName highlightBFadeOutRange = FloatPropertyName.Create( "highlightBFadeOutRange" );
public static readonly FloatPropertyName highlightBFadeOutPower = FloatPropertyName.Create( "highlightBFadeOutPower" );
public static readonly FloatPropertyName highlightBFadeOutAmount = FloatPropertyName.Create( "highlightBFadeOutAmount" );
public static readonly FloatPropertyName roughness = FloatPropertyName.Create( "roughness" );
public static readonly FloatPropertyName roughnessOffset = FloatPropertyName.Create( "roughnessOffset" );
public static readonly Texture2DPropertyName textureRoughness = Texture2DPropertyName.Create( "texture_roughness" );
@ -60,12 +56,16 @@ namespace Rokojori
public static readonly FloatPropertyName metallicOffset = FloatPropertyName.Create( "metallicOffset" );
public static readonly Texture2DPropertyName textureMetallic = Texture2DPropertyName.Create( "texture_metallic" );
public static readonly FloatPropertyName specular = FloatPropertyName.Create( "specular" );
public static readonly FloatPropertyName specularOpacityAmount = FloatPropertyName.Create( "specularOpacityAmount" );
public static readonly FloatPropertyName specularOpacityGamma = FloatPropertyName.Create( "specularOpacityGamma" );
public static readonly FloatPropertyName anisotropyRatio = FloatPropertyName.Create( "anisotropy_ratio" );
public static readonly Texture2DPropertyName textureEmission = Texture2DPropertyName.Create( "texture_emission" );
public static readonly ColorPropertyName emission = ColorPropertyName.Create( "emission" );
public static readonly FloatPropertyName emissionEnergy = FloatPropertyName.Create( "emission_energy" );
public static readonly ColorPropertyName backlight = ColorPropertyName.Create( "backlight" );
public static readonly FloatPropertyName albedoToBacklightAmount = FloatPropertyName.Create( "albedoToBacklightAmount" );
public static readonly Texture2DPropertyName textureBacklight = Texture2DPropertyName.Create( "texture_backlight" );
public static readonly FloatPropertyName subsurfaceScatteringStrength = FloatPropertyName.Create( "subsurface_scattering_strength" );
public static readonly Texture2DPropertyName textureAmbientOcclusion = Texture2DPropertyName.Create( "texture_ambient_occlusion" );
public static readonly FloatPropertyName aoLightAffect = FloatPropertyName.Create( "ao_light_affect" );
public static readonly FloatPropertyName ambientOcclusion = FloatPropertyName.Create( "ambientOcclusion" );
@ -74,6 +74,7 @@ namespace Rokojori
public static readonly FloatPropertyName rootOcclusionRange = FloatPropertyName.Create( "rootOcclusionRange" );
public static readonly FloatPropertyName endOcclusionAmount = FloatPropertyName.Create( "endOcclusionAmount" );
public static readonly FloatPropertyName endOcclusionRange = FloatPropertyName.Create( "endOcclusionRange" );
public static readonly FloatPropertyName rootBasedOcclusion = FloatPropertyName.Create( "rootBasedOcclusion" );
}
@ -107,24 +108,20 @@ namespace Rokojori
public readonly CustomMaterialProperty<float> strandEndStrength;
public readonly CustomMaterialProperty<float> strandGamma;
public readonly CustomMaterialProperty<float> maximumHighlightAmount;
public readonly CustomMaterialProperty<float> highlightFadeOutStart;
public readonly CustomMaterialProperty<float> highlightFadeOutEnd;
public readonly CustomMaterialProperty<float> highlightFadeOutPower;
public readonly CustomMaterialProperty<float> highlightFadeOutAmount;
public readonly CustomMaterialProperty<Color> highlightAColor;
public readonly CustomMaterialProperty<float> highlightAStrength;
public readonly CustomMaterialProperty<Vector3> highlightARange;
public readonly CustomMaterialProperty<float> highlightAOverlapEnd;
public readonly CustomMaterialProperty<float> highlightAInvert;
public readonly CustomMaterialProperty<float> highlightAFadeOutStart;
public readonly CustomMaterialProperty<float> highlightAFadeOutRange;
public readonly CustomMaterialProperty<float> highlightAFadeOutPower;
public readonly CustomMaterialProperty<float> highlightAFadeOutAmount;
public readonly CustomMaterialProperty<Color> highlightBColor;
public readonly CustomMaterialProperty<float> highlightBStrength;
public readonly CustomMaterialProperty<Vector3> highlightBRange;
public readonly CustomMaterialProperty<float> highlightBOverlapEnd;
public readonly CustomMaterialProperty<float> highlightBInvert;
public readonly CustomMaterialProperty<float> highlightBFadeOutStart;
public readonly CustomMaterialProperty<float> highlightBFadeOutRange;
public readonly CustomMaterialProperty<float> highlightBFadeOutPower;
public readonly CustomMaterialProperty<float> highlightBFadeOutAmount;
public readonly CustomMaterialProperty<float> roughness;
public readonly CustomMaterialProperty<float> roughnessOffset;
public readonly CustomMaterialProperty<Texture2D> textureRoughness;
@ -132,12 +129,16 @@ namespace Rokojori
public readonly CustomMaterialProperty<float> metallicOffset;
public readonly CustomMaterialProperty<Texture2D> textureMetallic;
public readonly CustomMaterialProperty<float> specular;
public readonly CustomMaterialProperty<float> specularOpacityAmount;
public readonly CustomMaterialProperty<float> specularOpacityGamma;
public readonly CustomMaterialProperty<float> anisotropyRatio;
public readonly CustomMaterialProperty<Texture2D> textureEmission;
public readonly CustomMaterialProperty<Color> emission;
public readonly CustomMaterialProperty<float> emissionEnergy;
public readonly CustomMaterialProperty<Color> backlight;
public readonly CustomMaterialProperty<float> albedoToBacklightAmount;
public readonly CustomMaterialProperty<Texture2D> textureBacklight;
public readonly CustomMaterialProperty<float> subsurfaceScatteringStrength;
public readonly CustomMaterialProperty<Texture2D> textureAmbientOcclusion;
public readonly CustomMaterialProperty<float> aoLightAffect;
public readonly CustomMaterialProperty<float> ambientOcclusion;
@ -146,6 +147,7 @@ namespace Rokojori
public readonly CustomMaterialProperty<float> rootOcclusionRange;
public readonly CustomMaterialProperty<float> endOcclusionAmount;
public readonly CustomMaterialProperty<float> endOcclusionRange;
public readonly CustomMaterialProperty<float> rootBasedOcclusion;
public CCHairScissorMaterial()
{
@ -176,24 +178,20 @@ namespace Rokojori
strandEndStrength = new CustomMaterialProperty<float>( this, CCHairScissorShader.strandEndStrength );
strandGamma = new CustomMaterialProperty<float>( this, CCHairScissorShader.strandGamma );
maximumHighlightAmount = new CustomMaterialProperty<float>( this, CCHairScissorShader.maximumHighlightAmount );
highlightFadeOutStart = new CustomMaterialProperty<float>( this, CCHairScissorShader.highlightFadeOutStart );
highlightFadeOutEnd = new CustomMaterialProperty<float>( this, CCHairScissorShader.highlightFadeOutEnd );
highlightFadeOutPower = new CustomMaterialProperty<float>( this, CCHairScissorShader.highlightFadeOutPower );
highlightFadeOutAmount = new CustomMaterialProperty<float>( this, CCHairScissorShader.highlightFadeOutAmount );
highlightAColor = new CustomMaterialProperty<Color>( this, CCHairScissorShader.highlightAColor );
highlightAStrength = new CustomMaterialProperty<float>( this, CCHairScissorShader.highlightAStrength );
highlightARange = new CustomMaterialProperty<Vector3>( this, CCHairScissorShader.highlightARange );
highlightAOverlapEnd = new CustomMaterialProperty<float>( this, CCHairScissorShader.highlightAOverlapEnd );
highlightAInvert = new CustomMaterialProperty<float>( this, CCHairScissorShader.highlightAInvert );
highlightAFadeOutStart = new CustomMaterialProperty<float>( this, CCHairScissorShader.highlightAFadeOutStart );
highlightAFadeOutRange = new CustomMaterialProperty<float>( this, CCHairScissorShader.highlightAFadeOutRange );
highlightAFadeOutPower = new CustomMaterialProperty<float>( this, CCHairScissorShader.highlightAFadeOutPower );
highlightAFadeOutAmount = new CustomMaterialProperty<float>( this, CCHairScissorShader.highlightAFadeOutAmount );
highlightBColor = new CustomMaterialProperty<Color>( this, CCHairScissorShader.highlightBColor );
highlightBStrength = new CustomMaterialProperty<float>( this, CCHairScissorShader.highlightBStrength );
highlightBRange = new CustomMaterialProperty<Vector3>( this, CCHairScissorShader.highlightBRange );
highlightBOverlapEnd = new CustomMaterialProperty<float>( this, CCHairScissorShader.highlightBOverlapEnd );
highlightBInvert = new CustomMaterialProperty<float>( this, CCHairScissorShader.highlightBInvert );
highlightBFadeOutStart = new CustomMaterialProperty<float>( this, CCHairScissorShader.highlightBFadeOutStart );
highlightBFadeOutRange = new CustomMaterialProperty<float>( this, CCHairScissorShader.highlightBFadeOutRange );
highlightBFadeOutPower = new CustomMaterialProperty<float>( this, CCHairScissorShader.highlightBFadeOutPower );
highlightBFadeOutAmount = new CustomMaterialProperty<float>( this, CCHairScissorShader.highlightBFadeOutAmount );
roughness = new CustomMaterialProperty<float>( this, CCHairScissorShader.roughness );
roughnessOffset = new CustomMaterialProperty<float>( this, CCHairScissorShader.roughnessOffset );
textureRoughness = new CustomMaterialProperty<Texture2D>( this, CCHairScissorShader.textureRoughness );
@ -201,12 +199,16 @@ namespace Rokojori
metallicOffset = new CustomMaterialProperty<float>( this, CCHairScissorShader.metallicOffset );
textureMetallic = new CustomMaterialProperty<Texture2D>( this, CCHairScissorShader.textureMetallic );
specular = new CustomMaterialProperty<float>( this, CCHairScissorShader.specular );
specularOpacityAmount = new CustomMaterialProperty<float>( this, CCHairScissorShader.specularOpacityAmount );
specularOpacityGamma = new CustomMaterialProperty<float>( this, CCHairScissorShader.specularOpacityGamma );
anisotropyRatio = new CustomMaterialProperty<float>( this, CCHairScissorShader.anisotropyRatio );
textureEmission = new CustomMaterialProperty<Texture2D>( this, CCHairScissorShader.textureEmission );
emission = new CustomMaterialProperty<Color>( this, CCHairScissorShader.emission );
emissionEnergy = new CustomMaterialProperty<float>( this, CCHairScissorShader.emissionEnergy );
backlight = new CustomMaterialProperty<Color>( this, CCHairScissorShader.backlight );
albedoToBacklightAmount = new CustomMaterialProperty<float>( this, CCHairScissorShader.albedoToBacklightAmount );
textureBacklight = new CustomMaterialProperty<Texture2D>( this, CCHairScissorShader.textureBacklight );
subsurfaceScatteringStrength = new CustomMaterialProperty<float>( this, CCHairScissorShader.subsurfaceScatteringStrength );
textureAmbientOcclusion = new CustomMaterialProperty<Texture2D>( this, CCHairScissorShader.textureAmbientOcclusion );
aoLightAffect = new CustomMaterialProperty<float>( this, CCHairScissorShader.aoLightAffect );
ambientOcclusion = new CustomMaterialProperty<float>( this, CCHairScissorShader.ambientOcclusion );
@ -215,6 +217,7 @@ namespace Rokojori
rootOcclusionRange = new CustomMaterialProperty<float>( this, CCHairScissorShader.rootOcclusionRange );
endOcclusionAmount = new CustomMaterialProperty<float>( this, CCHairScissorShader.endOcclusionAmount );
endOcclusionRange = new CustomMaterialProperty<float>( this, CCHairScissorShader.endOcclusionRange );
rootBasedOcclusion = new CustomMaterialProperty<float>( this, CCHairScissorShader.rootBasedOcclusion );
}
}

View File

@ -7,10 +7,80 @@ namespace Rokojori
public class CCHairShadowShader
{
public static readonly CachedResource<Shader> shader = new CachedResource<Shader>(
"res://addons/rokojori_action_library/Runtime/Reallusion/Shaders/CCHairShadow.gdshader"
"res://addons/rokojori_action_library/Runtime/Reallusion/Shaders/Hair/Variants/CCHairShadow.gdshader"
);
public static readonly BoolPropertyName enabled = BoolPropertyName.Create( "enabled" );
public static readonly ColorPropertyName albedo = ColorPropertyName.Create( "albedo" );
public static readonly Texture2DPropertyName textureAlbedo = Texture2DPropertyName.Create( "texture_albedo" );
public static readonly Vector3PropertyName hslOffset = Vector3PropertyName.Create( "hslOffset" );
public static readonly Texture2DPropertyName textureBlend = Texture2DPropertyName.Create( "texture_blend" );
public static readonly FloatPropertyName blendAmount = FloatPropertyName.Create( "blendAmount" );
public static readonly FloatPropertyName naturalColors = FloatPropertyName.Create( "naturalColors" );
public static readonly Texture2DPropertyName textureOpacity = Texture2DPropertyName.Create( "texture_opacity" );
public static readonly FloatPropertyName opacity = FloatPropertyName.Create( "opacity" );
public static readonly FloatPropertyName opacityGamma = FloatPropertyName.Create( "opacityGamma" );
public static readonly FloatPropertyName opacityFarScale = FloatPropertyName.Create( "opacityFarScale" );
public static readonly FloatPropertyName opacityBlur = FloatPropertyName.Create( "opacityBlur" );
public static readonly FloatPropertyName opacityBlurFarScale = FloatPropertyName.Create( "opacityBlurFarScale" );
public static readonly FloatPropertyName opacityFarStart = FloatPropertyName.Create( "opacityFarStart" );
public static readonly FloatPropertyName opacityFarRange = FloatPropertyName.Create( "opacityFarRange" );
public static readonly FloatPropertyName opacityFarPower = FloatPropertyName.Create( "opacityFarPower" );
public static readonly FloatPropertyName extending = FloatPropertyName.Create( "extending" );
public static readonly Texture2DPropertyName rootMap = Texture2DPropertyName.Create( "rootMap" );
public static readonly Texture2DPropertyName flowMap = Texture2DPropertyName.Create( "flowMap" );
public static readonly Texture2DPropertyName idMap = Texture2DPropertyName.Create( "idMap" );
public static readonly FloatPropertyName diffuseStrength = FloatPropertyName.Create( "diffuseStrength" );
public static readonly FloatPropertyName vertexColorStrength = FloatPropertyName.Create( "vertexColorStrength" );
public static readonly ColorPropertyName vertexGreyToColor = ColorPropertyName.Create( "vertexGreyToColor" );
public static readonly BoolPropertyName activateHairColor = BoolPropertyName.Create( "activateHairColor" );
public static readonly FloatPropertyName baseColorMapStrength = FloatPropertyName.Create( "baseColorMapStrength" );
public static readonly ColorPropertyName strandRootColor = ColorPropertyName.Create( "strandRootColor" );
public static readonly FloatPropertyName strandRootStrength = FloatPropertyName.Create( "strandRootStrength" );
public static readonly ColorPropertyName strandEndColor = ColorPropertyName.Create( "strandEndColor" );
public static readonly FloatPropertyName strandEndStrength = FloatPropertyName.Create( "strandEndStrength" );
public static readonly FloatPropertyName strandGamma = FloatPropertyName.Create( "strandGamma" );
public static readonly FloatPropertyName maximumHighlightAmount = FloatPropertyName.Create( "maximumHighlightAmount" );
public static readonly FloatPropertyName highlightFadeOutStart = FloatPropertyName.Create( "highlightFadeOutStart" );
public static readonly FloatPropertyName highlightFadeOutEnd = FloatPropertyName.Create( "highlightFadeOutEnd" );
public static readonly FloatPropertyName highlightFadeOutPower = FloatPropertyName.Create( "highlightFadeOutPower" );
public static readonly FloatPropertyName highlightFadeOutAmount = FloatPropertyName.Create( "highlightFadeOutAmount" );
public static readonly ColorPropertyName highlightAColor = ColorPropertyName.Create( "highlightAColor" );
public static readonly FloatPropertyName highlightAStrength = FloatPropertyName.Create( "highlightAStrength" );
public static readonly Vector3PropertyName highlightARange = Vector3PropertyName.Create( "highlightARange" );
public static readonly FloatPropertyName highlightAOverlapEnd = FloatPropertyName.Create( "highlightAOverlapEnd" );
public static readonly FloatPropertyName highlightAInvert = FloatPropertyName.Create( "highlightAInvert" );
public static readonly ColorPropertyName highlightBColor = ColorPropertyName.Create( "highlightBColor" );
public static readonly FloatPropertyName highlightBStrength = FloatPropertyName.Create( "highlightBStrength" );
public static readonly Vector3PropertyName highlightBRange = Vector3PropertyName.Create( "highlightBRange" );
public static readonly FloatPropertyName highlightBOverlapEnd = FloatPropertyName.Create( "highlightBOverlapEnd" );
public static readonly FloatPropertyName highlightBInvert = FloatPropertyName.Create( "highlightBInvert" );
public static readonly FloatPropertyName roughness = FloatPropertyName.Create( "roughness" );
public static readonly FloatPropertyName roughnessOffset = FloatPropertyName.Create( "roughnessOffset" );
public static readonly Texture2DPropertyName textureRoughness = Texture2DPropertyName.Create( "texture_roughness" );
public static readonly FloatPropertyName metallic = FloatPropertyName.Create( "metallic" );
public static readonly FloatPropertyName metallicOffset = FloatPropertyName.Create( "metallicOffset" );
public static readonly Texture2DPropertyName textureMetallic = Texture2DPropertyName.Create( "texture_metallic" );
public static readonly FloatPropertyName specular = FloatPropertyName.Create( "specular" );
public static readonly FloatPropertyName specularOpacityAmount = FloatPropertyName.Create( "specularOpacityAmount" );
public static readonly FloatPropertyName specularOpacityGamma = FloatPropertyName.Create( "specularOpacityGamma" );
public static readonly FloatPropertyName anisotropyRatio = FloatPropertyName.Create( "anisotropy_ratio" );
public static readonly Texture2DPropertyName textureEmission = Texture2DPropertyName.Create( "texture_emission" );
public static readonly ColorPropertyName emission = ColorPropertyName.Create( "emission" );
public static readonly FloatPropertyName emissionEnergy = FloatPropertyName.Create( "emission_energy" );
public static readonly ColorPropertyName backlight = ColorPropertyName.Create( "backlight" );
public static readonly FloatPropertyName albedoToBacklightAmount = FloatPropertyName.Create( "albedoToBacklightAmount" );
public static readonly Texture2DPropertyName textureBacklight = Texture2DPropertyName.Create( "texture_backlight" );
public static readonly FloatPropertyName subsurfaceScatteringStrength = FloatPropertyName.Create( "subsurface_scattering_strength" );
public static readonly Texture2DPropertyName textureAmbientOcclusion = Texture2DPropertyName.Create( "texture_ambient_occlusion" );
public static readonly FloatPropertyName aoLightAffect = FloatPropertyName.Create( "ao_light_affect" );
public static readonly FloatPropertyName ambientOcclusion = FloatPropertyName.Create( "ambientOcclusion" );
public static readonly FloatPropertyName aoGamma = FloatPropertyName.Create( "aoGamma" );
public static readonly FloatPropertyName rootOcclusionAmount = FloatPropertyName.Create( "rootOcclusionAmount" );
public static readonly FloatPropertyName rootOcclusionRange = FloatPropertyName.Create( "rootOcclusionRange" );
public static readonly FloatPropertyName endOcclusionAmount = FloatPropertyName.Create( "endOcclusionAmount" );
public static readonly FloatPropertyName endOcclusionRange = FloatPropertyName.Create( "endOcclusionRange" );
public static readonly FloatPropertyName rootBasedOcclusion = FloatPropertyName.Create( "rootBasedOcclusion" );
}
@ -19,13 +89,153 @@ namespace Rokojori
{
public readonly CustomMaterialProperty<bool> enabled;
public readonly CustomMaterialProperty<Color> albedo;
public readonly CustomMaterialProperty<Texture2D> textureAlbedo;
public readonly CustomMaterialProperty<Vector3> hslOffset;
public readonly CustomMaterialProperty<Texture2D> textureBlend;
public readonly CustomMaterialProperty<float> blendAmount;
public readonly CustomMaterialProperty<float> naturalColors;
public readonly CustomMaterialProperty<Texture2D> textureOpacity;
public readonly CustomMaterialProperty<float> opacity;
public readonly CustomMaterialProperty<float> opacityGamma;
public readonly CustomMaterialProperty<float> opacityFarScale;
public readonly CustomMaterialProperty<float> opacityBlur;
public readonly CustomMaterialProperty<float> opacityBlurFarScale;
public readonly CustomMaterialProperty<float> opacityFarStart;
public readonly CustomMaterialProperty<float> opacityFarRange;
public readonly CustomMaterialProperty<float> opacityFarPower;
public readonly CustomMaterialProperty<float> extending;
public readonly CustomMaterialProperty<Texture2D> rootMap;
public readonly CustomMaterialProperty<Texture2D> flowMap;
public readonly CustomMaterialProperty<Texture2D> idMap;
public readonly CustomMaterialProperty<float> diffuseStrength;
public readonly CustomMaterialProperty<float> vertexColorStrength;
public readonly CustomMaterialProperty<Color> vertexGreyToColor;
public readonly CustomMaterialProperty<bool> activateHairColor;
public readonly CustomMaterialProperty<float> baseColorMapStrength;
public readonly CustomMaterialProperty<Color> strandRootColor;
public readonly CustomMaterialProperty<float> strandRootStrength;
public readonly CustomMaterialProperty<Color> strandEndColor;
public readonly CustomMaterialProperty<float> strandEndStrength;
public readonly CustomMaterialProperty<float> strandGamma;
public readonly CustomMaterialProperty<float> maximumHighlightAmount;
public readonly CustomMaterialProperty<float> highlightFadeOutStart;
public readonly CustomMaterialProperty<float> highlightFadeOutEnd;
public readonly CustomMaterialProperty<float> highlightFadeOutPower;
public readonly CustomMaterialProperty<float> highlightFadeOutAmount;
public readonly CustomMaterialProperty<Color> highlightAColor;
public readonly CustomMaterialProperty<float> highlightAStrength;
public readonly CustomMaterialProperty<Vector3> highlightARange;
public readonly CustomMaterialProperty<float> highlightAOverlapEnd;
public readonly CustomMaterialProperty<float> highlightAInvert;
public readonly CustomMaterialProperty<Color> highlightBColor;
public readonly CustomMaterialProperty<float> highlightBStrength;
public readonly CustomMaterialProperty<Vector3> highlightBRange;
public readonly CustomMaterialProperty<float> highlightBOverlapEnd;
public readonly CustomMaterialProperty<float> highlightBInvert;
public readonly CustomMaterialProperty<float> roughness;
public readonly CustomMaterialProperty<float> roughnessOffset;
public readonly CustomMaterialProperty<Texture2D> textureRoughness;
public readonly CustomMaterialProperty<float> metallic;
public readonly CustomMaterialProperty<float> metallicOffset;
public readonly CustomMaterialProperty<Texture2D> textureMetallic;
public readonly CustomMaterialProperty<float> specular;
public readonly CustomMaterialProperty<float> specularOpacityAmount;
public readonly CustomMaterialProperty<float> specularOpacityGamma;
public readonly CustomMaterialProperty<float> anisotropyRatio;
public readonly CustomMaterialProperty<Texture2D> textureEmission;
public readonly CustomMaterialProperty<Color> emission;
public readonly CustomMaterialProperty<float> emissionEnergy;
public readonly CustomMaterialProperty<Color> backlight;
public readonly CustomMaterialProperty<float> albedoToBacklightAmount;
public readonly CustomMaterialProperty<Texture2D> textureBacklight;
public readonly CustomMaterialProperty<float> subsurfaceScatteringStrength;
public readonly CustomMaterialProperty<Texture2D> textureAmbientOcclusion;
public readonly CustomMaterialProperty<float> aoLightAffect;
public readonly CustomMaterialProperty<float> ambientOcclusion;
public readonly CustomMaterialProperty<float> aoGamma;
public readonly CustomMaterialProperty<float> rootOcclusionAmount;
public readonly CustomMaterialProperty<float> rootOcclusionRange;
public readonly CustomMaterialProperty<float> endOcclusionAmount;
public readonly CustomMaterialProperty<float> endOcclusionRange;
public readonly CustomMaterialProperty<float> rootBasedOcclusion;
public CCHairShadowMaterial()
{
Shader = CCHairShadowShader.shader.Get();
enabled = new CustomMaterialProperty<bool>( this, CCHairShadowShader.enabled );
albedo = new CustomMaterialProperty<Color>( this, CCHairShadowShader.albedo );
textureAlbedo = new CustomMaterialProperty<Texture2D>( this, CCHairShadowShader.textureAlbedo );
hslOffset = new CustomMaterialProperty<Vector3>( this, CCHairShadowShader.hslOffset );
textureBlend = new CustomMaterialProperty<Texture2D>( this, CCHairShadowShader.textureBlend );
blendAmount = new CustomMaterialProperty<float>( this, CCHairShadowShader.blendAmount );
naturalColors = new CustomMaterialProperty<float>( this, CCHairShadowShader.naturalColors );
textureOpacity = new CustomMaterialProperty<Texture2D>( this, CCHairShadowShader.textureOpacity );
opacity = new CustomMaterialProperty<float>( this, CCHairShadowShader.opacity );
opacityGamma = new CustomMaterialProperty<float>( this, CCHairShadowShader.opacityGamma );
opacityFarScale = new CustomMaterialProperty<float>( this, CCHairShadowShader.opacityFarScale );
opacityBlur = new CustomMaterialProperty<float>( this, CCHairShadowShader.opacityBlur );
opacityBlurFarScale = new CustomMaterialProperty<float>( this, CCHairShadowShader.opacityBlurFarScale );
opacityFarStart = new CustomMaterialProperty<float>( this, CCHairShadowShader.opacityFarStart );
opacityFarRange = new CustomMaterialProperty<float>( this, CCHairShadowShader.opacityFarRange );
opacityFarPower = new CustomMaterialProperty<float>( this, CCHairShadowShader.opacityFarPower );
extending = new CustomMaterialProperty<float>( this, CCHairShadowShader.extending );
rootMap = new CustomMaterialProperty<Texture2D>( this, CCHairShadowShader.rootMap );
flowMap = new CustomMaterialProperty<Texture2D>( this, CCHairShadowShader.flowMap );
idMap = new CustomMaterialProperty<Texture2D>( this, CCHairShadowShader.idMap );
diffuseStrength = new CustomMaterialProperty<float>( this, CCHairShadowShader.diffuseStrength );
vertexColorStrength = new CustomMaterialProperty<float>( this, CCHairShadowShader.vertexColorStrength );
vertexGreyToColor = new CustomMaterialProperty<Color>( this, CCHairShadowShader.vertexGreyToColor );
activateHairColor = new CustomMaterialProperty<bool>( this, CCHairShadowShader.activateHairColor );
baseColorMapStrength = new CustomMaterialProperty<float>( this, CCHairShadowShader.baseColorMapStrength );
strandRootColor = new CustomMaterialProperty<Color>( this, CCHairShadowShader.strandRootColor );
strandRootStrength = new CustomMaterialProperty<float>( this, CCHairShadowShader.strandRootStrength );
strandEndColor = new CustomMaterialProperty<Color>( this, CCHairShadowShader.strandEndColor );
strandEndStrength = new CustomMaterialProperty<float>( this, CCHairShadowShader.strandEndStrength );
strandGamma = new CustomMaterialProperty<float>( this, CCHairShadowShader.strandGamma );
maximumHighlightAmount = new CustomMaterialProperty<float>( this, CCHairShadowShader.maximumHighlightAmount );
highlightFadeOutStart = new CustomMaterialProperty<float>( this, CCHairShadowShader.highlightFadeOutStart );
highlightFadeOutEnd = new CustomMaterialProperty<float>( this, CCHairShadowShader.highlightFadeOutEnd );
highlightFadeOutPower = new CustomMaterialProperty<float>( this, CCHairShadowShader.highlightFadeOutPower );
highlightFadeOutAmount = new CustomMaterialProperty<float>( this, CCHairShadowShader.highlightFadeOutAmount );
highlightAColor = new CustomMaterialProperty<Color>( this, CCHairShadowShader.highlightAColor );
highlightAStrength = new CustomMaterialProperty<float>( this, CCHairShadowShader.highlightAStrength );
highlightARange = new CustomMaterialProperty<Vector3>( this, CCHairShadowShader.highlightARange );
highlightAOverlapEnd = new CustomMaterialProperty<float>( this, CCHairShadowShader.highlightAOverlapEnd );
highlightAInvert = new CustomMaterialProperty<float>( this, CCHairShadowShader.highlightAInvert );
highlightBColor = new CustomMaterialProperty<Color>( this, CCHairShadowShader.highlightBColor );
highlightBStrength = new CustomMaterialProperty<float>( this, CCHairShadowShader.highlightBStrength );
highlightBRange = new CustomMaterialProperty<Vector3>( this, CCHairShadowShader.highlightBRange );
highlightBOverlapEnd = new CustomMaterialProperty<float>( this, CCHairShadowShader.highlightBOverlapEnd );
highlightBInvert = new CustomMaterialProperty<float>( this, CCHairShadowShader.highlightBInvert );
roughness = new CustomMaterialProperty<float>( this, CCHairShadowShader.roughness );
roughnessOffset = new CustomMaterialProperty<float>( this, CCHairShadowShader.roughnessOffset );
textureRoughness = new CustomMaterialProperty<Texture2D>( this, CCHairShadowShader.textureRoughness );
metallic = new CustomMaterialProperty<float>( this, CCHairShadowShader.metallic );
metallicOffset = new CustomMaterialProperty<float>( this, CCHairShadowShader.metallicOffset );
textureMetallic = new CustomMaterialProperty<Texture2D>( this, CCHairShadowShader.textureMetallic );
specular = new CustomMaterialProperty<float>( this, CCHairShadowShader.specular );
specularOpacityAmount = new CustomMaterialProperty<float>( this, CCHairShadowShader.specularOpacityAmount );
specularOpacityGamma = new CustomMaterialProperty<float>( this, CCHairShadowShader.specularOpacityGamma );
anisotropyRatio = new CustomMaterialProperty<float>( this, CCHairShadowShader.anisotropyRatio );
textureEmission = new CustomMaterialProperty<Texture2D>( this, CCHairShadowShader.textureEmission );
emission = new CustomMaterialProperty<Color>( this, CCHairShadowShader.emission );
emissionEnergy = new CustomMaterialProperty<float>( this, CCHairShadowShader.emissionEnergy );
backlight = new CustomMaterialProperty<Color>( this, CCHairShadowShader.backlight );
albedoToBacklightAmount = new CustomMaterialProperty<float>( this, CCHairShadowShader.albedoToBacklightAmount );
textureBacklight = new CustomMaterialProperty<Texture2D>( this, CCHairShadowShader.textureBacklight );
subsurfaceScatteringStrength = new CustomMaterialProperty<float>( this, CCHairShadowShader.subsurfaceScatteringStrength );
textureAmbientOcclusion = new CustomMaterialProperty<Texture2D>( this, CCHairShadowShader.textureAmbientOcclusion );
aoLightAffect = new CustomMaterialProperty<float>( this, CCHairShadowShader.aoLightAffect );
ambientOcclusion = new CustomMaterialProperty<float>( this, CCHairShadowShader.ambientOcclusion );
aoGamma = new CustomMaterialProperty<float>( this, CCHairShadowShader.aoGamma );
rootOcclusionAmount = new CustomMaterialProperty<float>( this, CCHairShadowShader.rootOcclusionAmount );
rootOcclusionRange = new CustomMaterialProperty<float>( this, CCHairShadowShader.rootOcclusionRange );
endOcclusionAmount = new CustomMaterialProperty<float>( this, CCHairShadowShader.endOcclusionAmount );
endOcclusionRange = new CustomMaterialProperty<float>( this, CCHairShadowShader.endOcclusionRange );
rootBasedOcclusion = new CustomMaterialProperty<float>( this, CCHairShadowShader.rootBasedOcclusion );
}
}

View File

@ -1,4 +1,4 @@
[gd_resource type="Resource" script_class="InputIconsLibrary" load_steps=73 format=3 uid="uid://dq52vhnqr5m6"]
[gd_resource type="Resource" script_class="InputIconsLibrary" load_steps=74 format=3 uid="uid://dq52vhnqr5m6"]
[ext_resource type="Script" uid="uid://c3dpplc2slwd5" path="res://addons/rokojori_action_library/Runtime/Sensors/InputIcons/Definitions/DefaultInputIconDefinition.cs" id="1_64knt"]
[ext_resource type="Script" uid="uid://bx1cm2837cuuc" path="res://addons/rokojori_action_library/Runtime/Sensors/InputIcons/InputIconsLibrary.cs" id="1_urlfx"]
@ -28,6 +28,7 @@
[ext_resource type="Texture2D" uid="uid://dxwnbh3a3fy8w" path="res://addons/rokojori_action_library/Runtime/Sensors/InputIcons/Graphics/GamePad-Left-Shoulder-Button.svg" id="13_omll7"]
[ext_resource type="Texture2D" uid="uid://1pfyxi7wifn8" path="res://addons/rokojori_action_library/Runtime/Sensors/InputIcons/Graphics/Keyboard-SpaceKey.svg" id="14_6vom6"]
[ext_resource type="Texture2D" uid="uid://bgi8cbw57gka0" path="res://addons/rokojori_action_library/Runtime/Sensors/InputIcons/Graphics/GamePad-MainButton.svg" id="14_n68qo"]
[ext_resource type="SystemFont" uid="uid://s1pi67tbxu24" path="res://3rdPerson/Inputs/Jost-Font.tres" id="15_co1yv"]
[ext_resource type="Texture2D" uid="uid://cb8ldiej8234h" path="res://addons/rokojori_action_library/Runtime/Sensors/InputIcons/Graphics/GamePad-Axis-Background.svg" id="18_amimm"]
[ext_resource type="Texture2D" uid="uid://ddfvjmi7sva6f" path="res://addons/rokojori_action_library/Runtime/Sensors/InputIcons/Graphics/GamePad-Axis-Pressed.svg" id="19_7x4g0"]
[ext_resource type="Script" uid="uid://bvj322mokkq63" path="res://addons/rokojori_action_library/Runtime/Localization/LocaleText.cs" id="20_55eoq"]
@ -339,6 +340,7 @@ borderBottom = 0.0
[resource]
script = ExtResource("1_urlfx")
font = ExtResource("15_co1yv")
fontSize = SubResource("Resource_40bf3")
iconHeightInEm = 1.5
mouseInputIcon = SubResource("Resource_34cgw")

View File

@ -23,9 +23,6 @@ namespace Rokojori
[Export]
public Node[] autoScanForSensors = [];
[Export]
public bool autoScanParent = true;
[Export]
public bool separateMouseAndKeyboardTracking = false;
@ -77,6 +74,11 @@ namespace Rokojori
{
get
{
if ( Engine.IsEditorHint() )
{
return null;
}
if ( testingLastActiveDevice != null )
{
return testingLastActiveDevice;
@ -96,8 +98,14 @@ namespace Rokojori
void UpdateDevice( SensorDevice d )
{
if ( Engine.IsEditorHint() )
{
return;
}
var lastActive = lastActiveDevice;
var index = Arrays.IndexOf( deviceList, d );
if ( index == -1 )
@ -121,6 +129,11 @@ namespace Rokojori
public void UpdateLastActiveDevice( Sensor sensor, int index )
{
if ( Engine.IsEditorHint() )
{
return;
}
if ( keyboardDevice.ContainsSensor( sensor ) )
{
UpdateDevice( separateMouseAndKeyboardTracking ? keyboardDevice : mouseKeyboardDevice );
@ -154,21 +167,40 @@ namespace Rokojori
}
}
public override void _Ready()
// public override void _Ready()
// {
// if ( Engine.IsEditorHint() )
// {
// return;
// }
// //this.LogInfo( "" );
// _startTime = DateTime.Now;
// mouseKeyboardDevice.devices = new SensorDevice[]{ mouseDevice, keyboardDevice };
// if ( ! initializeOnReady )
// {
// return;
// }
// CreateRunners();
// }
public void Initialize()
{
_startTime = DateTime.Now;
mouseKeyboardDevice.devices = new SensorDevice[]{ mouseDevice, keyboardDevice };
if ( ! initializeOnReady )
{
return;
}
CreateRunners();
}
public override void _Input( InputEvent ev )
{
if ( Engine.IsEditorHint() )
{
return;
}
//this.LogInfo( "" );
inputers.ForEach(
( inp )=>
{
@ -179,6 +211,7 @@ namespace Rokojori
public override void _Process( double delta )
{
// //this.LogInfo( "" );
if ( Engine.IsEditorHint() || ! processSensors )
{
return;
@ -190,7 +223,11 @@ namespace Rokojori
public void Register( Sensor s, SensorInputHandler sih )
{
this.LogInfo( "Registrating", s );
if ( Engine.IsEditorHint() )
{
return;
}
//this.LogInfo( "Register", s );
var sensorRunner = sensorToRunner[ s ];
@ -206,12 +243,25 @@ namespace Rokojori
public void Unregister( Sensor s, SensorInputHandler sih )
{
if ( Engine.IsEditorHint() )
{
return;
}
//this.LogInfo( "Unregister", s );
var sensorRunner = sensorToRunner[ s ];
sensorRunner.listeners.Remove( sih );
}
public static void Register( SensorInputHandler handler, params Sensor[] sensors )
{
if ( Engine.IsEditorHint() )
{
return;
}
//RJLog.Log( "Register", sensors);
var sm = Unique<SensorManager>.Get();
if ( sm == null )
@ -233,6 +283,14 @@ namespace Rokojori
public static void Unregister( SensorInputHandler handler, params Sensor[] sensors )
{
if ( Engine.IsEditorHint() )
{
return;
}
//RJLog.Log( "Unregister", sensors);
var sm = Unique<SensorManager>.Get();
foreach ( var s in sensors )
@ -252,12 +310,19 @@ namespace Rokojori
void AddSensor( Sensor s )
{
if ( Engine.IsEditorHint() )
{
return;
}
//this.LogInfo( "AddSensor", s);
if ( s == null || sensorsSet.Contains( s ) )
{
return;
}
// this.LogInfo( "Including:", HierarchyName.Of( s ) );
// //this.LogInfo( "Including:", HierarchyName.Of( s ) );
AddSensorsFrom( s );
@ -274,6 +339,13 @@ namespace Rokojori
void AddSensorsFrom( object obj )
{
if ( Engine.IsEditorHint() )
{
return;
}
//this.LogInfo( "AddSensorsFrom", obj );
if ( obj == null || _scannedObjects.Contains( obj ) )
{
return;
@ -323,6 +395,13 @@ namespace Rokojori
void CreateRunners()
{
if ( Engine.IsEditorHint() )
{
return;
}
//this.LogInfo( "CreateRunners" );
if ( sensors == null )
{
sensors = new Sensor[]{};
@ -352,10 +431,10 @@ namespace Rokojori
Nodes.ForEach<Node>( n, AddSensorsFrom );
}
if ( autoScanParent )
{
Nodes.ForEach<Node>( GetParent(), AddSensorsFrom );
}
// if ( autoScanParent )
// {
// Nodes.ForEach<Node>( GetParent(), AddSensorsFrom );
// }
runners.ForEach(
r =>

View File

@ -0,0 +1,67 @@
using Godot;
using System.Collections.Generic;
using System;
namespace Rokojori
{
[Tool]
[GlobalClass,Icon("res://addons/rokojori_action_library/Icons/SensorManager.svg")]
public partial class SensorManagerSetup: Node
{
[Export]
public bool initializeOnReady = true;
[Export]
public Sensor[] sensors = [];
[Export]
public SensorGroup[] sensorGroups = [];
[Export]
public bool processSensors = true;
[Export]
public Node[] autoScanForSensors = [];
[Export]
public bool autoScanParent = true;
[Export]
public bool separateMouseAndKeyboardTracking = false;
[Export]
public Action onActiveDeviceChange;
[Export]
public bool showRegistratedSensors = true;
public override void _Ready()
{
if ( Engine.IsEditorHint() )
{
return;
}
var sm = this.CreateChild<SensorManager>( "SensorManager" );
sm.sensors = sensors;
sm.sensorGroups = sensorGroups;
sm.processSensors = processSensors;
sm.autoScanForSensors = autoScanForSensors;
sm.separateMouseAndKeyboardTracking = separateMouseAndKeyboardTracking;
sm.onActiveDeviceChange = onActiveDeviceChange;
sm.showRegistratedSensors = showRegistratedSensors;
if ( autoScanParent )
{
sm.autoScanForSensors = Arrays.Add( sm.autoScanForSensors, GetParent() );
}
if ( initializeOnReady )
{
sm.Initialize();
}
}
}
}

View File

@ -0,0 +1 @@
uid://irn5l5pgo176

View File

@ -16,7 +16,6 @@ namespace Rokojori
public override void _Ready()
{
this.LogInfo( "Root" );
SensorManager.Register( this, sensor );
}

View File

@ -45,7 +45,7 @@ namespace Rokojori
return;
}
RJLog.Log( "Is Different", u.name, ":", u.type, ">>", colorA, colorB );
// RJLog.Log( "Is Different", u.name, ":", u.type, ">>", colorA, colorB );
delta.colorProperties.Add( ColorProperty.Create( u.name, colorB ) );
}
@ -61,7 +61,7 @@ namespace Rokojori
}
RJLog.Log( "Is Different", u.name, ":", u.type, ">>", floatA, floatB );
// RJLog.Log( "Is Different", u.name, ":", u.type, ">>", floatA, floatB );
delta.floatProperties.Add( FloatProperty.Create( u.name, floatB ) );
}

View File

@ -0,0 +1,26 @@
using System.Diagnostics;
using System.Collections;
using System.Collections.Generic;
using System;
using Godot;
namespace Rokojori
{
[Tool]
[GlobalClass]
public partial class BeatsDuration:Duration
{
[Export]
public float beats;
[Export]
public float bpm;
public override float GetDurationInSeconds()
{
return MathAudio.BeatsToSeconds( beats, bpm );
}
}
}

View File

@ -0,0 +1 @@
uid://cwjgw33krmh11

View File

@ -0,0 +1,23 @@
using System.Diagnostics;
using System.Collections;
using System.Collections.Generic;
using System;
using Godot;
namespace Rokojori
{
[Tool]
[GlobalClass]
public partial class Duration:Resource
{
[Export]
public TimeLine timeLine;
public virtual float GetDurationInSeconds()
{
return 0;
}
}
}

View File

@ -0,0 +1 @@
uid://kqxbjjedkjyw

View File

@ -0,0 +1,23 @@
using System.Diagnostics;
using System.Collections;
using System.Collections.Generic;
using System;
using Godot;
namespace Rokojori
{
[Tool]
[GlobalClass]
public partial class SecondsDuration:Duration
{
[Export]
public float seconds;
public override float GetDurationInSeconds()
{
return seconds;
}
}
}

View File

@ -0,0 +1 @@
uid://ddhwhwos5kkrm

View File

View File

@ -0,0 +1 @@
uid://cb610tq0tjv30

View File

@ -1,6 +1,6 @@
[gd_resource type="Resource" script_class="UISettings" load_steps=3 format=3 uid="uid://dp57o0ykhkqfj"]
[ext_resource type="Script" path="res://addons/rokojori_action_library/Runtime/UI/UISettings.cs" id="1_5a283"]
[ext_resource type="Script" uid="uid://cgdxalxhdbmjn" path="res://addons/rokojori_action_library/Runtime/UI/UISettings.cs" id="1_5a283"]
[ext_resource type="Resource" uid="uid://bhy8b3gopkq4m" path="res://addons/rokojori_action_library/Runtime/UI/ShaderProperties/Vector2/Size.tres" id="2_cdd3u"]
[resource]

View File

@ -15,9 +15,13 @@ namespace Rokojori
[Export]
public VirtualCamera3D virtualCamera;
[ExportGroup( "Create Slot")]
[Export]
public bool createSlotIfNotPresent = true;
[Export]
public SelectorFlag[] slotFlags;
public override VirtualCamera3DSlot GetCameraSlot()
{
var vm = VirtualCamera3DManager.Get();
@ -27,6 +31,7 @@ namespace Rokojori
{
slot = vm.CreateChild<VirtualCamera3DSlot>();
slot.camera = virtualCamera;
slot.flags = slotFlags;
vm.RefreshSlots();
}

View File

@ -22,6 +22,9 @@ namespace Rokojori
[Export]
public VirtualCamera3DSlot cameraSlot;
[Export]
public VirtualCamera3D camera;
[Export]
public int cameraSlotIndex = -1;
@ -34,9 +37,13 @@ namespace Rokojori
var manager = VirtualCamera3DManager.Get();
var resolvedSlot = useActiveCameraSlot ? manager.activeSlot : cameraSlot;
if ( resolvedSlot == null && cameraSlotIndex != -1 )
if ( resolvedSlot == null && camera != null )
{
resolvedSlot = manager.GetSlot( camera );
}
if ( resolvedSlot == null )
{
if ( cameraSlotIndex != -1 )
{
resolvedSlot = manager.GetSlot( cameraSlotIndex );

View File

@ -0,0 +1,44 @@
using System.Diagnostics;
using System.Collections;
using System.Collections.Generic;
using System;
using Godot;
namespace Rokojori
{
[Tool]
[GlobalClass, Icon("res://addons/rokojori_action_library/Icons/VirtualCamera3D.svg") ]
public partial class LookAtCamera:VirtualCamera3D
{
[Export]
public Node3D target;
[Export]
public Smoothing smoothing;
[Export]
public TimeLine timeLine;
public override void _Process( double delta )
{
if ( Engine.IsEditorHint() )
{
return;
}
var lookAtPosition = smoothing.Smooth( target.GlobalPosition, timeLine.delta );
if ( ! Math3D.IsValid( lookAtPosition ) )
{
lookAtPosition = target.GlobalPosition;
smoothing.SetCurrent( target.GlobalPosition );
}
// this.LogInfo( target.GlobalPosition, lookAtPosition, timeLine.delta );
this.LookAt( lookAtPosition, Vector3.Up, true );
}
}
}

View File

@ -0,0 +1 @@
uid://7wfp46dloykf