View Full Version : .Obj Vertex Normal Question
maa103 03-18-2005, 11:46 AM Hi all. I'm importing .Obj files ( i'm using openGL and c++ ) and i noticed that the file size of an object file without exporting the vertex normal information is much smaller that with vertex normal information. Do you think that i should export the vertex normal information anyways or should i calculate the normals myself. What i mean is what is better speed wise and memory wise, knowing that it is a .Obj animation that i'm loading?
Thanks in advance:thumbsup:
|
|
rakmaya
03-18-2005, 02:35 PM
Obviously, you shouldn't calculate it on every frame. So it doesn't matter if you calculate or take it from a file. One way or another, you will need the Vertex Normal in the Graphics pipeline on the memory of GPU to render the model.
Also, how much more memory? To tell the truth, Vertex Normal takes the same amount of memory to store as a Verted Position (both have x, y, z). Even if the File size is larger (because of additional headers it stores), at the end, for GPU, it is the same.
If you are trying to save most 3 floats per vertex for the Main memory, it is not worth the effort. Besides, calculating the object on complex geomerties won't result the same as it does in the 3D packages.
maa103
03-21-2005, 10:48 AM
Thanks rakmaya. That does help alot, but, like you said, the normal information takes as much space as te position information which means double the file size. Although if packages can do a much better job calculating the normals, then definately.
Thanks:thumbsup:
rakmaya
03-21-2005, 02:02 PM
The cost / effect ratio for calculating the Normals to loading it from file is very in significant (if done on loading stage than opposed to calculating per frame) when the compared to other major issues that we face.
In fact, except for 2D sprites, it has become industry standard for all exporters to include a normal data for all objects during export procedure. Even if you do not generate Normals during export, most engines would create Normals during loading phase (which may or may not be the actual thing you want).
You have to consider that by all means this is not recomended. For example, in XBOX to load a 60 MB from a DVD to the memory, at the fastest possoble time, it would take approx 12 seconds. If you add processing time for the level to set up, it would take more. On the top of that, if you have to generate Normal, much more is required. Creating a Nomal and generating it doesn't differentiate on the loading time. In fact, MOST of our test, Normal and scene data (such as heirarchial trees) loading is faster than generating it in the memory. In case of PC, you load 512 MB of resources into the memory before the level even gets to the game-play phase. So the time is approx 8 to 12 seconds depending on which end of the HD you are in. In games, we want to minimize the loading time by choosing the best method possible. After all, we have enough HD and DVD space than processing power available.:)
Ofcourse, there are cases, where generation is better than loading. Using wisely can give good results as well.
CGTalk Moderation
03-21-2005, 02:02 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
vBulletin v3.0.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.