Graphics for games?

96b4890dc0b70497de4e39e84ca9900f
0
krishnakeshan007 101 May 20, 2012 at 04:43

hey guys i am new to game development and wanted to know about the creation of graphics for video games. I am currently using blender. is it a good choice?

Thanks.

31 Replies

Please log in or register to post a reply.

A638aa42130293f319eda7fa4ba121f4
0
fireside 141 May 20, 2012 at 18:37

Yes, it’s one of the best free modeling and animation packages. Sketchup is easy to learn, but is a little harder to get the models into games or other modelers, at least the free version.

Fd80f81596aa1cf809ceb1c2077e190b
0
rouncer 104 May 20, 2012 at 23:24

i personally use 3d coat, voxel modelling is amazing.

but its quite advanced, you have to angle reduce the models cause their hipoly and normal map them, but once youve done that its what made this->
shot7.png

96b4890dc0b70497de4e39e84ca9900f
0
krishnakeshan007 101 May 23, 2012 at 06:16

Thanx for the answers. So, after i make a 3d model of something ( eg : a gun ) how do i put the thing into my game.
Also, can I use photoshop to make images and animate them with opengl. If not please tell me how can I ?

Thanx.

6837d514b487de395be51432d9cdd078
0
TheNut 179 May 23, 2012 at 10:37

@krishnakeshan007

So, after i make a 3d model of something ( eg : a gun ) how do i put the thing into my game.

You need to export the model to a format that your game will import. There are many choices out there (OBJ, 3DS, Collada) that you can chose from. You could optionally write your own exporter, which would better optimize your data. I submitted a sample Blender exporter that covers most situations that you can read and download here.
@krishnakeshan007

can I use photoshop to make images and animate them with opengl.

I wouldn’t use Photoshop. It doesn’t have sprite tools that allow you easily group together many images into a single, larger one. There are dedicated sprite sheet editors you can search for that will do the job much better. Once you have your sprite sheet, you just need to write an animation system in OpenGL to flip through each frame.

96b4890dc0b70497de4e39e84ca9900f
0
krishnakeshan007 101 May 25, 2012 at 01:28

I saw your exporter thingy, but i couldnt make out some parts. Can you guide me on how to make my own exporter.(also tell me the programming language)

Thanx.

88dc730f0f71e55be39de0ad103bd9ff
0
Alienizer 109 May 25, 2012 at 01:40

@krishnakeshan007

I saw your exporter thingy, but i couldnt make out some parts. Can you guide me on how to make my own exporter.(also tell me the programming language) Thanx.

Which programming language do you use now?
Which 3D software are you using to make your 3D model?

Maybe start by using DarkBasic http://www.thegamecreators.com/

96b4890dc0b70497de4e39e84ca9900f
0
krishnakeshan007 101 May 25, 2012 at 09:59

I am currently (just) learning c++. And for the modelling tool, I use Blender.

Thanx

Bae1278b0121b2058f375dfd6d713822
0
Mogoko 101 May 25, 2012 at 17:51

Graphics don’t have to be realistic, but they have to be appealing and practical.

88dc730f0f71e55be39de0ad103bd9ff
0
Alienizer 109 May 25, 2012 at 19:07

@krishnakeshan007

I am currently (just) learning c++. And for the modelling tool, I use Blender. Thanx

Well, if you are “just” learning C++ right now, then it’s not going to be easy. C++ is a hard language, and you almost need to be an expert to make code that runs fast and optimized, let alone understanding the structure of C++

It would be too difficult for anyone here to “teach” you how to make your own exported. Beside, there are plenty already available for Blender, where you can look at the source codes see how they works.

96b4890dc0b70497de4e39e84ca9900f
0
krishnakeshan007 101 May 26, 2012 at 15:30

I found an option in Blender which says “export”. When i click it, it gives me formats to export in eg : COLLADA, Stl, 3ds Max, Autodesk Maya. Is this what a exporter do?

88dc730f0f71e55be39de0ad103bd9ff
0
Alienizer 109 May 26, 2012 at 17:20

@krishnakeshan007

I found an option in Blender which says “export”. When i click it, it gives me formats to export in eg : COLLADA, Stl, 3ds Max, Autodesk Maya. Is this what a exporter do?

Yes they do.

B5262118b588a5a420230bfbef4a2cdf
0
Stainless 151 May 27, 2012 at 09:54

Working with 3d meshes can be a pain.

What usually happens is that you spend ages looking at 3d modellers, until you find one that you really like.
You spend days learning the modeller, and end up with a mesh you are really like.

Then you try and get the mesh you have spent hours working on into your game, and you find the modeller doesn’t export to a format you have code to read.

So then you start looking for source code for model formats that your modeller supports, pretty quickly you find one, download the source code, then the source code doesn’t build.

So you spend a few hours trying to get it to build, with no success. So you go back to searching the web for a different format.

This one builds, but when you put it on your game code and load your lovingly created mesh, it looks sh1t. Or just looks like a bunch of random points, or the object is inside out.

You can lose weeks in this morass of free source code.

My advice would be to decide on what features you really want in your meshes. Think hard about this bit. Obviously you are going to want to get the vertex positions, most probably you are going to want texture coordinates and normals, but do you need anything else? Do you need tangents, binormals, multitexturing, materials, etc. etc. etc.

When you have decided on the minimum set of what you need, then have a look at which file format and modeller you can use.

I’ll try and explain what I mean with an example.

Blender is a very powerful modeller, loved and hated by many people. It can do whatever you need to do, but the learning curve is very steep. You could spend years just learning to get good at blender without spending a single hour writing a game.

It can output to Collada, which has an open source file handling library. So that is a really good option for handling complex meshes with lots of rendering stages.

The collada dom is supplied as 50 Meg of source code. (I’m looking at version 2.3.1) and relies on 8 external libraries.

Now if you are working on windows, you could probably get away with just building collada and using it as the libraries are easily available. I don’t work on windows, so I would have to port all the libraries myself. I haven’t looked at it in detail, but I can pretty much guarantee they also rely on other libraries, so I would have to port them as well.

So by the time I have learnt blender and got collada working, I could have been going a couple of years without actually doing ANY game coding at all.

Have a look at simple free tools like Anim8tor.

Anim8tor comes with a built in exporter that writes your mesh out as source code. With all the data in a simple to read and use format, you can concentrate on the game code rather than all the utilities.

Once you have some experience, then you can say “I hate this, think I’m going to add <insert feature here>”

The reason I am saying this is that when you are learning, you NEED the instant gratification of seeing your code come to life. You need to be able to sit in front of your computer for a couple of hours and actually see the results of your efforts.

Without that you could easily just give up.

Fd80f81596aa1cf809ceb1c2077e190b
0
rouncer 104 May 27, 2012 at 10:08

Stainless is right, making games is a total bitch, wait till you get up to collision detection. ;)

Ceee4d1295c32a0c1c08a9eae8c9459d
0
v71 105 May 27, 2012 at 13:51

I haven’t had much problems using lib3ds and c++ you will need a little bit of ‘cleaning’ , becasue much of the models you’ll find on the internet are a little bit unfinished and not optimized, lots of redundant vertices and surfaces , this is the thing i noticed most.

B5262118b588a5a420230bfbef4a2cdf
0
Stainless 151 May 28, 2012 at 09:40

The main problems I find with them are ..

1) Missing textures

Since I am a coder, texturing a mesh is the part I am rubbish at. I hate finding the perfect mesh for the task I am working on and then finding out the textures are missing. :(

2) Vertex ordering / missing normals

So annoying loading up a mesh to find half the tri’s are facing the wrong way. I haven’t come up with a good way of using code to fix this issue either.

3) Degenerate triangles

It seems a lot of modellers really don’t care if you end up with two coincident verts on a tri, or a tri with only two verts because the end guy has deleted one of them. Pain in the ass for me though.

3ds is one of the worst, it’s gone through so many changes over time that you never know what’s going to happen when you load one.

It amazes me that we have pretty well got a couple of standards for bitmaps now, but for 3d meshes…

B20d81438814b6ba7da7ff8eb502d039
0
Vilem_Otte 117 May 28, 2012 at 22:54

3ds is definitely one of the worst formats - no, it is old, don’t use it, run away!

A better choice is obj - simple, readable, robust … with few extensions on that format you get really good format for quickly exchanging gfx between F.e. 3D Studio Max and your application. Then you just convert them to binary format (as obj is text-based), and you’re ready to publish (never, never, never ever distribute your application with text formats for meshes, textures, skinned meshes + animations, etc.)

Collada, FBX, or some others are fine, but well … very complex and they contain huge amount of useless stuff (and I really mean HUGE amount). Loading times are zillion-times slower than for obj (or modified obj), and well - I personally don’t like them (too much useless stuff inside creating huge files).

As for now I don’t have any problems with missing textures, vertex ordering or degenerate triangles (unless the graphics guy makes crappy model, but then I won’t pay him, so…).

As for textures, the standard are S3TC compressed ones - mostly DDS, but there are other formats with S3TC compression (and one can always create his own one). Although you can as well go with some TGA files (quite easy to work, both Photoshop and GIMP can work with them, as well as 3DS Max, Blender, Maya, Mudox, XNormal, and lots of other useful programs).

There are also skinned meshes and animations - quite harder one, because it needs you to know a bit about skinning and a lot about math. Mostly you get some mesh + multiple weights for each vertex that describes how much is that vertex affected by different joints. Then you (in animation files) get information about how is every joint animated (be it matrix-based storage, or quaternion + position storage). This is enough for one to actually do skinned animation. There are some MD5, MDL, NIF (+ their animation formats), etc. etc.

1766067da5ff92962fb82e5b1f63a2a4
0
tyree 102 May 29, 2012 at 06:40

collada is quite useful but you would need to delete anything you dont want exported. anything hidden would stay hidden but still be exported. delete everything except the character and bones controlling it. textures export with the model

88dc730f0f71e55be39de0ad103bd9ff
0
Alienizer 109 May 29, 2012 at 15:12

I find the OBJ way the best because…

  1. All 3D CAD can export to obj format.

  2. It can be edited, it’s text, same with the texture (mtl) file

  3. The textures can be edited and re-saved, renamed etc.

  4. And because it’s text, you can do a search/replace

  5. Non of the binary counterparts have the above abilities.

  6. It’s very fast to load.

1766067da5ff92962fb82e5b1f63a2a4
0
tyree 102 May 30, 2012 at 02:19

to the original poster, keep in mind object doesnt export animation. if the model has no animation go with object. but if its animated. another format will have to be used

A638aa42130293f319eda7fa4ba121f4
0
fireside 141 May 31, 2012 at 13:20

For animated models, FBX is by far the best I’ve found. It’s the only “just works” format. The rest end up being some type of nightmare because someone has done something slightly differently. If you’re looking for an engine, find one that uses that format like Unity.

Fd80f81596aa1cf809ceb1c2077e190b
0
rouncer 104 May 31, 2012 at 14:39

If you use obj, it basicly puts it to you to convert it to your own binary format and yes, you need to code the animator yourself.
Thanks for the tip fireside, ill check out fbx myself.

820ce9018b365a6aeba6e23847f17eda
0
geon 101 May 31, 2012 at 16:16

@Vilem Otte

never, never, never ever distribute your application with text formats for meshes, textures, skinned meshes + animations, etc

Why?

Because it can be changed? That’s loads of fun!

Because people can steal my art? What if I don’t mind?

B5262118b588a5a420230bfbef4a2cdf
0
Stainless 151 Jun 01, 2012 at 08:55

fireside, sadly FBX doesn’t “just work” TM.

Like all 3d formats it has been through a load of versions and matching the version to the loader can be a pain.

I will agree with you though that FBX is by far the closest I have ever come to the holy grail of a animated mesh format that just works.

B20d81438814b6ba7da7ff8eb502d039
0
Vilem_Otte 117 Jun 03, 2012 at 21:48

@geon

Why?

Because it can be changed? That’s loads of fun!

Because people can steal my art? What if I don’t mind?

Nope, I don’t care about anyone stealing (or re-using - depends on license) my art too… Simply because loading times for text-files is too damn high (compared to binary format) - and at some point it will take ages!

Also consider distributing editor to allow visual editing of your binary files? Is it so hard to build one (with C# it’s something like 1 hour or so of clicking - with pretty icons, without … even less).

88dc730f0f71e55be39de0ad103bd9ff
0
Alienizer 109 Jun 04, 2012 at 02:52

hmmm, text files loads just as fast to me. Binary is fine, but the conversion and all, slows it down to about the same speed as loading text files. Beside, text files can easily be modified with any text editor, but binary files not, and if one byte is bad, then whole file is bad, especially a byte from the header! But again, it depent for what you use it for. OBJ and MTL are perfect in text and very fast, but textures (images) are better off as binary of course.

B5262118b588a5a420230bfbef4a2cdf
0
Stainless 151 Jun 04, 2012 at 09:26

I hate XML with a passion.

Consider a boolean inside a class saved as xml

in xml you will have something like

<class store><class><boolean>true</boolean></class></class store>

Of course there are other ways of doing it, but in general this is the sort of structure. How many bytes is that? About 60? In what other computing field would you EVERaccept a storage scheme that increased the size of the data by a factor of 60?

In binary you will have

dc.b 0xff;

One byte.

Then there is the code to read it, to read an xml file you have to have a parser, kilobytes of code which you may or may not have to write yourself

In the case of the binary you can read a whole structure in a single line of code.

We spend ages coming up with compression schemes for this asset or that asset, then start throwing in xml files because “they are easy to read and edit”.

Why in all that’s binary does anyone think that is a good idea?

6837d514b487de395be51432d9cdd078
0
TheNut 179 Jun 04, 2012 at 10:36

Both have their pros and cons. Binary does load and compresses well in comparison to ascii, but you may have to worry about endianness and 32 vs 64-bit operating systems. If you’re not careful, accessing an object that points to a binary blob can cause seg faults if the data is bogus. This is a common problem I see with developers trying to maintain backwards compatibility without writing the lengthy verification checks.

I would agree that most XML serializers tend to go overboard with schema. I worked to great lengths to reduce the clutter that .NET spits out, particularly with its dumb handling of namespaces. Still, debugging and working with ascii is a treat in comparison to binary. I’ve combated the issue by writing my own XML library for all platforms (C++/C#/JavaScript), which also supports a binary variant. With binary, the XML defines the schema of the object and the processor serializes/deserializes the data accordingly. When I need to debug, I just flick the switch to ascii and see what’s going on in realtime. When I need to make a release build, I switch to binary to get all of its benefits with a convenient data verification process built in.

820ce9018b365a6aeba6e23847f17eda
0
geon 101 Jun 04, 2012 at 11:17

@Stainless

I hate XML with a passion.

I feel your pain. It’s not the only text based data format, though. JSON is getting more and more popular as a XML replacement even outside web development. Your example would look like this:

myObject{
  type: "store",
  myVariable: true
}

Pretty readable, and lean. MUCH better than XML.

B5262118b588a5a420230bfbef4a2cdf
0
Stainless 151 Jun 04, 2012 at 13:08

@TheNut

In the past I used a build system that allowed me to work in text and generate binary objects at build time. That handled all issues of endianness etc.

Now I can’t use that system, I don’t know until run time which endianness I’m running on, but I handle that with having two file readers in the code.

BinaryFileReaderl and BinaryFileReaderb

I don’t have to worry about 64 bit systems.

Even this is far better than XML. :P

@geon

I agree there are other text based file formats, but the pervasive nature of Microshaft has made XML the most common.

B20d81438814b6ba7da7ff8eb502d039
0
Vilem_Otte 117 Jun 05, 2012 at 00:21

@Stainless & TheNut

Right now I don’t have to worry about endianess at all:
1.) We’re working just (and only) on and for x86 and x86_64 platform :)
2.) When starting application (not in current version - but it’ll be adopted to it sooner or later) I test sample binary file for endianess (which is quite easy to do) - if I find out it’s BigEndian I’m working on, I simply use different function pointers for loading :P

@Alienizer

Obj and Mtl are fast, until you come to point, where u need to load some 2 MTris mesh with dozens of different materials and hundred of textures … in this case pre-compressing + loading as binary is a huge win (storing this as text files has no point - it takes ages to load). Note, not that we currently have this-large meshes in our project :D.

On the other hand, we stream lots of stuff … meshes, textures, animations … everything is loaded on the fly - of course there aren’t many other options for large-scale open world, so quick loading is important for us (and imagine that some clever artist do so cool thing like having one world tile some 30 MB of raw data (e.g. how large they’ll be in memory - in fact we don’t have them compressed (except for BC compression on textures)) and it’s neighbour some 300 MB … still, we have to load it quickly (note that loading 300 MB can take up to few seconds, and we don’t want to lag whole game -> loading just important stuff sequentially (physics, game data - some 0.1% of all space) and streaming the graphics stuff on another core - but also, we need it quicky, coz player wants to see high detail stuff a lot sooner than when he comes near it).

Nah… I would be glad if there were some good articles on this stuff. :D

So in the end … it really depends on what actually is your project.

88dc730f0f71e55be39de0ad103bd9ff
0
Alienizer 109 Jun 05, 2012 at 03:44

@Stainless

I hate XML with a passion.

Consider a boolean inside a class saved as xml

in xml you will have something like

<class store><class><boolean>true</boolean></class></class store>

Of course there are other ways of doing it, but in general this is the sort of structure. How many bytes is that? About 60? In what other computing field would you EVERaccept a storage scheme that increased the size of the data by a factor of 60?

In binary you will have

dc.b 0xff;

One byte.

Then there is the code to read it, to read an xml file you have to have a parser, kilobytes of code which you may or may not have to write yourself

In the case of the binary you can read a whole structure in a single line of code.

We spend ages coming up with compression schemes for this asset or that asset, then start throwing in xml files because “they are easy to read and edit”.

Why in all that’s binary does anyone think that is a good idea?

I hate XML, that’s why I love OBJ, it’s text. but almost as small as binary, and easy to parse and fast to load. XML need to much parsing.