• 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
DmitryNik

Meshes

6 posts in this topic

Hello.

I've read about different methods, how can be loaded the mesh into the game written with DirectX 11. These methods were from loading meshes with Assimp to writing own loader for .OBJ -files. As everybody know, .OBJ is a well documented. I assumed that too before I've seen this

f 54 34
f 34 78
f 100 -100
and so on

and also this:

vt -1.546 0.578 -3.10098 (very strange behavior for texture coordinates, isn't it?)

I'm about to ask three questions. First: how it's possible that texture coordinates are negative or greater than one?
Second: How it's possible that faces consist of only 2 points without normal vectors and texture coordinates, even they are defined for them?
Third: What do you use for loading meshes in DirectX 11 in Windows 8/WIndows 7?

Thank you in advance for your answers.

p.s. program used for exporting to .OBJ-file is Blender 2.64 Edited by DmitryNik
2

Share this post


Link to post
Share on other sites
[quote name='Zaoshi Kaba' timestamp='1354717678' post='5007403']
1. Textures can be tiled. So point (1.1, 1.1) is same as (0.1, 0.1).
2. Are you sure it's not lines? Faces have to have at least 3 points.
3. Well I guess you're going to load from file, so ifstream is a good choice.
[/quote]

Thank you.

It's too bad Microsoft didn't implement anything for meshes loading. It could an OBJ or FBX file(like it was in XNA).

And, yes, you are right it's simple line.
2

Share this post


Link to post
Share on other sites
[quote name='NightCreature83' timestamp='1354725629' post='5007431']
The OBJ format can actually have faces that consist of 4 verts or quads. A face can consist of only vertex data so the absence of texture coordinates or normals is just fine, it's just there is no way to light or texture that particular face. Face data can be combines in an OBJ file as well, you can find 3 vert face data and 4 vert face data in the same face description list in an obj file, or at least I have encountered this before.

Most engines use their own formats to load meshes, and often this is just a straight dump of the vertex array in to a text or binary file so that runtime loading is extremely fast and no other operation than a straight forward memcpy are needed. Mesh loading and saving is a problem for which there is no standard way that is fast, for example Max and editing tools need to know about all information about a mesh, so material, shader, textures and meta data(vertex is connected to which edge, etc.), a game engine doesn't need to know about faces, edges and all kinds of other stuff that is stored in a model file. There for we write our own exporters and importers for the data we care about and make it load fast, one standard format doesn't cover all performances for all engines sadly.
[/quote]

Yep, this one is a big ugly problem(no universal format)... In Blender you can make all faces to consist of only 3 vertices. At least, it could be done in Blender 2.64. If I'm right, then an "triangular faces" -option is responsible for that.
2

Share this post


Link to post
Share on other sites
[quote name='DmitryNik' timestamp='1354745526' post='5007541']
[quote name='NightCreature83' timestamp='1354725629' post='5007431']
The OBJ format can actually have faces that consist of 4 verts or quads. A face can consist of only vertex data so the absence of texture coordinates or normals is just fine, it's just there is no way to light or texture that particular face. Face data can be combines in an OBJ file as well, you can find 3 vert face data and 4 vert face data in the same face description list in an obj file, or at least I have encountered this before.

Most engines use their own formats to load meshes, and often this is just a straight dump of the vertex array in to a text or binary file so that runtime loading is extremely fast and no other operation than a straight forward memcpy are needed. Mesh loading and saving is a problem for which there is no standard way that is fast, for example Max and editing tools need to know about all information about a mesh, so material, shader, textures and meta data(vertex is connected to which edge, etc.), a game engine doesn't need to know about faces, edges and all kinds of other stuff that is stored in a model file. There for we write our own exporters and importers for the data we care about and make it load fast, one standard format doesn't cover all performances for all engines sadly.
[/quote]

Yep, this one is a big ugly problem(no universal format)... In Blender you can make all faces to consist of only 3 vertices. At least, it could be done in Blender 2.64. If I'm right, then an "triangular faces" -option is responsible for that.
[/quote]
Yeah there was when I last check, it is also present in the Max export I think. If you forget to set this you can end up with some weird crashes in your OBJ loader as you are expecting 3 ints to follow an f put there is actually 3 of em. And if you only read 3 when 4 are specified your mesh will end up having holes when you render it.
Also as an aside OBJ is not the most efficient format either it stores a lot of combined vertex, texture coordinates and normals for the same vertex in space, this can lead to artifacts when you render the object and sometimes you need to combine this data into one vertex. The combining is a time consuming problem and increases with the complexity of the model sadly enough. Also you can't use this format if your model has animations in it as obj doesn't support animation frames in the data streams.

FBX is slightly better in this case although harder to figure out what's where in the model, even with the SDK it takes a fair amount of delving into documentation until you get at the data you are interested in. But because there is an SDK this format is actually better documented then the simple obj format, and allows animation and other options which OBJ doesn't.
2

Share this post


Link to post
Share on other sites
with blender you can create your own exporter. that way you can export what you want the way you want it.
1

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