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

Disabled face culling #36

Open
K1ll3rF0x opened this issue Nov 27, 2013 · 3 comments
Open

Disabled face culling #36

K1ll3rF0x opened this issue Nov 27, 2013 · 3 comments
Labels

Comments

@K1ll3rF0x
Copy link
Member

Hi,

I noticed that face culling has been disabled everywhere in the XML3D.js renderer, is there a reason for this? Usually one wants to enable at least backface culling by default.

@lachsen
Copy link
Contributor

lachsen commented Nov 27, 2013

At this point it is disabled, since many (rather bad) mesh assets don't work properly with backface culling on.

The thing I would propose is to have an additional mesh data entry named "solid". (e.g. <bool name="solid" >true</bool>)
When a mesh is declared solid, backface culling is enable and normals are always used exactly as provided.
When a mesh is not declared solid, backface culling is disabled and normals are flipped toward the viewpoint. This is something you want to use e.g. for simple planes.

This should not be much work to implement and is definitely something we should provide.

@K1ll3rF0x
Copy link
Member Author

In my opinion a mesh data entry named "cullFace" or similar that could take in values such as "none", "front", "back" or "frontback" could be a good idea.

@ksons
Copy link

ksons commented Feb 3, 2015

This can currently be done globally with options:
https://github.com/xml3d/xml3d.js/wiki/Options

This is only a intermeddiate solution.

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

No branches or pull requests

3 participants