2
私は自分のゲームに球があり、その内部にはテクスチャが必要です。 私はcertailスクリプトを使用しています。 私は、別のスクリプトで持っている関数を使ってテクスチャを出し入れできるようにしたいと思っています。2つのシェーダを1つにまとめる
しかし、私はこれらのスクリプトを組み合わせることはできません。私が何をしようと、画像は球の内部に表示されません。
シェーダは以下のとおりです。
フリップ内側:
Shader "Flip Normals" {
Properties {
_MainTex ("Base (RGB)", 2D) = "white" {}
}
SubShader {
Tags { "RenderType" = "Opaque" }
Cull Front
CGPROGRAM
#pragma surface surf Lambert vertex:vert
sampler2D _MainTex;
struct Input {
float2 uv_MainTex;
float4 color : COLOR;
};
void vert(inout appdata_full v)
{
v.normal.xyz = v.normal * -1;
}
void surf (Input IN, inout SurfaceOutput o) {
fixed3 result = tex2D(_MainTex, IN.uv_MainTex);
o.Albedo = result.rgb;
o.Alpha = 1;
}
ENDCG
}
Fallback "Diffuse"
}
フェーダー:
Shader "Custom/AlphaBlendTransition" {
Properties {
_Blend ("Blend", Range (0, 1)) = 0.0
_BaseTexture ("Base Texture", 2D) = "" {}
_OverlayTexture ("Texture 2 with alpha", 2D) = "" {}
}
SubShader {
Pass {
SetTexture[_BaseTexture]
SetTexture[_OverlayTexture] {
ConstantColor (0,0,0, [_Blend])
combine texture Lerp(constant) previous
}
}
}
}
はまだ内部の球体からテクスチャを見ながらこれらのシェーダを結合することが可能ですか?
これは素晴らしいことです!ありがとうございました! – Yuval3210