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

Keep diffuse intact so that shader generation for generateNormals works #89

Merged
merged 2 commits into from Jun 23, 2017

Conversation

lilleyse
Copy link
Contributor

Fix for a bug reported on the forum: https://groups.google.com/forum/#!topic/cesium-dev/b3iU1vlmaxo

  • obj2gltf outputs KHR_materials_common which gltf-pipeline can generate shaders for
  • If the model has no normals it sets the emission color instead of the diffuse color. This is needed for the constant lighting equation
  • But if --generateNormals is set, gltf-pipeline will recreate the shaders again but this time expects the diffuse to exist.
  • So instead this checks if normals will be regenerated before swapping the emission and diffuse.

I consider this just a bandaid for the time being and is more of a gltf-pipeline problem. Once gltf 2.0 is in full force this also won't be an issue.

@mramato
Copy link
Contributor

mramato commented Jun 23, 2017

Thanks @lilleyse! I confirmed this bug was in the last official release, so I updated changes.

We should do a release as soon as #85 is in.

@mramato mramato merged commit 813290a into master Jun 23, 2017
@mramato mramato deleted the keep-diffuse branch June 23, 2017 14:34
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

Successfully merging this pull request may close these issues.

None yet

2 participants