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

Mesh with negative size and cull disabled displays incorrect normals GLES3 #29317

Open
clayjohn opened this issue May 30, 2019 · 2 comments
Open

Comments

@clayjohn
Copy link
Member

This bug was found in both #26710 and #25696 But was mixed in with a few other bugs. This issue supercedes them both.

Godot version:
Master

Issue description:
When a mesh with culling disabled is given a negative size the normals appear backwards in GLES3.

https://user-images.githubusercontent.com/5222656/52463875-9e985800-2b46-11e9-9db0-136267400a36.png

Note: this issue doesn't appear when using cull_front or cull_back because Godot detects when the scale is negative and flips the culling operation.

p_instance->mirror = p_instance->transform.basis.determinant() < 0.0;

Steps to reproduce:

  1. Create a MeshInstance
  2. Set the cull property of the SpatialMaterial to "disabled"
  3. Set the scale of the MeshInstance to (-1, -1, -1)

Minimal reproduction project:
https://github.com/godotengine/godot/files/2844079/tests_3.1.zip

@KoBeWi
Copy link
Member

KoBeWi commented Dec 2, 2020

Seems still valid in ba51af7

@nonunknown
Copy link
Contributor

nonunknown commented Oct 10, 2021

@KoBeWi I can reproduce this on v4.0.dev.custom_build [2a28df8]

image

as you can see the left side (its a meshinstance inverted on scale)

thanks to @lyuma this can be workarounded via vertex shader:
image

PS: Lines 25-26

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants