dsoft20 / psx_retroshader

Shader that "emulates" the rendering style of ps1
MIT License
1.13k stars 91 forks source link

Upgrade to Unity 2019.4.1f1 #11

Open Josh-McMillan opened 4 years ago

Josh-McMillan commented 4 years ago
Josh-McMillan commented 4 years ago

Found the fix here. The fix was to go into each shader and modify the code from:

//Cut out polygons
if (distance > unity_FogStart.z + unity_FogColor.a * 255)
{
    o.pos.w = 0;
}

to

//Cut out polygons
if (distance > unity_FogEnd.z + unity_FogColor.a * 255)
{
    o.pos = 0;
}

Small note: I decided to change from getting the FogStart to the FogEnd, so that there were no clipped edges showing in meshes during runtime. It should now prevent the shader from clipping before the fog is set in. Not sure if this is entirely accurate, and can totally be discussed.