Jump to content

  • Log In with Google      Sign In   
  • Create Account

Rendering Doom 3 models, HORRIBLE texture seams.


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
8 replies to this topic

#1 ill   Members   -  Reputation: 320

Like
0Likes
Like

Posted 11 March 2013 - 08:01 PM

This is something I've been wondering for a while as I was using some Doom 3 models for testing my renderer.

 

Here's a screenshot.

http://i.imgur.com/J7O3iK9.jpg

 

Notice how down the middle, he has those seams.  This is using my deferred shading engine and when I look at the normals in the Gbuffer, the normals are also full of seams there, while the diffuse output looks fairly OK.

 

The legs also have some nasty texture seam artifacts going on, and I can see these horrible seams when I render the specular gBuffer as well and see how the specular textures map on.  The insides of the arms look especially bad.

 

I remember back in the day on my shitty graphics card, I'd have some seams down the middle of models and it seems to be a complaint around the web people have had.  Forcing the normal maps to be uncompressed seems to have been the fix, and nowadays when I play Quake 4 and Doom 3 on higher than ultra settings by tweaking some cvars, I never see these seams.

 

My renderer is just loading the normal maps as they are in tga format in the .pak.  I saw some dds textures in the paks as well and I assume Doom 3 actually uses those, but I don't have a dds texture loader just yet.  (I'm also surprised at how much scratch work and useless stuff is inside the pak files that isn't really used by the game, but I'm also really greatful it's there)

 

Here's a forum post where they actually say to enable some sort of compression on normal maps.

http://forums.cgsociety.org/archive/index.php/t-182031.html



Sponsor:

#2 Steve_Segreto   Crossbones+   -  Reputation: 1557

Like
0Likes
Like

Posted 12 March 2013 - 01:16 AM

From what I can gather from the links and info you posted, this texture seam is also in the Doom 3 engine and is a result of the way the normals in the model resource file are compressed? I believe they used normal mapping, where they modelled the actor at a higher polygon level, then reduced the polygon count but kept the normals at the higher level and baked them into a normal map.

 

So the question is how are you rendering these models? Have you loaded the normal map and are you decompressing it (and how) and how do you adjust the normals based on the values in the normal map?


Edited by Steve_Segreto, 12 March 2013 - 01:17 AM.


#3 Scouting Ninja   Members   -  Reputation: 781

Like
0Likes
Like

Posted 12 March 2013 - 07:14 AM

This is a common problem when baking normals, and can be improved by blending the connected pieces to together.

This is usually avoided by placing the seams in a unseen place like below the arm on the side, the only reason I can think of doing it like this is if a model is viewed from behind 95% of the time.



#4 Ashaman73   Crossbones+   -  Reputation: 8001

Like
2Likes
Like

Posted 12 March 2013 - 07:59 AM

Notice how down the middle, he has those seams.

You need to take care of mirrored normal maps, e.g. the chest is mirrored at the middle line. In this case your engine needs to take care of two things:

1. Correct handling of handness of the tangent space.

The tangent space of a normal mapped model often uses left-handed and right-handed tangent spaces together. If you strictly use only one handness, some normals will point into the model resulting in wrong lighting (often the whole half of a model is wrongly lit, this seems to be not an issue here).

 

2. Vertex splitting.

I don't know if the doom model format already take care of it, but you need to split vertices when the handness of the tangent space switches, which is the case when using mirrored normal maps. In this case some vertices will share the same texture/normalmap uv coords, but will have different tangent spaces.



#5 ill   Members   -  Reputation: 320

Like
0Likes
Like

Posted 12 March 2013 - 02:57 PM

OK, I was actually using Assimp to convert the md5s to my own format.  Maybe Assimp is messing something up.  I might try to take a look.  I can try debug drawing the tangents on the model and making sure they face opposite directions, which I think would indicate the handedness switch?

 

I'm not sure how to explain the ugly seams at the legs though.



#6 Ashaman73   Crossbones+   -  Reputation: 8001

Like
1Likes
Like

Posted 13 March 2013 - 12:14 AM

To be honest, it is really hard to notice your seams in your image, it does not help to render 10.000 models with an psychedelic color scheme tongue.png. Try to render a single model and mark the seams.



#7 jmakitalo   Members   -  Reputation: 591

Like
0Likes
Like

Posted 13 March 2013 - 05:43 AM

One problem with md5mesh format is that it does not store normal vectors, so the mesh needs to be smoothed after it is loaded. If the artist used some custom smoothing schemes when baking the normals, the renderer has no chance of getting the correct results. I guess that Doom 3 smoothes the meshes uniformly or uses some sort of fixed threshold smooth angle, which is then also used when baking the normal maps.

 

Note that at texture seams, there are degenerate vertices, which should have the same normal. To properly smooth the mesh, it is not sufficient to compare if two faces share the same vertex index, but you must actually compare the vertex positions, possibly with some threshold distance.



#8 ill   Members   -  Reputation: 320

Like
0Likes
Like

Posted 13 March 2013 - 12:13 PM

OK, maybe Assimp needs to be tweaked.  I don't really intend on using Doom 3 models for ever though, just while I'm developing because they're so friggin cool.  Our artist would export things as Dae, With Normals, and then this would probably not be a problem for our real assets.



#9 ankhd   Members   -  Reputation: 1366

Like
0Likes
Like

Posted 16 March 2013 - 09:03 PM

looks like when you make half of a body in 3d and you dont weld the vertices at the seam.






Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS