Skip to content

Is there a way to use a transparent texture in Beer/Malt? #51

Answered by pragma37
MeganDrawsaLot asked this question in Q&A
Discussion options

You must be logged in to vote

I've tried using the Basic Texture Shader, but there is no transparency when I use a .png.

If you look at the code, the line 13 is reading only the rgb channels:

vec3 diffuse_color = texture(diffuse_texture, UV[uv_index]).rgb;

If you just want a flat texture without lighting, you could use a shader that simply outputs the full texture rgba values as the pixel color output:

#include "Pipelines/NPR_Pipeline.glsl"

uniform sampler2D diffuse_texture;
uniform int uv_index = 0;

void COMMON_PIXEL_SHADER(Surface S, inout PixelOutput PO)
{
    PO.color = texture(diffuse_texture, S.uv[uv_index]);
}

If you want to adapt the basic_texture.mesh.glsl you could just use the texture alpha as pixel col…

Replies: 1 comment 9 replies

Comment options

You must be logged in to vote
9 replies
@MeganDrawsaLot
Comment options

@MeganDrawsaLot
Comment options

@MeganDrawsaLot
Comment options

@pragma37
Comment options

@MeganDrawsaLot
Comment options

Answer selected by pragma37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants