• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.
Sign in to follow this  
Followers 0
Prot

How to manipulate Normals in Blender?

8 posts in this topic

Hi there,

 

I am following this tutorial. Here he loads on an .obj file and converts it into a model.txt which is later read and rendered. He created his own .obj in Maya. Now I tried to do the same with blender. I got it all the faces, normals and vertices. But I guess that there is something wrong with normals. Rastertek writes:

 

This particular .OBJ model file represents a 3D cube. It has 8 vertices, 24 texture coordinates and normal vectors, and 6 sides made up of 12 faces in total.

 

It says 24 normals. Does that mean he has his normal on the vertices? Because the model I created has only 12 normals. Plus they look kinda strange. They are not placed on the vertices but on faces. I had to create some extra faces by always selecting three vertices and pressing F.

 

How can I make blender save a normal for every vertex?

Edited by Prot
0

Share this post


Link to post
Share on other sites

First off, let's establish that there are 2 kinds of normals: face normals are placed in the middle of a face and vertex normals are placed at vertices.

 

For a cube object you have 8 vertices and 6 faces. You can see the vertex and face count for your object in Blender top row and that equals to how many normals of each you should have. If you go to 3D view, edit mode, and bring out the Properties panel (N key) you can enable vertex and face normal display for your object in the Mesh Display section. There are 8 vertex normals and they are pointing away from the cube center, in vector format they are [x,y,z] where all of them are 1 or -1.

 

I'm not an expert on how this information is stored in various container formats but normals are traditionally calculated information. Blender doesn't even let you modify them manually, as far as I know because it serves little point besides screwing up shading totally. How you should adjust normals is by changing the topology of your model, flipping faces around and adjusting smooth and sharp corners. How each format saves normals might vary as well as how different software display them.

 

If the tutorial in question says you need 24 normals, that probably means you need to "explode" the cube into 6 non-connected polygons. You can do this in Blender by tabbing into edit mode for the cube, choosing edge selection, selecting all, and using Mesh -> Edges -> Edge Split. That way you get 4*6 = 24 vertices and you should now have 24 vertex normals as well. Looking at the vertex normals now, you have 3 normals at each corner because they are now 3 separate vertices. The vertex normal that was previously [1,1,1] is now 3 normals [1,0,0], [0,1,0] and [0,0,1] so it's been divided into components for each of the 3 faces.

1

Share this post


Link to post
Share on other sites

Hello.

The way smoothing groups make faces look smooth or sharp is because the software keeps vertices duplicated internally.

A single vertex that belongs several to faces with sharp corners is duplicated per sharp face. The program does not show you these duplicates or even give you access to them.

if you're trying to export a mesh from 3DS Max, for example, and you want to support smoothing groups, you will have to manually break a vertex and weld the clones that belong to faces with the same smoothing group, and leave separate the clones that belong to faces with different smoothing groups (you can't access the internal vertex clones, but you can retrieve each face's smoothing group).

 

If you want a cube to have sharp corners, you will have each vertex being duplicated per sharp face. Since each vertex in a cube belongs to 3 faces, you have (8 vertices being split in 3) = 24 total vertices.

Then each face's normal is calculated based on the positions of the vertices that form it. The vertex normals are then calculated by averaging the normals of all faces the vertex belongs to.

With this, in a welded cube with only 8 vertices the vertex normals point in a direction from the center of the cube to each vertex (or in other words, it's the averaged normals of the 3 faces the vertex belongs to, which results in it pointing diagonally outside), and in the broken cube with the 24 separate vertices, the vertex normals are those of the face that the vertex belong to (it's also an average, but of only one value, so it results in that value entirely).

 

Regarding the editing of normals, Blender unfortunately doesn't support that, although there were some requests for this feature. It's an interesting tool for making game art assets.

If you can alter the vertex normals then you basically control how lighting affects the object without having to resort to multitexturing. The reason you would want that is that, in some cases, it may actually look better than if the normals were just taken from the faces like they usually are. 

The best usage for this is with foliage, but there are other applications such as environmental art. 

Read more about it: http://wiki.polycount.net/VertexNormal#Foliage_Shading

 

The difference is mostly this.

Regarding a foliage prop formed by 3 quads:

 

gal1.gif

 

With normal editing, you can point the normals to a more convenient direction such as outside (from the center of the object to each vertex), and it'll make the foliage look more volumetric and hide the intersections:

 

gal2.gif

Edited by Kryzon
2

Share this post


Link to post
Share on other sites

If the tutorial in question says you need 24 normals, that probably means you need to "explode" the cube into 6 non-connected polygons. You can do this in Blender by tabbing into edit mode for the cube, choosing edge selection, selecting all, and using Mesh -> Edges -> Edge Split. That way you get 4*6 = 24 vertices and you should now have 24 vertex normals as well. Looking at the vertex normals now, you have 3 normals at each corner because they are now 3 separate vertices. The vertex normal that was previously [1,1,1] is now 3 normals [1,0,0], [0,1,0] and [0,0,1] so it's been divided into components for each of the 3 faces.

 

 

Your solution seems to work. This is how I do it.

 

  1. Take the predefined Cube which has only 6 faces, 8 vertices and 8 normals at first.
  2. Now I go to Mesh->Faces->Triangulate Faces. This is because I need the faces to be triangles.
  3. Now Mesh->Edges(with all edges selected)->Edge Split

Well this actually does the trick. Now I have 12 faces and normals for each vertex which look right to me. The problem is, in the entire process somehow more vertices were generated. I end up with 36 vertices. I can't see them. Tried to go to Mesh->Vetrtices->Remove Duplicates. But this deletes the normals and even the edges I created with triangulation.

1

Share this post


Link to post
Share on other sites

Yes, if you want more normals, you have to have vertices to match them.  Each face has it's own set of vertices.  In some file formats like OBJ, since the positions are the same, it won't duplicate them in the file, but when drawing it will indeed duplicate them, but with different normals.  So what you are getting is perfectly normal, as the edge split is taking those faces and splitting them up.  If you remove duplicates like that(after applying the edge split modifier) you basically cancel the results of the modifier, and each vertex gets shared onto 3 faces, but then you only one normal, which is not what you want in this case.  Also, there is no reason to apply the edge split modifier in most cases, rather you just leave it on the object.  Upon export, it applies the modifier for you, so you don't have to do it, making it easier to model things, for when you want more than just a cube.

2

Share this post


Link to post
Share on other sites

How to build this in Blender:

 

1) Add a cube if you don't already have one

2) Go to edit mode (TAB)

3) Mesh -> Edges -> Edge Split (CTRL+E)

4) Triangulate faces (CTRL+T)

 

You can now see in the top info row: Verts:24/24 | Edges:30/30 | Faces:12/12 | Tris: 12 and the model should be like you need in the tutorial.

 

I think the tutorial might have served more as an introduction to concept of vertices, edges, faces, normals in this case smile.png

 

 

Hey there this actually worked! Thanks for that. Everything works fine. One important thing to mention here is, one should first apply textures and triangulate and edgesplit later. Otherwise UVs seem to screw up.

 

Thanks again

Edited by Prot
0

Share this post


Link to post
Share on other sites

Well, the specific thing you needed for the tutorial is not actually how you should model game assets in Blender. Usually you don't triangulate at all because in most cases the engine handles quad models triangulating them as it needs. You also keep the edge split as modifier for sharp/smooth edges and as you export to .fbx the parser just writes smoothing groups and vertex normals based on them.

0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0