Remove channel texture problem

when we remove the channel texture, it doesn’t work with opacity, noraml and roughness channel, but it works with albedo channel.
is it some bug in the viewer.api


I’m not sure I get what do you mean by remove, Do you have a code sample ?

you can use Viewer API - Examples - Sketchfab and fork it on jsfiddle to make a simple reproduction of the bug, it would help understanding the problem at hand.

hi, i set 2 kinds of materials we call them A and B.
A has albedo,normal these 2 channel texture.
B has albedo texture and normal channel open without texture.
i chose A at first it works. when i click B, B shows it’s albedo texture and A’s normal texture.
it means A’s normal texture isn’t be removed.

i use api.resetexture(zj,item) fro cleanning the last texture.

Theres’s no reset texture in sketchfab api: Viewer API - Functions - Sketchfab

here’s a sample that does it

( My guess is that you need to explicitely disable/enable channels like in the sample above )

1 2 3
hi there, as the pic i upload, when i switch texture , the right effect can not shows.
the first one texture has albedo channel pic and normal channel without pic but channel open and factor =0.5
the secend one texture has albedo channel pic and normal channel pic.
when i swith the texture, the secend one texture will remain normal channel pic for the first one
texture because the normal channel open without pic.
i use api.resetexture(zj,item) fro cleanning the last texture.
it works for every one which has successor , but if not ,the effection will remain.

( I moved the other post here, please keep all post related to a bug/pmroblem in one thread )

disable/enable channels is one way but it doesn’t good way for opacity metalness roughness.
because some time we just change the factor of them but upload texture for the material.
in different materials , if the channel has texture , it will work. i need to remove the channels texture completely before the next material on it

I would love a jsfidlle showing exactly what doesn’t work, because I don’t get what’s different from the sample linked (the code on the diffuse that switch between red and texture.)

i use this reset , is it doesn’t fit the new viewer.api

Ok, sorry I didn’t get it earlier, this isn’t Sketchfab’s “viewer api” from , it’s from @shaderbytes’s “viewer api utility”.

Actually the problem is in your api , I have reported the issue in the viewer api slack group with a code pen using your raw api , not my utility , and the problem is there. Being talking with kuranes.

Basically removing and deleting a texture ( i discovered the issue in normal map channel ) does not remove it in the viewer. The code pen logs the material object to the console. You can see it is totally removed. Yet it is still displaying. Based on what this user is reporting the issue is in other channels as well. I have not tested those myself yet , just normal map. This issue was not a problem before.

“so click the second thumb to load the rain normal map on the glass. it will log the material to the console. All is good. Now click the first thumb. This removes the texture. Well you can see it is totally removed in the logged data , but you will notice the scene does not drop the map”

Im still in discussion about it, I will report back here with more info soon

yes, the test result from me,is normal map ,opacity map, the others i haven’t test.
and when u have another texture can replace the map , it is ok
if not , it is not ok

Just tested now , confirmed to be an issue with roughness and opacity , again using the raw api , not my utility.

kuranes is aware of the issue and will obviously look into it.

( for opacity I didnt make another pen , I just changed the references for the roughnessPBR channel to Opacity and it proved the same problem )

hth cheers.

i use your utility from beginning,
can u tell me how to remove texture of channel by sketchfab viewer.api?

you dont remove it , you just set the “enable” property to false.

for the Sketchfab API in a nutshell materialRef.channelRef.enable = false;

via my utility it is shown on this page :



OK, enable is a Temporary way for it.
sometimes, our materials don’t have channel texture, we just use factor setting the materials.
if use enable: false means this channel doesn’t work , it also means we cann’t not use factor by now.

Indeed, the dev team are looking into fixing the issue :wink: