Sketchfab Forum

Half black - half transparent object

(Ideavetro) #1

Hello, I don't know how to make for example glass partialy painted. I tried masks and nothing works like it should.
Which one should I use?

(Shaderbytes) #2

you would create a png diffuse texture and plug it into the diffuse and the transparency channels. You probably should do a roughness texture as well based on the same image to control the reflection blur for glass and paint as well.

(Ideavetro) #3

Then I have black pain on glass, and nothing there, where should be glass

(Shaderbytes) #4

attach your texture you are using here so we can see, The glass is where ever you want it to be. A png image has 4 channels r,g,b,a ..rgb is for you color and a is for alpha. the diffuse channel on sketchfab will read the rgb values from the texture , the transpaarency channel will read the alpha channel of the texture and apply it to the pixels of the diffuse.

As I said you can use one texture to do this and then plug it into the diffuse and transparency.

(Shaderbytes) #5

here is an example : I used a second texture for the roughness not shown here , the point is so you understand using one texture for diffuse and transparency

(Ideavetro) #6

My texture is super simple so it should be easy to explain.

[url=]Modena proba 3[/url] by 4CONCEPTS on Sketchfab

And it should looks like this:

(Shaderbytes) #7

you black parts of your texture are fully opaque, your textures "mode" is also indexed. you need to change this to rgb in your graphics editor. Once you have changed it to rgb .. reduce the opacity of the black areas to whatever level you want it at and it will work

(Ideavetro) #8

It's in RGB mode. And why i should change opacity of black parts if i want it fully opaque? It should be partialy full black, and partialy transparent glass.

(Shaderbytes) #9

so what is the issue you are having then? The non black parts?

(Ideavetro) #10

They're fully transparent (like there's nothing there) and i need glass (reflections and gloss).

(Shaderbytes) #11

yes so dont make it fully transparent, also set your specular to maximum. There is a problem of weak reflections when the material is very transparent. Remember this is a real time graphic engine. So light is not behaving exactly as in the real world, no refraction etc.

(Shaderbytes) #12

if you want to punch the clear glass a bit more make the clear glass color black as well and use the additive blending option ( technically your glass color should always be dark .. even if not using additive blend ) :

(Ideavetro) #13

Ok, so my texture should be black and almost-transparent black :slight_smile: Now it works better and it's enough. Thanks a lot for all your help!