View
10.676
Download
0
Category
Preview:
Citation preview
•••
••••••
••
•••
•
••
••
•
••
•••
•
•
••
CharacterPartsMeshData meshData = new CharacterPartsMeshData ();meshData.renderer = renderers [i];meshData.original = mesh;meshData.lod = cruncherTarget.outputMesh;meshes.Add (meshData);// Prefab以下に格納 AssetDatabase.AddObjectToAsset (cruncherTarget.outputMesh, target);
•
••
••••
•
•
•
•
•
•
•
•
•••
•••
•
•
•••
•
•••
•
•
•••
•
•
••
••••
••
••••
••
••••
••
••••
•••••
••
•
•••
••
•
•••••
•
••••••••
•••
••
•
•••
•
••
•
••
•
inline fixed4 frag_toon_opaque (v2f_toon_sphere IN){ ALPHA_CLIP_DITHER(IN); fixed4 col = tex2D(_MainTex, IN.texcoord.xy); fixed3 rgb = col.rgb; #ifdef DISABLE_LIGHT #else PROJ_FRAG_HALF(IN,rgb); rgb *= unity_LightColor[0].rgb; #endif FRAG_OVERDRAW(IN,rgb); // sphere CHARACTER_SPHERE(IN,rgb); // shadow CHARACTER_SHADOW(IN,rgb); // rim CHARACTER_RIM(IN,rgb); // final color CHARACTER_FINAL_COLOR(rgb,col); return col; }
•••
CGPROGRAM#pragma multi_compile _ ENABLE_ALPHA#pragma multi_compile _ ENABLE_SPHERE#pragma multi_compile _ DISABLE_LIGHT#pragma multi_compile _ G_PROJ_TEX G_PROJ_CUBE#pragma vertex vert#pragma fragment frag#pragma fragmentoption ARB_precision_hint_fastestENDCG
•
•
var sph = targetMat.GetTexture ("_SphereCube"); var def = targetMat.IsKeywordEnabled ("ENABLE_SPHERE");if (sph == null && def) { targetMat.DisableKeyword ("ENABLE_SPHERE"); EditorUtility.SetDirty (targetMat);} else if (sph != null && def == false) { targetMat.EnableKeyword ("ENABLE_SPHERE"); EditorUtility.SetDirty (targetMat);}
•••••
•
••
•
•
•••
••
••
••
•
•••
•
••
••
•••
•
•
•
•
••
••••
•
•
•
•
••
•
•
ご静聴ありがとうございました
Recommended