Community
Bifrost Forum
Welcome to the Bifrost Forum. This is the place for artists using Bifrost to ask and answer questions, browse popular topics, and share knowledge about creating effects procedurally using Bifrost. You can also visit the Bifrost Community on AREA to download an array of ready-to-use graphs, read Bifrost news and updates, and find the latest tutorials.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

what is the right way to build mesh and normal

13 REPLIES 13
SOLVED
Reply
Message 1 of 14
g2m.agent
538 Views, 13 Replies

what is the right way to build mesh and normal

I try to use construct_mesh to build the mesh.

When I make a horizontal mesh, vertex normal is correct.

maya_c9L0spY94n.png

for the top cap, I use a counterclockwise order [0,1,2,  0,2,3,  0,3,4], and for the bottom cap, I use a clockwise order [5,9,8,  5,8,7,  5,7,6]. it works fine.

 

but when I connect the two caps, the vertex normal became wrong.

maya_l9b45nMcDY.png
I use counterclockwise order for all vertical surfaces, something like:

[0,5,6,1,  1,6,7,2, ...]

maya_AMePHjUf5Z.png

So what's wrong?

13 REPLIES 13
Message 2 of 14
mjcg91
in reply to: g2m.agent

This looks fine to me. The default visualization of a mesh without normal should look like this. Even if you update the mesh normals it will still appear close to this.

If you want sharp edges, Compute your face_vertex_normal using the face_normal.

Maxime Jeanmougin - Technical Artist
https://maximejeanmougin.com

Join the Bifrost Addicts community on Discord:
https://discord.gg/bifrost-addicts
Message 3 of 14
g2m.agent
in reply to: mjcg91

But I can't find the face_normal node or face_vertex_normal node at all
Message 4 of 14
mjcg91
in reply to: g2m.agent

These are not node but name of properties.

You can update the face_normal using update_mesh_normals. There is no built-in nodes to compute face_vertex_normal though, you'll have to compute it yourself. you can find an example inside create_mesh_cube.

Maxime Jeanmougin - Technical Artist
https://maximejeanmougin.com

Join the Bifrost Addicts community on Discord:
https://discord.gg/bifrost-addicts
Message 5 of 14
g2m.agent
in reply to: g2m.agent

I only found a set_point_normal node.

maya_LYfgJEC0S9.png
If my understanding of point and face_vertex is correct, how does one point define the direction of two face_vertex?

maya_768OhIQKeJ.png

Message 6 of 14
mjcg91
in reply to: g2m.agent

face vertex normals are not relying on anything. In fact you can set any vector you want, but usually it is using face normals, especially if you want to make all edges sharp edges. For a quad, you should use the same face normals vector for all the face vertices of this face. 

If you don't want to bother with this, you should use soften_harden_mesh_normals from MJCG compounds. It can be used for advanced normal generation.

Maxime Jeanmougin - Technical Artist
https://maximejeanmougin.com

Join the Bifrost Addicts community on Discord:
https://discord.gg/bifrost-addicts
Message 7 of 14
g2m.agent
in reply to: g2m.agent

I found a new problem.

After using soften_harden_mesh_normals, it is indeed effective for Bifrost mesh. but the output to Maya is still all "soft edges".

maya_2ZciSMon18.pngmaya_vOnq9cZmE3.pngmaya_tdmP5N9a4u.png

Message 8 of 14
mjcg91
in reply to: g2m.agent

You have to enable Transfer Normals on bifrostGeoToMaya.

Maxime Jeanmougin - Technical Artist
https://maximejeanmougin.com

Join the Bifrost Addicts community on Discord:
https://discord.gg/bifrost-addicts
Message 9 of 14
g2m.agent
in reply to: g2m.agent

after check Transfer Normals, the edges are no longer "soft", but the "shade" looks the same.

maya_vk5ra3DR4F.pngmaya_456Th9ZqY7.png

Message 10 of 14
g2m.agent
in reply to: g2m.agent

Currently, the only way is to use Mesh Display -> Soften/Harden Edges in Maya
And must remove "soften_harden_mesh_normals", otherwise it will be invalid.

maya_unECIc64Bx.png

 

Message 11 of 14
mjcg91
in reply to: g2m.agent

Ah, this is a limitation in my compound. I guess bifrostGeoToMaya needs the face_vertex_normal_index property to work correctly. My compound only generates the normals. i'll fix this for future release.

For now you could edit the compound and set the property using the node found inside create_mesh_cube. The indices array should be set using get_array_indices from the mesh's face_vertex. After this is should work fine. 

Maxime Jeanmougin - Technical Artist
https://maximejeanmougin.com

Join the Bifrost Addicts community on Discord:
https://discord.gg/bifrost-addicts
Message 12 of 14
g2m.agent
in reply to: g2m.agent

Now I understand why the faces of "create_mesh_star" are separated. without merging vertices. because that messes up normals, and it is difficult to correct them.

maya_FCiaiHIRjd.png

create_mesh_star By 4z5lph0c

https://area.autodesk.com/downloads/modelingprimitivecreate-mesh-star/

Message 13 of 14
mjcg91
in reply to: g2m.agent

I think the author just didn't bother to construct the mesh with connectivity. It is simpler like this.

Dealing with point normals is easy, you just have to use update_mesh_normals, but when you need face_vertex_normals, it's a little bit more complicated, but still doable.

Maxime Jeanmougin - Technical Artist
https://maximejeanmougin.com

Join the Bifrost Addicts community on Discord:
https://discord.gg/bifrost-addicts
Message 14 of 14
g2m.agent
in reply to: g2m.agent

I don't understand you said "property" things at all. I haven't touched those yet. I think they will be my "level 3" course. for now, I'm a little satisfy my work.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Technology Administrators


Autodesk Design & Make Report