Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vertexNormals are not getting set #202

Open
0x177 opened this issue Sep 12, 2024 · 2 comments
Open

vertexNormals are not getting set #202

0x177 opened this issue Sep 12, 2024 · 2 comments

Comments

@0x177
Copy link

0x177 commented Sep 12, 2024

i have a vertex shader that passes the normal of the vertex to the fragment shader. i can confirm that whatever fragNormal is set do does get passed to the fragment shader. the problem is that all the normals are 0,0,0. here are the relevant parts of code:

drawing geometry:

let mut d2 = d2.begin_shader_mode(&shader);

d2.draw_plane(
    Vector3::new(0.0, 0.0, 0.0),
    Vector2::new(32.0, 32.0),
    Color::LIGHTGRAY,
);

d2.draw_cube(Vector3::zero(),2.0,4.0,2.0,Color::WHITE);

vertex shader:

#version 330

in vec3 vertexNormal;

uniform mat4 matNormal;

out vec3 fragNormal;

void main()
{
    fragNormal = normalize(vec3(matNormal*vec4(vertexNormal, 1.0)));
}
@RoseApollo
Copy link

i am also experiencing this issue

@IoIxD
Copy link
Contributor

IoIxD commented Oct 29, 2024

Can either of you reproduce this with the unstable branch on raylib-rs/raylib-rs (the repo where development happens more often), which adds a closure-based start_shader_mode?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants