Skip to content

Commit

Permalink
Merge pull request #101 from CyberAgentGameEntertainment/fix/parallax…
Browse files Browse the repository at this point in the history
…_map_fixnow

Fix FixNow button functionality to include tangents in custom vertex streams when using ParallaxMap.
  • Loading branch information
CA-Tatami authored Jan 17, 2025
2 parents 82d8287 + 0f68d5d commit 2687871
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions Assets/Nova/Editor/Core/Scripts/RendererErrorHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -238,12 +238,17 @@ internal static void SetupCorrectVertexStreams(Material material,
correctVertexStreams.Add(ParticleSystemVertexStream.Custom1XYZW);
correctVertexStreams.Add(ParticleSystemVertexStream.Custom2XYZW);
}

if (material.shader.name == "Nova/Particles/UberLit"
&& material.IsKeywordEnabled(ShaderKeywords.NormalMapEnabled))

// Tangent
{
correctVertexStreamsInstanced.Add(ParticleSystemVertexStream.Tangent);
correctVertexStreams.Add(ParticleSystemVertexStream.Tangent);
bool useParallaxMap = material.IsKeywordEnabled(ShaderKeywords.ParallaxMapTargetBase) ||
material.IsKeywordEnabled(ShaderKeywords.ParallaxMapTargetTint) ||
material.IsKeywordEnabled(ShaderKeywords.ParallaxMapTargetEmission);
if (useParallaxMap || (material.shader.name == "Nova/Particles/UberLit" && material.IsKeywordEnabled(ShaderKeywords.NormalMapEnabled)))
{
correctVertexStreamsInstanced.Add(ParticleSystemVertexStream.Tangent);
correctVertexStreams.Add(ParticleSystemVertexStream.Tangent);
}
}
}

Expand Down

0 comments on commit 2687871

Please sign in to comment.