simplestargame/SimpleURPToonLitOutlineExample

Some VRM Model display anomalies

DavidWeng916 opened this issue · 1 comments

Hello @simplestargame, I applied your SimpleURPToonLitOutlineExample Shader to VRM's models and most of the model shows up fine. However, I don't know why this model is displaying strangely, its hair color should be blue but it turns pink and its face turns black, do you know what's going on?
截圖 2023-09-09 下午8 38 17

When I commented out the 'Pass' in the following outline, it rendered correctly, so there may be an issue with the normals of your model.

Pass
{
Name "Outline"
Tags
{
//"LightMode" = "UniversalForward" // IMPORTANT: don't write this line for any custom +pass! else this outline pass will not be rendered in URP!
}
Cull Front // Cull Front is a must for extra pass outline method
HLSLPROGRAM
//copy from the first pass
// -------------------------------------
#pragma multi_compile _ _MAIN_LIGHT_SHADOWS
#pragma multi_compile _ _MAIN_LIGHT_SHADOWS_CASCADE
#pragma multi_compile _ _ADDITIONAL_LIGHTS_VERTEX _ADDITIONAL_LIGHTS
#pragma multi_compile _ _ADDITIONAL_LIGHT_SHADOWS
#pragma multi_compile _ _SHADOWS_SOFT
// -------------------------------------
#pragma multi_compile_fog
// -------------------------------------
#include "SimpleURPToonLitOutlineExample_Shared.hlsl"
#pragma vertex OutlinePassVertex
#pragma fragment OutlinePassFragment
Varyings OutlinePassVertex(Attributes input)
{
VertexShaderWorkSetting setting = GetDefaultVertexShaderWorkSetting();
// set param "isOutline" to true because this pass is an Outline pass
// setting to true = push vertex out a bit base on normal direction
setting.isOutline = true;
return VertexShaderWork(input, setting);
}
half4 OutlinePassFragment(Varyings input) : SV_TARGET
{
// set 2nd param "isOutline" to true because this pass is an Outline pass
return ShadeFinalColor(input, true);
}
ENDHLSL
}