Diffuse BSDF colors in Blender Cycles not showing up?

(Xiuming Zhang) #1

Hi all,

I have a Blender Cycles scene where there are some .obj meshes whose materials are just colors specified by .mtl files (no texture maps). When I upload my model, colors are not showing.

I learned from this discussion

that this problem can be fixed by switching from diffuse BSDF of Cycles to classic material of Blender Internal.

The problem is that I can't switch to Blender Internal, as my other objects in the same scene have PBR maps (e.g., normal maps, displacement maps, etc.) and therefore need Cycles.

Is there a solution to this problem?

Thanks in advance!

(Waleguene) #2

Hi @xiumingzhang,

Could you paste the url of the model so that we can take a look ?
Colors should be kept and set on Sketchfab when using .obj and .mtl files.


(Lord00120) #3

If you change the viewport color on your materials, they show up correctly on sketchfab

(Lord00120) #4

You just press the white color, and then colorpick the diffuse color box under "Surface". Takes 2 seconds, and when you're done you just export as an obj and upload to sketchfab :slight_smile:

(Xiuming Zhang) #5

Thanks @waleguene. Here it is.

(Xiuming Zhang) #6

Thanks @lord00120 for your help! Why will this work? Would you mind elaborating a bit? I don't think I get it.

(Johnson Martin) #7

Instead of changing the main diffuse color, change the viewport color. That value is what is checked by Sketchfab rather than the "real" color (diffuse BSDF).

(Lord00120) #8

Yeah I guess it happens because an material has several colour channels, and sketchfab chooses the viewport colour. When you're just using blender internal, the viewport colour is automatically set to the same colour as diffuse

(Xiuming Zhang) #9

Thanks to both @Regus_M and @lord00120! Good to learn Sketchfab uses the viewport color.

When I check my model, I found each material's viewport color has been automatically set to be the same as its Cycles diffuse BSDF color, as shown below.

Any guesses why the colors are still not showing up?

Thanks a lot!

P.S.: Not sure if this is relevant, but
1. The colors are specified by .mtl files.
2. In the scene, I have object_A with multiple PBR maps. When I upload object_A alone as the scene, its material looks fine. When I add these objects that appear colorless in Sketch to the scene, that originally fine material of object_A is gone too...

(Lord00120) #10

So when you upload the full scene, theres only one material in the editor on sketchfab?

(Lord00120) #11

I think you might either have uploaded the wrong .mtl file, or maybe you've renamed the mtl file?

(Xiuming Zhang) #12


What I did was

  1. Import .obj files into Blender (Blender also automatically imports the associated .mtl files in the same folder)

  2. Upload the Blender file to Sketchfab

I know Step 1 works fine because I can see all the colors in Blender, as seen below.

(Johnson Martin) #13

That certainly sounds odd. Have you tried uploading the OBJ with .mtl files instead of the .blend? OBJ files are know to have better compatibility across apps.

(Xiuming Zhang) #14

@Regus_M Just tried uploading a zip of .obj and .mtl. Colors are showing up correctly.

The only difference I can see is in .blend file I have two models (both imported .obj together with their .mtl), whereas in .obj, there is only one model.

I realize the material naming conventions in the two .mtl are the same. That is, there is a material called color112 in a.obj, and there is a material with the same name in b.obj. Is this causing the problems? When I view my model on Sketchfab, I can see Sketchfab correctly appends .001 to the material names in b.obj so that they don't clash with those of a.obj. So it shouldn't cause problems?

(Johnson Martin) #15

Glad that worked!

I'm not sure as to why it didn't work via a .blend file. I know that the Cycles importer is kind of a "hacked" system, because Sketchfab does not support node based materials by default. Blender Internal renderer has a much better import system, a does .obj files, even if they are exported from a cycles project.

With some further time investment I'm sure the cause could be isolated, but I hope the "workaround" provided will work ok for you for this project. :slight_smile:

(Xiuming Zhang) #16

Thanks @Regus_M! Right, the workaround would be to export individual objects out from Blender to .obj files and .mtl files.

I've been reluctant to go along this way, because I do have complicated Cycles material node setup for one of my objects. Yet according to what you said just now, I guess these setups get simplified into PBR maps that Sketchfab supports after upload anyways, right?

If this is the case, my problem is completely solved -- just breaking the model down into .obj files with PBR maps specified in .mtl files. Otherwise, I still need to figure out how to get the Blender uploading to work for the sake of my Cycles material node tree setup.

(Johnson Martin) #17

Right, Sketchfab currently doesn't support Cycles node setups, those will need to be recreated using the Sketchfab material system. Truthfully, It's a little annoying to deal with at times if you have a lot of materials, hopefully once Blender gets it's PBR system next year things will work out better. :slight_smile:

If you have a lot of complex Cycles node setups, the best way to deal with them is to either bake them, or use the original texture maps in Sketchfab if your setup is image based. You can also find a lot of PBR material generators if you only have a diffuse map to work with.

Hope this helps, and sorry for all the confusion, Cycles support is still a partial feature, and is unlikely to be supported fully by Sketchfab until changes to Cycles are made to accommodate PBR workflows.

(Xiuming Zhang) #18

@Regus_M Many thanks for your time! It's been really helpful. I am going with "use the original texture maps in Sketchfab" right now, and the loss of quality is acceptably small. :smiley:

On a side note, what are the major differences between a Cycles workflow and a PBR workflow? I've been thinking of Cycles as a kind of PBR. Is that intuition wrong?

(Johnson Martin) #19

No problem! Glad to help.

Cycles and PBR workflows are actually quite different on the backend, that's why using PBR maps (metallic/roughness) in Cycles can be difficult to get right. What makes it even worse, is that some of the maps use the same terms as Cycles nodes, yet work in other ways. Such as roughness, while both control the how "rough" the surface is, they use differing value systems, so plugging the roughness map into the roughness input on shader will not yield the correct result.

The other aspect is that Cycles mainly deals with individual shaders, while PBR workflows deal with one "ubershader" that has all the controls and functions (such as Fresnel) already built in for a physical material. This is what makes it so easy to get a realistic material using simple texture maps using PBR, yet so complex in Cycles to create something as simple as Plastic realistically.

Although it sounds like PBR is the clear winner over Cycles, PBR also has some limitations due to being based upon one "ubershader". Effects such as translucency, transparency, SSS, and refraction are impossible to do with PBR materials in a realistic fashion. Instead, relying upon "fake" or baked options to achieve the same result. While in Cycles, these effects already have their own shaders that can be added to any node setup.

Sorry for the rant. :stuck_out_tongue: But I hope that cleared some things up for you. :slight_smile: I may even put together an article on this subject now that I'm thinking about it. Do you think that would be useful for other artists like yourself?

(Xiuming Zhang) #20

Yes! That would be definitely useful, as many are confused by the differences between these two, and I believe many use maps for Cycles and PBR maps interchangeably without knowing the subsequent consequences. Do ping me when the article is out, but no rush. :smiley: