All character are now moved to 0,0,0 when spawned

Hardcoded material values for 9945400
Added scale/offset to main shader
This commit is contained in:
2024-04-29 11:25:39 +02:00
parent 07e2c4d88c
commit a3e3cc450a
6 changed files with 29 additions and 75 deletions

View File

@@ -134,7 +134,6 @@ public class FateModelBuilder : MonoBehaviour
{
if (go.name == "chr")
{
go.transform.eulerAngles = Vector3.zero;
servant.BodyMain = go;
}
break;
@@ -147,6 +146,12 @@ public class FateModelBuilder : MonoBehaviour
case Material mat:
{
servant.Materials.Add(mat);
if(mat.name == "9945400")
{
mat.mainTexture.wrapMode = TextureWrapMode.Repeat;
mat.mainTextureOffset = new Vector2(0.2f, 0.78f);
mat.mainTextureScale = new Vector2(10000, 10000);
}
break;
}
case TextAsset text:
@@ -194,7 +199,6 @@ public class FateModelBuilder : MonoBehaviour
mat.SetFloat("_Cutoff", 0.91f);
UIController.Instance.CutoffSlider?.onValueChanged.AddListener((value) => { temp.SetFloat("_Cutoff", value / 100);});
}
}
if(servant.BodyMain == null)
@@ -206,6 +210,15 @@ public class FateModelBuilder : MonoBehaviour
}
servant.BodyMain = Instantiate(servant.BodyMain, servant.transform);
servant.BodyMain.transform.eulerAngles = Vector3.zero;
var root = servant.BodyMain.transform.Find("joint_all_Base");
if (root != null)
{
Debug.Log("Not null");
root.localPosition = Vector3.zero;
}
servant.InstantiatedObjects.Add(servant.BodyMain);
var simpleAnimation = servant.GetComponentInChildren<SimpleAnimation>();
simpleAnimation.enabled = false;

View File

@@ -36,6 +36,7 @@ Shader "FateShader3Compatible" {
};
sampler2D _MainTex;
float4 _MainTex_ST;
sampler2D _Alpha;
fixed4 _Color;
fixed4 _AddColor;
@@ -47,7 +48,7 @@ Shader "FateShader3Compatible" {
v2f o;
o.vertex = UnityObjectToClipPos(v.vertex);
o.color = v.color;
o.uv = v.uv;
o.uv = TRANSFORM_TEX(v.uv, _MainTex);
return o;
}
@@ -62,57 +63,7 @@ Shader "FateShader3Compatible" {
}
ENDCG
}
//Pass //Line 428 Cutoff Transparency (0.5)
//{
// Tags { "IGNOREPROJECTOR" = "true" "RenderType" = "TransparentCutout" }
// Cull Off
// ColorMask 0
// CGPROGRAM
// #pragma vertex vert
// #pragma fragment frag
// #include "UnityCG.cginc"
// struct appdata
// {
// float4 vertex : POSITION0;
// float2 uv : TEXCOORD0;
// float4 color : COLOR0;
// };
// struct v2f
// {
// float2 uv : TEXCOORD0;
// float4 vertex : POSITION0;
// float4 color : COLOR0;
// };
// sampler2D _MainTex;
// sampler2D _Alpha;
// fixed4 _Color;
// fixed4 _AddColor;
// float _Cutoff;
// float4 u_xlat0;
// float4 u_xlat1;
// v2f vert(appdata v)
// {
// v2f o;
// o.color = fixed4(0,0,0,1);
// o.uv = v.uv;
// u_xlat0 = mul(unity_ObjectToWorld, v.vertex.xyz);
// o.vertex = UnityObjectToClipPos(u_xlat0);
// return o;
// }
// fixed4 frag(v2f i) : SV_Target
// {
// fixed4 col = tex2D(_MainTex, i.uv);
// col = _Color * col + _AddColor;
// clip(col.a - _Cutoff);
// return col;
// }
// ENDCG
//}
Pass //ADD COLORS
{
Cull Off // make double sided
@@ -137,6 +88,7 @@ Shader "FateShader3Compatible" {
};
sampler2D _MainTex;
float4 _MainTex_ST;
sampler2D _Alpha;
fixed4 _ColorTint;
float _Cutoff;
@@ -146,7 +98,7 @@ Shader "FateShader3Compatible" {
{
v2f o;
o.vertex = UnityObjectToClipPos(v.vertex);
o.uv = v.uv; // just pass through with no scale/offset
o.uv = TRANSFORM_TEX(v.uv, _MainTex);
return o;
}