View previous topic :: View next topic |
Author |
Message |
mh

Joined: 12 Jan 2008 Posts: 909
|
Posted: Mon May 10, 2010 6:55 pm Post subject: |
|
|
Sajt wrote: | Probably. Anyway, I don't think that model works in even DarkPlaces. I did manage to figure out how to decode the skin. If you want the code I could post it. In any case, the code for FixMDL will go up on the QShed SVN one of these days.
The model that I thought you were going to look at was not nofix.mdl, but bomb.mdl. This model was run through QWalk, which resulted in some duplication of vertices (since QWalk doesn't support the old facesfront/onseam Quake texcoord system). I think QWalk must have recalculated the normals after that, which results in hard lighting seams along where the vertices were duplicated. But it looked fine in DarkPlaces for some reason. |
The bomb.mdl link is gone to 404-land.
Any possibility of one normal facing inwards and another facing outwards for a vert that has been duplicated?
I've been looking over the DP MDL loader and render setup and think it's likely a case of DP doing better blending on the normals resulting in a smoother transition. It also uses proper normals rather than a precalculated dotproduct. _________________ DirectQ Engine - New release 1.8.666a, 9th August 2010
MHQuake Blog (General)
Direct3D 8 Quake Engines |
|
Back to top |
|
 |
Sajt
Joined: 16 Oct 2004 Posts: 1026
|
Posted: Mon May 10, 2010 7:14 pm Post subject: |
|
|
I believe the problem was simply that the normals were being calculated based on the split up edges, and it was happening in a "stair-step" pattern causing the edges of some of those "stairs" to go black. I suspect that DarkPlaces recalculates normals on load and even looks for co-locating vertices that aren't attached to the same triangle. Or something.
Here's a screenshot that sort of shows the funny stairstep: http://www.icculus.org/~sajt/uglybomb.jpg
And here's bomb.mdl: http://www.icculus.org/~sajt/bomb.mdl _________________ F. A. Špork, an enlightened nobleman and a great patron of art, had a stately Baroque spa complex built on the banks of the River Labe. |
|
Back to top |
|
 |
mh

Joined: 12 Jan 2008 Posts: 909
|
Posted: Mon May 10, 2010 9:34 pm Post subject: |
|
|
Nice one, cheers. DP doesn't recalculate normals by the way, but it does use a lookup table containing the normal vector itself (rather than a precomputed DotProduct) and blends normal vectors at render time (rather than light * (dp1 * blend + dp2 * (1 - blend)).
It does remove duplicate verts at load, but so does DirectQ.
From the looks of the bomb in-game, the ugliness seems to occur on backfacing triangles. I think QWalk's loading code is good (it's almost the same as DirectQ's, but that's irrelevant), but I'm not too certain about that compress_normal function during the saving. _________________ DirectQ Engine - New release 1.8.666a, 9th August 2010
MHQuake Blog (General)
Direct3D 8 Quake Engines |
|
Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2004 phpBB Group
|