How to add the alpha to my leaf material?

I have used a lot of engines, and they all have an alpha input, were I add my black and white image to for the alpha. How do I add that into my leaf material in godot. I cannot find it anywere, it might just be me though :p

Comments

  • cyberealitycybereality Posts: 927Moderator

    It would be in the material options on the inspector. Either edit or create a new spatial material. In the flags section, check transparent. Then add you texture for the albedo and make sure it has an alpha channel (using PNG textures can be helpful here).

  • MegalomaniakMegalomaniak Posts: 2,608Admin

    Albedo texture alpha channel

  • WashedUpStudiosWashedUpStudios Posts: 11Member
    edited June 23

    Ok now I got the transparancy to work, (thanks for the help) but now I can see all the other leaves that are the same as that one through it? Any help on this.

  • MegalomaniakMegalomaniak Posts: 2,608Admin

    Try adjusting your depth draw properties.

  • DschoonmakerDschoonmaker Posts: 230Member

    Depth draw is set to depth-draw opaque by default, for transparent materials it should usually be set to depth-draw alpha-prepass.

    You can avoid depth-draw issues entirely(and make it slightly cheaper) if you use alpha scissor, which cuts out the opaque parts of the mesh(no alpha, fragments either get rendered opaque or not at all).

    Alpha scissor works on leaves, because leaves usually don't need any alpha, they just get their shape from alpha.

  • WashedUpStudiosWashedUpStudios Posts: 11Member

    Thanks that worked perfectly, I will start putting alpha channels on all of my leaves for my trees.

Leave a Comment

BoldItalicStrikethroughOrdered listUnordered list
Emoji
Image
Align leftAlign centerAlign rightToggle HTML viewToggle full pageToggle lights
Drop image/file