mirror of
https://github.com/vrm-c/UniVRM.git
synced 2026-09-13 06:20:01 -05:00
SampleSHを分離
This commit is contained in:
@@ -22,13 +22,8 @@ UnityLighting GetUnityLighting(const Varyings input, const half3 normalWS)
|
||||
if (MToon_IsForwardBasePass())
|
||||
{
|
||||
UnityLighting output;
|
||||
#ifdef MTOON_URP
|
||||
output.indirectLight = SampleSH(normalWS);
|
||||
output.indirectLightEqualized = (SampleSH(half3(0, 1, 0)) + SampleSH(half3(0, -1, 0))) * 0.5;
|
||||
#else
|
||||
output.indirectLight = ShadeSH9(half4(normalWS, 1));
|
||||
output.indirectLightEqualized = (ShadeSH9(half4(0, 1, 0, 1)) + ShadeSH9(half4(0, -1, 0, 1))) * 0.5;
|
||||
#endif
|
||||
output.indirectLight = MToon_SampleSH(half3(normalWS));
|
||||
output.indirectLightEqualized = (MToon_SampleSH(half3(0, 1, 0)) + MToon_SampleSH(half3(0, -1, 0))) * 0.5;
|
||||
output.directLightColor = lightColor;
|
||||
output.directLightDirection = lightDir;
|
||||
output.directLightAttenuation = atten;
|
||||
|
||||
@@ -75,6 +75,16 @@
|
||||
|
||||
#endif
|
||||
|
||||
// SampleSH
|
||||
inline half3 MToon_SampleSH(half3 normalWS)
|
||||
{
|
||||
#ifdef MTOON_URP
|
||||
return SampleSH(normalWS);
|
||||
#else
|
||||
return ShadeSH9(half4(normalWS, 1));
|
||||
#endif
|
||||
}
|
||||
|
||||
// Transform
|
||||
inline float3 MToon_TransformObjectToWorldNormal(float3 normalOS)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user