Skip to content

Commit

Permalink
Merge branch 'Xlinka:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
Nytra authored Jul 11, 2024
2 parents 640439b + 5f74d34 commit 8d842fb
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 0 deletions.
4 changes: 4 additions & 0 deletions ProjectObsidian/ProtoFlux/Users/UserFromUserRef.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ public class UserFromUserRef : ObjectFunctionNode<FrooxEngineContext, User>

protected override User Compute(FrooxEngineContext context)
{
if (UserRef.Evaluate(context) == null)
{
return null;
}
UserRef userRef = UserRef.Evaluate(context);
return userRef.Target;
}
Expand Down
49 changes: 49 additions & 0 deletions ProjectObsidian/Shaders/ObsidianTestShader.shader
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
Shader "ObsidianPlus/ObsidianTestShader"
{
SubShader
{
// This shader renders objects with an opaque render type.
// It transforms vertex positions to clip space and calculates the view direction.
// The fragment shader outputs the view direction as the RGB color with alpha set to 1.
// Created by LeCloutPanda

Tags { "RenderType" = "Opaque" }
LOD 100

Pass
{
CGPROGRAM
#pragma vertex vert
#pragma fragment frag

#include "UnityCG.cginc"

struct appdata
{
float4 vertex : POSITION;
float2 uv : TEXCOORD0;
};

struct v2f
{
float2 uv : TEXCOORD0;
float4 vertex : SV_POSITION;
float3 viewDir : TEXCOORD3;
};

v2f vert (appdata v)
{
v2f o;
o.vertex = UnityObjectToClipPos(v.vertex);
o.viewDir = normalize(WorldSpaceViewDir(v.vertex));
return o;
}

fixed4 frag (v2f i) : SV_Target
{
return float4(i.viewDir, 1);
}
ENDCG
}
}
}

0 comments on commit 8d842fb

Please sign in to comment.