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

Color Not Showing on Some Geometry #120

Open
vincent-edward-lo opened this issue Apr 6, 2020 · 10 comments
Open

Color Not Showing on Some Geometry #120

vincent-edward-lo opened this issue Apr 6, 2020 · 10 comments

Comments

@vincent-edward-lo
Copy link

vincent-edward-lo commented Apr 6, 2020

Hello,

I am using Maya 2018 and exported out a glTF file with a character. For the materials, I am using the glTF_PBR.ogsfx shader. Most of the materials simply have a color and normal map plugged in.

However, when I bring in the glTF into several different viewers, they all show the same thing.

farah_model_materials_glTFPreview

Here is a screenshot from Maya.

farah_model_materials_maya

As you can see, I have some primitive spheres and planes showing the same materials as the materials on the character. The spheres appear to be rendering properly, but not the character.

For another test, I applied a single material to the entire character and just changed the Base Color Factor. No maps were used. I still got a similar issue...

farah_model_materials_glTFPreview_blue

In addition, when the mesh is animated, some faces appear to be flat shaded? I'm not sure if this issue is related.

farah_head_animated

The normal maps appear to be showing properly, but why are some pieces of geometry not showing color?

@ziriax
Copy link
Contributor

ziriax commented Apr 6, 2020

Are you using the downloadable released version, or did you build from the develop branch source?

Can you paste the log from the output window and history window, maybe some errors or warnings appear. For example, tangent vectors could be broken.

@vincent-edward-lo
Copy link
Author

Hi thanks for the response.

I'm using the downloadable released version. I downloaded the .zip from this page
https://github.com/WonderMediaProductions/Maya2glTF/releases
and executed the deploy.bat file.

Here's the log from Maya's Script Editor.

script_editor

Is there another output window I should be aware of?

@ziriax
Copy link
Contributor

ziriax commented Apr 8, 2020

Sorry, I missed your reply.

Yes, it's really the output of the native Maya output window, it looks like:
image

If you have Maya 2019 installed, you could try the upcoming 1.0 release:
https://github.com/WonderMediaProductions/Maya2glTF/files/4103175/maya2gltf_1.0_a6a059d_maya_2019.zip

@vincent-edward-lo
Copy link
Author

vincent-edward-lo commented Apr 9, 2020

Thanks, here is the Output log for Maya 2018. I used the glTF_PBR.ogsfx shader, changed the "Base color factor" to blue, and applied it to every object, so no texture maps were used.

outputLog_blue_farah_static.txt

The resulting glTF export looks like this:

blue_farah_static_glTF

All the objects should be blue, not just her eyes.

I'll try out the 2019 version, thank you for providing that.

@ziriax
Copy link
Contributor

ziriax commented Apr 9, 2020

Very strange. Can you also try exporting with the -mts flag?

If you can send me your scene (or just a single polygon from your mesh that has the problem), I will take a look at this.

@vincent-edward-lo
Copy link
Author

vincent-edward-lo commented Apr 9, 2020

Okay, so a few things:

  1. I tried the 2019 version of the exporter. For some reason the shader properties were not showing up for me.

  2. Went back to 2018 and tried using the -mts flag. It successfully exported, BUT it still showed the same weird results.

  3. In 2018, I exported out an OBJ with the following settings.
    obj_export_settings

And just to double check, I brought that OBJ back into Maya, applied the same blue material, re-exported as a glTF, and it shows up blue as it should in a glTF viewer!

shirt_gray_asOBJ

  1. I then re-exported out as an FBX with the following settings.
    fbx_export_settings

I brought this FBX back into Maya, applied the blue material, re-exported as a glTF, and it shows up incorrectly. Still gray.

shirt_gray_asFBX

I've attached the FBX here.

shirt_Binary_2018.zip

I guess I've always had the hunch that something is just wrong with my geometry, I'm just not sure what exactly or how it happened.

EDIT: So I did another quick test, and I found out the the problem exists on geometry sent to Maya using Zbrush's GoZ button. I'm pretty sure I used that GoZ button to bring geo over. Something in the transfer breaks the geo,,?

@vincent-edward-lo
Copy link
Author

If I export out the geometry from Zbrush manually as OBJs (without using GoZ) and re-assign the same materials, I can see the texture maps properly.

farah_SubtoolMasterExport

I guess this can be a workaround for future models coming from Zbrush to glTF, in case the issue becomes too difficult to find.

@ziriax
Copy link
Contributor

ziriax commented Apr 9, 2020

Thanks for sharing your model.

Something is really broken with this model, because I import your model, open the UV Set editor, and then clickon the map1 set in Maya, I get the error:

Error: file: C:/Program Files/Autodesk/Maya2018/scripts/others/texturePanel.mel line 1001: No object matches name: Shirt_RENShape.uvSet //

I'm not a Maya expert myself, but it seems somehow the uvSet relationship is broken...

If you pass the following flags: -mpa POSITION|NORMAL|TANGENT to the exporter, it will export without UVs, and then the GLTF will work, but that's not what you want of course.

I think first the error needs to be solved in Maya...

@vincent-edward-lo
Copy link
Author

Ah ok. Thank you so much for looking into this!

@ziriax
Copy link
Contributor

ziriax commented Apr 9, 2020

Nevertheless, I will look into this as soon as I find some time. Indeed, exporting and reimporting as OBJ fixes the problem.

I noticed that when importing the corrupt GLTF, I get validation warnings that the texture coordinates are not used. I'm curious what is going wrong here...

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