This is the testing Godot forums! All forum posts unique to this forum will be deleted! Please use the main forums here for any posts you want to keep. All forum rules still apply.

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: 928Moderator

    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,580Admin

    Albedo texture alpha channel

  • WashedUpStudiosWashedUpStudios Posts: 5Member
    edited June 2020

    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,580Admin

    Try adjusting your depth draw properties.

  • DschoonmakerDschoonmaker Posts: 216Member

    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: 5Member

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

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.