前提・実現したいこと
シェーダー初心者です。
サーフェスシェーダーにて、頂点シェーダーを用いてモデルの形を変形しました。
その際、影は変形する前のままとなっています。
変形後の形の影を描写するにはどうすればよいでしょうか?
自分でもいろいろと調べてみたのですが、やはり頂点・フラグメントシェーダーで
手入れイヤーな部分を描くか、shadowcollector 等のカスタムパスの作成が必須なのでしょうか?
該当のソースコード
SubShader { Tags { "RenderType"="Opaque" } LOD 200 CGPROGRAM // Physically based Standard lighting model, and enable shadows on all light types #pragma surface surf Standard vertex:disp // Use shader model 3.0 target, to get nicer looking lighting #pragma target 3.0 sampler2D _MainTex; fixed4 _Color; float _Amount; struct Input { float2 uv_MainTex; }; void disp(inout appdata_full v, out Input o) { UNITY_INITIALIZE_OUTPUT(Input, o); v.vertex.xyz += v.normal * _Amount; } void surf (Input IN, inout SurfaceOutputStandard o) { // Albedo comes from a texture tinted by color fixed4 c = tex2D (_MainTex, IN.uv_MainTex) * _Color; o.Albedo = c.rgb; o.Alpha = c.a; } ENDCG } FallBack "Diffuse" }
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。