How can I set up alpha mapped materials in Blender to match Sketchfab's exporter expectations so I don't have to manually change settings?

(Jellybit) #1

(This question is still unanswered, though I got some helpful information about how Sketchfab thinks. Any answers would be greatly appreciated!)

I struggled for much of the weekend with trying to give Sketchfab what it expects in its Blender exporter with regards to alpha clipping/transparency, but seemingly exhausted all of my options without luck. First, here's the effect I'm trying to achieve:

Goat Concept Changes - Yellow by jellybit on Sketchfab

As you can see, the image in the background is transparent around the characters, and importantly, the shadow below them is partially transparent. This image billboard was just a simplistic test before I attempted to do something similar on my characters, but I haven't found a solution.

To achieve this effect I need to do the following settings in Sketchfab itself:

As you can see, it uses "Alpha Blending", points to the alpha texture, and bases the alpha on luminance. Unfortunately, this must all be done manually every time I upload. Now, here's the Blender setup that I thought would be closest to Sketchfab's exporter expectations, though I tried many other things:

The alpha texture affects the alpha channel of the texture. The color texture only affects the color channel. Things look great in Blender's GLSL real-time rendering, and Sketchfab's docs say it should support most GLSL features.

Am I going about this in the wrong way? What exactly does Sketchfab's exporter in Blender expect for alpha?

  • How do I set things up in Blender so that it exports using "Alpha Blending"?
  • How do I get it to base it on luminance?
  • How do I get it to know to set my alpha texture to the one I set in Blender?
  • How do I get it to use "Alpha Masking" if I wish to do that? Is there a way to differentiate between the two?

Thanks so much for your help.

On a side note, I cannot tag this with Blender or Alpha? I cannot add any tags at all. Weird.


Hi @Jellybit

Thanks for the details. The tag issue is weird. I've added those tags for you, and I'll keep an eye on it. Let me know if the problem persists.

@waleguene @paul_sketch - any ideas for alpha settings in blender importer?

(Stephomi) #3

For now, the only solution is to upload a jpg instead of a png.

(Paul Sketch) #4

sidenote: "Alpha masking" is a different technique where it's either totally transparent or totally opaque depending on a pixel texture mapped value.

(Jellybit) #5

Yes, thank you. I'm aware. My models are going to need both approaches in different areas, so I'd like to know what exactly the Sketchfab exporter expects for both types. My plan after finding this out is to write some tutorials on how to get straightforward exports, as I've been learning a lot.

(Paul Sketch) #6

Sorry, thought it was about fixing that scene only.

The blender exporter current "alpha" support:
- Only alpha blending is supported in the blender exporter, no alpha masking.
- And Alpha blending support in blender exporter is using "translucency" in our code
- "usePremultipliedAlpha and "UseAlpha" are not currently supported.
- to get Luminance based texture, you need to use/upload a jpg as translucency/alpha map

(Jellybit) #7

Hmm, I think the tags disappeared when I edited my post. When I click in the tag box, it gives me two possible tags, "3dst" and "sketchup". When I type anything else in there, it says "No matches found". When I press enter, nothing happens, and when I click off the input box, it erases my text. Tried this on two computers.


Sorry, I misunderstood. You're talking about forum tags?

(Jellybit) #9

Yes. Sorry. I'm not used to how these replies are set up yet. This is my first post. I was replying to this:

Thanks for the details. The tag issue is weird. I've added those tags for you, and I'll keep an eye on it. Let me know if the problem persists.

(Jellybit) #10

Ok. So, I changed my alpha texture to jpeg. That alone didn't seem to be what the Blender exporter expects for alpha textures. The following is the default result. I know how to change it manually, but again, I'm attempting to create content in a way that the Sketchfab exporter expects so that I don't have to make manual changes every time.

Blender exporter issue by Jellybit on Sketchfab

So, you said that "usePremultipledAlpha" and "UseAlpha" are not supported. What Blender setting does the exporter expect me to use so that Sketchfab will know which texture is used as an alpha texture automatically? I will use whatever the exporter looks for. Am I on the wrong track with my current settings shown in the original issue?

Thank you!

(Jellybit) #11

@paul_sketch, @stephomi,

I'm still trying to figure out what the exporter wants from me in my Blender setup. As I said in the previous reply, the jpg didn't get picked up as an alpha texture. I got a lot of good info about what methods are not supported by the exporter, but no information on what methods/approaches are supported.

Since I don't know if my settings are wrong in the original post screenshot, or if I'm on the wrong track at all, I assumed I'm way off and tried something very different. I read on a Sketchfab Blender exporter blog post that it will detect some node settings. I've never used material nodes before, so after a few days of struggling, I figured them out to some degree here (seems to be alpha clipping instead of blending, but it's good enough for now):

But when I export and upload, the 3D settings don't see or include either texture, as shown here:

Blender exporter issue 2 by jellybit on Sketchfab

So, my original question still stands if anyone is reading this and has done this successfully, or knows how the exporter works. What exactly do I have to set in Blender for the exporter to export alpha settings correctly so that I don't have to manually change every material that uses alpha? What does the exporter want? Is this a bug? Again, I know how to manually set an alpha in Sketchfab itself. I'm seeking to give the exporter what it expects in my Blender material settings so that it will display correctly without manually changing every alphaed material.

Thanks so much, anyone that can help!

(Stephomi) #12

We are constantly trying to improve our exporters, but currently we are focusing on animation support for the siggraph (in 2 weeks), so development is a bit slow in other fields...

Nevertheless, I took a quick look at our blender exporter (the non-node version) and indeed there's a bug with the Alpha channel.
So the model "Blender exporter issue" should be fine afterwards.
I'll ping you back when a fix is live.

As for the node version, I'll let @paul_sketch cover that.

(Jellybit) #13

Thanks so much @stephomi. I'm in no rush at all, not that my being in a rush should change things on your end. Happy to know that it's a bug so I can move on to other things for a while. My Sketchfab Blender alpha tutorial can wait for sure.

Good luck on the Siggraph crunch! I'm powerfully excited about the animation support, and I think that's going to build Sketchfab usage/interest tremendously. It's a great thing to prioritize.