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

[Branch "rendermesh-refactor"] normals not working correctly #149

Closed
tellypresence opened this issue Apr 14, 2024 · 1 comment
Closed

[Branch "rendermesh-refactor"] normals not working correctly #149

tellypresence opened this issue Apr 14, 2024 · 1 comment

Comments

@tellypresence
Copy link

On branch rendermesh-refactor

I'm having a problem accessing mesh normals, using RenderMesh::normals.data isn't working for me, is there an example available of the new technique in rendermesh-refactor branch? Here's the approach I'm using:

const size_t stride_bytes{render_scene.meshes[meshIdx].normals.stride_bytes()};
x = render_scene.meshes[meshIdx].normals.get_data()[faceVertIdxOffset + j];
y = render_scene.meshes[meshIdx].normals.get_data()[faceVertIdxOffset + j + stride_bytes];
z = render_scene.meshes[meshIdx].normals.get_data()[faceVertIdxOffset + j + 2 * stride_bytes];

P.S.
On dev branch I was accessing individual normal vec3 elements using

x = render_scene.meshes[meshIdx].facevaryingNormals[faceVertIdxOffset + j][0];
y = render_scene.meshes[meshIdx].facevaryingNormals[faceVertIdxOffset + j][1];
z = render_scene.meshes[meshIdx].facevaryingNormals[faceVertIdxOffset + j][2];

which was working very well

@syoyo
Copy link
Collaborator

syoyo commented Apr 14, 2024

There was an issue on converting facevarying attributes(normals, texcoords) in rendermesh-refactor, which is now fixed in this commit: 8d3a5dc

Please report an issue related to rendermesh-refactor branch to here #148

@syoyo syoyo closed this as completed Apr 14, 2024
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

2 participants