Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Visual artifacts with material overlay in compatibility mode #63

Closed
uguu-org opened this issue May 26, 2023 · 1 comment
Closed

Visual artifacts with material overlay in compatibility mode #63

uguu-org opened this issue May 26, 2023 · 1 comment

Comments

@uguu-org
Copy link

Surfaces with MToon shader appears to exhibit visual artifacts with overlay material when rendered in compatibility mode:

compatibility_renderer

Maybe some kind of z-fighting due to precision issues? All these artifacts go away if I do a global replacement of VIEW_MATRIX * MODEL_MATRIX with MODELVIEW_MATRIX under addons/Godot-MToon-Shader/*.gdshader (21 instances across 7 files):

compatibility_renderer_with_fix

This problem doesn't happen with Forward+ renderer.

forward_renderer

Unfortunately, I can't seem to reproduce this bug on any other model, but the steps I took were:

  1. Set compatibility mode.
  2. Import VRM with BasisU disabled (see Importing VRM causes "Basis universal cannot unpack level 1" errors #58).
  3. Select body node, then add new material under "Geometry -> Material Overlay".
  4. Set transparency to "Alpha" and Cull mode to "Disabled".

I understand this is not the best bug report without a proper test case, but Godot's documentation also says "use if possible" next to MODELVIEW_MATRIX, so doing this replacement seems like a good idea.

@lyuma
Copy link
Member

lyuma commented Aug 3, 2023

I have applied your suggestion in master. Thanks!

I wonder if Godot 3.x has the same issue. I will consider a backport if I update VRM/MToon for Godot 3

@lyuma lyuma closed this as completed Aug 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants