Skip to content

Why does the alpha channel flicker? #3317

Answered by junglie85
junglie85 asked this question in Q&A
Discussion options

You must be logged in to vote

Thanks. What do you mean by missing assignments?

This is for my sprite shader. I have a similar one for drawing geometry.

fn translation_matrix(position: vec2<f32>) -> mat4x4<f32> {
    return mat4x4<f32>(
        vec4<f32>(1.0, 0.0, 0.0, 0.0),
        vec4<f32>(0.0, 1.0, 0.0, 0.0),
        vec4<f32>(0.0, 0.0, 1.0, 0.0),
        vec4<f32>(position.x, position.y, 0.0, 1.0),
    );
}

fn rotation_matrix(angle: f32, origin: vec2<f32>) -> mat4x4<f32> {
    let add_origin = translation_matrix(origin);
    let remove_origin = translation_matrix(-origin);
    let raw_rotation = mat4x4<f32>(
        vec4<f32>(cos(angle), -sin(angle), 0.0, 0.0),
        vec4<f32>(sin(angle), cos(angle), 0.0, 0.0),…

Replies: 3 comments 4 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
4 replies
@junglie85
Comment options

@cwfitzgerald
Comment options

@junglie85
Comment options

@junglie85
Comment options

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