Blender

Blender

SP4NKER Apr 18, 2022 @ 3:20pm
Losing my mind with Cycles transparency
I'm trying to render decals onto an object, effectively by placing a material with transparency as a layer. For some reason I'm having a conniption trying to do this. I've ended up doing absurd things in the shader editor but to no avail.

I know transparency doesn't work the same in cycles. Using the transparent BDSF works fine for anything else but this, apparently:

https://gyazo.com/9fd1d56b090a86920c6bab592692ac3f

The black should be transparent. This is also making me realise that the normal maps aren't going through either, as they use transparency to illustrate depth

Any advice on correcting this mapping would help as well:
https://gyazo.com/78774b5868b84249f3155df4d8e430c9
< >
Showing 1-15 of 17 comments
still__alive Apr 18, 2022 @ 3:38pm 
No time at the moment to say anything else, but google "alpha" or "alpha channel" in relation to Cycles. The settings and nodes you need are probably labelled that way, instead of "transparency".
SP4NKER Apr 18, 2022 @ 3:55pm 
Originally posted by still__alive:
No time at the moment to say anything else, but google "alpha" or "alpha channel" in relation to Cycles. The settings and nodes you need are probably labelled that way, instead of "transparency".
I was going to say this but didn't want to say too much in the original post, but all I can find in search results is how to render images with alpha backgrounds, and why the option under film isn't working, etc etc etc; things that don't involve layers (such as useless how-to guides regarding how to connect 2 nodes). I get the feeling my case is unique but I don't want to speak too soon
Some things:
Transparent Shader must go into the upper slot of the Mix Node.
Film -> Transparent that means your World Background (HDRI or whatever you use) is not included in the render and is output as alpha instead.
Last edited by *P0P$*FR3$H3NM3Y3R*; Apr 18, 2022 @ 4:30pm
SP4NKER Apr 18, 2022 @ 7:53pm 
Originally posted by *P0P$*FR3$H3NM3Y3R*:
Some things:
Transparent Shader must go into the upper slot of the Mix Node.
Film -> Transparent that means your World Background (HDRI or whatever you use) is not included in the render and is output as alpha instead.
The result can be manipulated either way using the factor amount, and while I understand I've plugged a texture into that node, flipping the shaders has no desired effect either way, with or without the factor node plugged

I'm not looking for a transparent background either, unfortunately search results consist of that and other irrelevant topics

But thank you for suggesting, anything counts
76561198807925770 Apr 18, 2022 @ 9:38pm 
For the first, use a Principled BSDF and plug in the image outputs of color and alpha into the relevant BSDF inputs, base color and alpha.
Then connect the BSDF to the material output.
It will not appear as transparent in material preview mode, and may even look like nothing has changed from the Gyazo captures sent here. It would appear as intended in the rendered view mode, if the alpha of the source image itself is set right.

I'm not sure what's shown in the second image, but Ambient Occlusion isn't very useful on a mesh like this.
My guess is that you're trying to put emissive squares in certain places using the AO to dictate where.
If the corbot_nrm image is a properly coloured normal map, it can be connected directly to the BSDF normal input socket. If it's a heightmap/bumpmap, connect it using a bump node instead of the one currently used.
mr munkee Apr 19, 2022 @ 3:07am 
https://i.imgur.com/gKLD1Za.jpeg

If I understand you correctly, this image is all you need to achieve what you want. The main thing being that in the "material properties" tab on the right, under "settings" you have to change the blend and shadow modes to something other than the default "opaque". That's how you actually enable transparency in the viewport/render.
Last edited by mr munkee; Apr 19, 2022 @ 3:09am
76561198807925770 Apr 19, 2022 @ 5:12am 
Originally posted by mr munkee:
That's how you actually enable transparency in the viewport/render.

The setting shown will only affect the viewport and not the render, as it is found under the Viewport Display settings. It is handy to know this setting exists to see if the Alpha is working without having to check in a render or render preview.

Even if it's not changed from opaque, the render would still use the correct alpha if the nodes are set up correctly.
SP4NKER Apr 19, 2022 @ 9:58am 
Thanks for all your inputs, though I must remind, I am using cycles, not EEVEE.
This is my layout for EEVEE (surface bump mapping):
https://gyazo.com/b9f61a6fe6ee4b7f1e5c9e5b21b2d52e

Here is my layout for the transparent layer, if I wanted to use EEVEE (respective render):
https://gyazo.com/a4a56e2eb140d9821fc54bdaf648213a

This works just fine in EEVEE, but for Cycles, working transparency demands a transparent BDSF and thus the settings for viewport alpha clip and etc does not show up at all.

As for the AO, I'm simply using it as AO. I have emissive nodes set up in the Principled BDSF and need not worry about them.

I am trying to find a way to paste these vinyls onto the object. I know a lot of things were said but I'm hoping this answers all of them in one go.

I think a big question here is how I can cram so many things in through a mix shader? I've got emission, bump mapping, AO (Which I would like to keep) and then our pesky vinyls. I am imagining a very nasty looking node tree. Principled BDSF covers all of this, so what do I do with cycles if it refuses alpha (and every texture I have uses alpha!)

Thank you all again for your suggestions, I should've elaborated more on my part.
The Renderer Apr 19, 2022 @ 10:21am 
Not sure what the problem is even after reading all this, but all you have to do is:

For a simply transparent texture (like the leaf of a tree) plug the alpha output of the texture into the alpha input of the principled shader, as shown above in the image by mr munkee.

For a decal, mix the underlying material with the decal material using the alpha output of the decal texture as mix factor (switch the two mix inputs in case it doesn't work correctly). You have to mix them anyways, so not sure what you mean by "cramming so many things through a mix shader".

Also, good materials have many shaders and/or textures that are mixed based on all kinds of criteria. There are tools to organize your nodes (like groups), it's completely normal to get a "nasty looking" node tree.
SP4NKER Apr 19, 2022 @ 10:36am 
Originally posted by The Renderer:
Not sure what the problem is even after reading all this, but all you have to do is:

For a simply transparent texture (like the leaf of a tree) plug the alpha output of the texture into the alpha input of the principled shader, as shown above in the image by mr munkee.

For a decal, mix the underlying material with the decal material using the alpha output of the decal texture as mix factor (switch the two mix inputs in case it doesn't work correctly). You have to mix them anyways, so not sure what you mean by "cramming so many things through a mix shader".

Also, good materials have many shaders and/or textures that are mixed based on all kinds of criteria. There are tools to organize your nodes (like groups), it's completely normal to get a "nasty looking" node tree.

You may just have to show me a node example. I've done so many different combinations that I'm just making a mess of myself.
I know it's as simple as plugging in the alpha node but it just refuses to work in cycles, no matter what combination I'm using, hence the title of this thread. I'm starting to get nonsensical looking trees only to receive the same results.
I'm certain this is a learning opportunity for me, I must be missing something
76561198807925770 Apr 19, 2022 @ 10:55am 
One simple option would be to duplicate the area of the model that the decal goes over (using Shift-D specifically, some other ways might not work), then have the decal with alpha applied to that using a separate material.

(Edit: with the hull material set on the faces underneath the duplicated decal faces, of course.)
Last edited by Muggi_1; Apr 19, 2022 @ 10:56am
The Renderer Apr 19, 2022 @ 11:06am 
Here is your node example in text form:

Decal Texture | color -> color | Decal Shader (e.g. principledBSDF) -> shader1 | Mix Shader
Decal Texture | alpha -> factor | Mix Shader
Whatever your underlying material is (e.g. another principledBSDF) -> shader2 | Mix Shader
And then of course the mix shader node into the material output.

Alternatively, if you only care about the color of the decal and nothing else:

Decal Texture | color -> color1| mixRGB
Decal Texture | alpha -> factor | mixRGB
Texture of stuff below (or simple RGB node) | color -> color2 | mixRGB
Then use the output of the mixRGB to go into your color slot of the principledBSDF.

Edit: Switch the two inputs of the mix nodes if it doesn't work correctly. Also try thinking of the alpha channel as a mask that tells Blender where which material/color is supposed to go (hence using it as factor), not as actual transparency in and of itself.

Originally posted by Muggi_1:
One simple option would be to duplicate the area of the model that the decal goes over (using Shift-D specifically, some other ways might not work), then have the decal with alpha applied to that using a separate material.

No, please don't do that. Apart from issues like z-fighting, it's simply not good practice.
Last edited by The Renderer; Apr 19, 2022 @ 11:16am
76561198807925770 Apr 19, 2022 @ 11:44am 
I did mean to say that the duplicated segment should be moved up slightly. I figured it would be implied by what I mentioned in the edit I made immediately after posting.
And even if it isn't "good practice", sometimes it's better to just go for the simple solution than to try all the "better" alternatives. Occam's razor and all that.
mr munkee Apr 19, 2022 @ 11:47am 
Here's an example of what I think The Renderer is talking about. I might have misunderstood how you are trying to do it with my first post.

https://imgur.com/a/nrKuoMe

This image shows the paint material and the logo being "combined" as a single material, and you can see the individual image with it's alpha in the bottom left that's being combined with the "paint" I made.
76561198807925770 Apr 19, 2022 @ 11:56am 
Originally posted by mr munkee:
Here's an example of what I think The Renderer is talking about.

I do agree that their way works quite well, and I just recreated it myself to upload an image here for the other person, but it seems you beat me to it.
It looked almost the same as this example, but without the alpha going into the BSDF.
< >
Showing 1-15 of 17 comments
Per page: 1530 50

Date Posted: Apr 18, 2022 @ 3:20pm
Posts: 17