mirror of
https://github.com/0x7c13/Pal3.Unity.git
synced 2026-11-27 18:08:09 +08:00
Fix render queue and cutoff for Mv3ModelRenderer
This commit is contained in:
1 parent
17ebee5b28
commit
4b36a38b21
1 file changed
+4
-1
@@ -25,6 +25,8 @@ namespace Pal3.Renderer
|
||||
{
|
||||
public event EventHandler<int> AnimationLoopPointReached;
|
||||
|
||||
private const int TRANSPARENT_RENDER_QUEUE_INDEX = 3000;
|
||||
|
||||
private const string MV3_ANIMATION_HOLD_EVENT_NAME = "hold";
|
||||
private const string MV3_MODEL_DEFAULT_TEXTURE_EXTENSION = ".tga";
|
||||
private const float TIME_TO_TICK_SCALE = 5000f;
|
||||
@@ -154,10 +156,11 @@ namespace Pal3.Renderer
|
||||
_materials[index] = new Material(_standardNoShadowShader);
|
||||
_materials[index].SetTexture(_mainTexturePropertyId, _textures[index]);
|
||||
|
||||
var cutoff = _textureHasAlphaChannel[index] ? 0.3f : 0f;
|
||||
var cutoff = _textureHasAlphaChannel[index] ? 0.01f : 0f;
|
||||
if (cutoff > Mathf.Epsilon)
|
||||
{
|
||||
_materials[index].SetFloat(_cutoffPropertyId, cutoff);
|
||||
_materials[index].renderQueue = TRANSPARENT_RENDER_QUEUE_INDEX;
|
||||
_materials[index].SetFloat(_isOpaquePropertyId, .0f);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user