Closed jaspervandenbarg closed 2 years ago
I solved the problem by commenting out the following:
static void ApplyRendererInfo(RendererInfo[] infos, int[] lightmapOffsetIndex, LightInfo[] lightsInfo)
{
for (int i = 0; i < infos.Length; i++)
{
var info = infos[i];
info.renderer.lightmapIndex = lightmapOffsetIndex[info.lightmapIndex];
info.renderer.lightmapScaleOffset = info.lightmapOffsetScale;
// You have to release shaders.
//Material[] mat = info.renderer.sharedMaterials;
//for (int j = 0; j < mat.Length; j++)
//{
// if (mat[j] != null && Shader.Find(mat[j].shader.name) != null)
// mat[j].shader = Shader.Find(mat[j].shader.name);
//}
}
Yes, I was going to mention that, the shader "release" is there for some issues that were found on some versions/builds/bundles
As the titles states.
The scripts sets all the custom render queues of the materials on the child objects to -1. This cause my materials to render improperly.
Normally opaque materials will render on queue/layer 2000 and transparent materials on queue/layer 3000.
Because they all get set to layer -1 the transparent materials dissapear.