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

Checking Double Sided doesn't export as double-sided geometry #154

Closed
dsinni opened this issue Dec 9, 2018 · 12 comments
Closed

Checking Double Sided doesn't export as double-sided geometry #154

dsinni opened this issue Dec 9, 2018 · 12 comments
Labels
bug Something isn't working exporter This involves or affects the export process
Projects
Milestone

Comments

@dsinni
Copy link

dsinni commented Dec 9, 2018

Checking the Double Sided checkbox under Object Data doesn't export a double-sided geometry.

image

Is this the preferred method for doing so, or is there another way?

image

@julienduroure julienduroure added the exporter This involves or affects the export process label Dec 9, 2018
@UX3D-nopper UX3D-nopper added the bug Something isn't working label Dec 9, 2018
@UX3D-nopper UX3D-nopper added this to the MS VI milestone Dec 9, 2018
@donmccurdy
Copy link
Contributor

@mholthausen
Copy link

Will this option be supported in near future? Is there currently a workaround to export double sided meshes properly? I currently duplicate the mesh and flip the normals of the copy, but this is very data intensive.

@dsinni
Copy link
Author

dsinni commented Jan 19, 2019

@mholthausen I'm not sure if this will work for your use case, but in some cases I was able to use the Solidify modifier with Thickness and Offset set to 0 and every other option turned off. Maybe you can get some use out of that until the feature is available.

image

Just be sure to remember to check the Apply Modifiers option in the exporter settings if you don't want to apply the modifier to the actual mesh in Blender.

@atteneder
Copy link
Contributor

This might interest you:
I also needed support for the "doubleSided" property, so I created a patch and submitted it. Here's the link:
https://developer.blender.org/T60921

@julienduroure
Copy link
Collaborator

Hello,

I asked Andreas to submit the patch here to manage it upstream

@mholthausen
Copy link

@mholthausen I'm not sure if this will work for your use case, but in some cases I was able to use the Solidify modifier with Thickness and Offset set to 0 and every other option turned off. Maybe you can get some use out of that until the feature is available.

image

Just be sure to remember to check the Apply Modifiers option in the exporter settings if you don't want to apply the modifier to the actual mesh in Blender.

Thanks. But this modifier makes no difference in the file size when duplicating the layer and flip normals, because the modfier duplicates the triangles and faces, too.

@dsinni
Copy link
Author

dsinni commented Jan 29, 2019

Thanks. But this modifier makes no difference in the file size when duplicating the layer and flip normals, because the modfier duplicates the triangles and faces, too.

Hmm. I could be wrong, but I was under the impression that duplicated geometry and flipped normals is the expected result after exporting when trying to achieve a double-sided mesh. Does the older workflow with the glTF shader nodes not result in a larger file size?

@donmccurdy
Copy link
Contributor

donmccurdy commented Jan 29, 2019

The doubleSided flag renders each face twice, so there's a performance cost there, but the filesize remains the same.

Note that with #255, you can use the old glTF PBR nodes to set the double sided flag (while still using Principled BSDF for the rest of the material).

@dsinni
Copy link
Author

dsinni commented Jan 29, 2019

Ah, good to know. I guess I had the wrong impression. Thanks, @donmccurdy.

@emackey
Copy link
Member

emackey commented Jan 30, 2019

The doubleSided flag renders each face twice

Technical nitpick, it's not actually rendering each face twice. What happens in most engines is that "backface culling" is disabled for double-sided materials. At the same time, back-facing fragments have their normal vectors automatically flipped (this is sometimes called "double-sided lighting"). For reference, glTF doesn't offer a single-sided lighting mode, but Blender does. In glTF you either get double-sided lighting (when true), or the back faces are culled away (when false).

But the rest of what @donmccurdy wrote is correct: The file size is unchanged, and there can be a (usually minor) performance hit from rasterizing all the backfaces. It's much better than using the solidify modifier, in terms of file size and memory footprint.

@dsinni
Copy link
Author

dsinni commented Jan 30, 2019

Interesting. Thanks for clarifying, @emackey.

@emackey
Copy link
Member

emackey commented Apr 19, 2019

Fixed in #304.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working exporter This involves or affects the export process
Projects
No open projects
Active
General
Development

Successfully merging a pull request may close this issue.

7 participants