Bug #1389

engine bug: iqm models cant be used for cockpit/interior models. (recent bug)

Added by MayEpper over 1 year ago. Updated about 1 year ago.

Status:ResolvedStart date:01/26/2013
Priority:UrgentDue date:
Assignee:divVerent% Done:

100%

Category:Engine
Target version:0.7

Description

engine bug: iqm models cant be used for cockpit/interior models.

in darkplaces/
git reset --hard 9af1e45261c3d5e5b4e2bd34332bdb8929776ad7
Fixes this.

but that means recent bug
(to test: go into racer.qc and change the cockpit model to an .iqm)
(it won't show up)

cruizer_interior.iqm (331 KB) MayEpper, 02/15/2013 05:16 pm

sportster_interior.iqm (304 KB) MayEpper, 02/15/2013 05:16 pm

blackhawkedits_smallspinner.iqm (404 KB) MayEpper, 02/15/2013 05:16 pm

blackhawkedits_spinner.iqm (510 KB) MayEpper, 02/15/2013 05:16 pm

sportster.blend (3.63 MB) MayEpper, 02/16/2013 07:18 am

blackhawkedits.blend (4.76 MB) MayEpper, 02/16/2013 07:49 am

History

#1 Updated by MayEpper over 1 year ago

Note: Tested iqm models have bones.

#2 Updated by MayEpper over 1 year ago

5c9d806b99ac9ffda51a3815f25be208e5637864 is the first bad commit
commit 5c9d806b99ac9ffda51a3815f25be208e5637864
Author: havoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Date: Wed Jan 16 16:54:25 2013 +0000

Did the git bisect to find the problem commit:

$ git bisect good d37b098c2280e9aa8205c8d3638d3498361d1b3f
Bisecting: 11 revisions left to test after this (roughly 4 steps)
[40feb4844c09f72a1e2101e44a24e5850510c821] reworked some code for BATCHNEED_NOGAPS to be more consistent and made the comments more clear about its behavior (firstvertex is 0, no gaps), no longer using BATCHNEED_NOGAPS in a couple places

$ git bisect good

Bisecting: 5 revisions left to test after this (roughly 3 steps)
[5a2686be1ae3d6ae92098c3dbf5dde40d98853b1] make MUL_VF and MUL_FV friendlier for compilers, and fix segfaul in LOAD_V

$ git bisect good

Bisecting: 2 revisions left to test after this (roughly 2 steps)
[fb938b81a66661b4c6178a4ef09d6dec65e62229] Fix typos in GPU skeletal; explain the crossproduct hack

$ git bisect bad

Bisecting: 0 revisions left to test after this (roughly 1 step)
[5c9d806b99ac9ffda51a3815f25be208e5637864] implemented a fallback case for r_glsl_skeletal 1 when dynamicvertex occurs (the batch code will apply the skeletal deforms to the batch, to ensure proper functionality with deformvertexes and such) added r_batch_debugdynamicvertexpath cvar which is useful for debugging skeletal fallback issues

$ git bisect bad

Bisecting: 0 revisions left to test after this (roughly 0 steps)
[3e0cb857fd2ea871cb22d243cca55a51a1d90ce7] implemented gpu-skinning (vertex shader skeletal animation), can be disabled by turning off the r_glsl_skeletal cvar

$ git bisect good

5c9d806b99ac9ffda51a3815f25be208e5637864 is the first bad commit
commit 5c9d806b99ac9ffda51a3815f25be208e5637864
Author: havoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Date: Wed Jan 16 16:54:25 2013 +0000

implemented a fallback case for r_glsl_skeletal 1 when dynamicvertex
occurs (the batch code will apply the skeletal deforms to the batch, to
ensure proper functionality with deformvertexes and such)
added r_batch_debugdynamicvertexpath cvar which is useful for debugging
skeletal fallback issues
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@11882 d7cf8633-e32d-0410-b094-e92efae38249
::stable-branch::merge=de5f580da5ed670b6477a1366f6fc30c21080aed

:100644 100644 958a341b5a201b60dad5451dc53a2b619301f33d 7a10c491c4186865e5c8fa85ac3b558e086776e5 M gl_rmain.c
:100644 100644 f694bcfeefac24532f061afb3140a1dae1cee25f 4b353f7039de4403671763e9e5f4e7ad790431ac M render.h

#3 Updated by Samual over 1 year ago

  • Assignee set to divVerent
  • Priority changed from High to 7

I can confirm this bug, but it also affects playermodels.

For me, with r_glsl_skeletal 1 enabled, playermodels ALWAYS look like this and don't play any animations: http://pics.nexuizninjaz.com/images/055hi262h229glhakisl.jpg

#4 Updated by MayEpper over 1 year ago

This bug is still present in latest darkplaces.

It affects any IQM model that is attached to another (iqm atleast) model.
The attached model has missing faces (most faces missing):

Before bugged engine:
http://pics.nexuizninjaz.com/images/s833y5bi0fygx0aahas.jpg

After bugged engine:
http://pics.nexuizninjaz.com/images/c88r5qg4gsqopt00zgv.jpg

Another bugged model, notice only a few faces on the helicopter's prop are visible:
http://pics.nexuizninjaz.com/images/fq8tdpkftbu7tpco0l.jpg

It seems only faces with _pants or _skin are showing up in the attached iqm models

This is a bug. These all have proper normals and they worked for a long time.
Please fix this bug. Please.

#5 Updated by MayEpper over 1 year ago

The commit that created this bug was this one:
5c9d806b99ac9ffda51a3815f25be208e5637864 is the first bad commit
commit 5c9d806b99ac9ffda51a3815f25be208e5637864
Author: havoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Date: Wed Jan 16 16:54:25 2013 +0000

implemented a fallback case for r_glsl_skeletal 1 when dynamicvertex
occurs (the batch code will apply the skeletal deforms to the batch, to
ensure proper functionality with deformvertexes and such)
added r_batch_debugdynamicvertexpath cvar which is useful for debugging
skeletal fallback issues

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@11882 d7cf8633-e32d-0410-b094-e92efae38249
::stable-branch::merge=de5f580da5ed670b6477a1366f6fc30c21080aed

:100644 100644 958a341b5a201b60dad5451dc53a2b619301f33d 7a10c491c4186865e5c8fa85ac3b558e086776e5 M gl_rmain.c
:100644 100644 f694bcfeefac24532f061afb3140a1dae1cee25f 4b353f7039de4403671763e9e5f4e7ad790431ac M render.h
#3 Updated by Samual 15 days ago

#6 Updated by MayEpper over 1 year ago

Here are some of the IQM's that are attached and have the problem. You can test it by making one the "cockpit" of the racer (qcsrc/server/vehicles/racer.qc). That attaches the cockpit and will trigger this bug. Each of these IQMs have one bone in the center, as demanded by the exporter.

#7 Updated by MayEpper over 1 year ago

I think this happens when the .colormod is set to, say, 1023 (an unused colormod (unless the 255th player joins) and the surface has a _shirt or _pants.
Previously this would give you a black .colormod which was what was desired in this circumstance (otherwise there was no way to get black).
Now the surface isn't rendered at all.

Could this be changed back to the previous behavior?

(helicopter on engine of last month before change, showing visible props: http://pics.nexuizninjaz.com/images/zttxxfmf07qrnabehhun.jpg)

Contrast 2 sshots. Notice the center of the propeller.
Slightly older engine: http://pics.nexuizninjaz.com/images/ac3f0yt149cmxsit5l1v.jpg
Newer: http://pics.nexuizninjaz.com/viewer.php?file=sfwrq70lvp4txqhweqm.jpg
surface isn't drawn :(

#8 Updated by MayEpper over 1 year ago

note: .colormap, not colormod.

I just tried setting .colormap to a "proper" colormap (1024) and the attached/interior model still was not drawn. (Same bugs)
Note: intel gma computer.

So it's definitly a bug
r_glsl_skeltal 0 didn't fix it either.

Intel's don't like r_glsl tho anyway.

#10 Updated by MayEpper over 1 year ago

Note: r_glsl is 0;

#11 Updated by MayEpper over 1 year ago

Did more testing. Even when said models are set as unattached "toplevel" models most faces are missing.
The faces that are missing seem to be ones with _shirt or _pants or ones with effects like chrome

So it seems if there are extra layers (shirts pants, cubemap reflections) sometimes, for some unknown reason, the surface isn't rendered.
On other iqm models those materials are rendered.

Other notes: the textures used for materials are often 8x8 small textures (though not always).
Strange that that commit about skeletal skinning made this bug :(

#12 Updated by MayEpper over 1 year ago

Here are some .blend files that contain sourcemesh of the iqms so you can see that the normals are correct.

#13 Updated by MayEpper over 1 year ago

This bug was reported on the #darkplaces channel on irc.anynet.org.
The response was an immediate gline.
I don't know what to make of that.

#14 Updated by MayEpper over 1 year ago

#15 Updated by MayEpper over 1 year ago

Lord Havoc gave some insight

> r_glsl 0 doesn't do anything, it's a read-only cvar (indicating whether vid_gl20 1 initialized correctly).

You want r_glsl_skeletal 0.

Most likely it is blowing out the limits of the Intel driver on glUniform variables, and only on certain material feature combinations, the skeletal support eats nearly the entire allowed number of
variables by itself, no easy workaround for that other than suppressing the feature.

Note: r_glsl_skeletal 0 did not affect the bug on my intel box (surfaces still not rendered).

#16 Updated by theShadow over 1 year ago

I just compiled the latest source on OSX mountain lion, and while playing with r_glsl_skeletal set to one will cause massive drops in frame rate while other player models are on screen.

no player on screen: 130 FPS
1 player on screen: 20-30 FPS
2 or more players: 3-0 FPS

Setting r_glsl_skeletal 0 resolves this, and samual believes it may be related to this issue. Could someone else with an OSX machine try and confirm what I am seeing?

#17 Updated by Samual over 1 year ago

For the record, theShadow also has an intel chipset- that's rather the relation i'm referring to.

#18 Updated by MayEpper over 1 year ago

It seems when a material has various effects on it (cubemap (shinyness) AND pants/shirt) it sometimes (or often) doesn't render those faces anymore.

From git-log on my "concrete" (ie: works on intel) branch of xonotic, where I did the git-bisect:
The last good commit was this one:

commit 3e0cb857fd2ea871cb22d243cca55a51a1d90ce7
Author: havoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Date: Wed Jan 16 14:23:31 2013 +0000

implemented gpu-skinning (vertex shader skeletal animation), can be
disabled by turning off the r_glsl_skeletal cvar

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@11881 d7cf8633-e
::stable-branch::merge=c2e80277d20d64e0da8ea14523eed5af1f3120dd

The commit after that is also related to that stuff, and seems to cause the problem.

My frame rates never get high enough to know if it occurs on higher up.

changing r_glsl_skeletal doesn't do anything on my intel box (vid_restart). Faces are still invisible.

#19 Updated by MayEpper over 1 year ago

TheShadow: How do you compile darkplaces for xonotic for Mac and windows. I'd like to make some small changes to enable some features which are only now enabled for single player (ie: comment out some lines), but want to use this "concrete" version of dp. Currently I use the autobuilds, or I did. Theoretically a single digit hexedit would work too to bypass the "no you may not use that feature except in singleplayer" restriction, if on could tell where to edit on the lin/win/osx binaries.

#20 Updated by MayEpper over 1 year ago

It appears that the bug about the disappearing faces is fixed on latest git.

#21 Updated by Samual over 1 year ago

  • Target version set to 0.7

#22 Updated by divVerent about 1 year ago

  • Status changed from New to Resolved
  • % Done changed from 0 to 100

Also available in: Atom PDF