Facepunch / garrysmod-requests

Feature requests for Garry's Mod
84 stars 24 forks source link

Ability to Disable SW/DX8 VTX Mesh Compiling in StudioMDL #1850

Closed VanderAGSN closed 3 years ago

VanderAGSN commented 3 years ago

In the mostly new source engine(s) it's possible to disable unused (or rarely) mesh types, such as sw/dx8. Garry's Mod mostly works on DirectX 9, so need for outdated meshes completely disappears and in almost all cases you only use dx90.vtx meshes. So I always try to delete sw.vtx and dx80.vtx for my props in addons.

In Valve Developer Community says that there are two ways to do this. In Gmod none of these cases works:

First one not very convenient, but maybe there is a place to be for someone. It's -fastbuild, which skip processing DX7, DX8, X360, and software VTX variants (use .dx90.vtx only). This speeds up compiling.

And the most convenient way is the second one, you write "SupportsDX8" "0" in gameinfo.txt This works in CSGO, L4D1/2, maybe in some more games that I have not tried. This option would be more desirable for me.

With this feature you will significantly speed up the compiling of props, cause you don't have to wait for compilation of three meshes when you still need only one of them.

robotboy655 commented 3 years ago

Added -fastbuild. It is the superior option which allows you to use it without editing any game files. It will only skip DX8/Software vtx files like it does in CS:GO, there's already an option for the x360 files (-nox360)

VanderAGSN commented 3 years ago

Wow, awesome! Also can you make also "SupportsDX8" support in gameinfo? This is important cause applications such as "Crowbar" do not remember any command line options after re-opening the application. I've already notified him for this, but it might be easier for you to add this as well

VanderAGSN commented 3 years ago

I have some issues with this. -fastbuild is active, studiomdl compiles only dx9 as well, but something is wrong. When I compile the model this last line appears at the end

     writing I:\Steam\steamapps\common\GarrysMod\garrysmod\models/vanderagsn\test.vvd:
      vertices   1356768 bytes (28266 vertices)
      tangents    452256 bytes (28266 vertices)
      total      1809088 bytes
      ---------------------
      Generating optimized mesh "I:\Steam\steamapps\common\GarrysMod\garrysmod\models/vanderagsn\test.dx90.vtx":
      body parts:         8 bytes
      models:            20 bytes
      model LODs:        12 bytes
      meshes:             9 bytes
      strip groups:      25 bytes
      strips:            27 bytes
      verts:         254394 bytes
      indices:        84930 bytes
      bone changes:      16 bytes
      everything:    339465 bytes
      Error opening I:\Steam\steamapps\common\GarrysMod\garrysmod\models/vanderagsn\test.dx80.vtx
VanderAGSN commented 3 years ago

That's how model looks with low-mid-high settings and -fastbuild https://streamable.com/d5y30g. Most likely due to an error the model does not compile completely

VanderAGSN commented 3 years ago

@robotboy655 Well, i figured out, studiomdl really doesn't finish compile with -fastbuild. That's how model compiled without it:

  Generating optimized mesh "I:\Steam\steamapps\common\GarrysMod\garrysmod\models/vanderagsn\test.sw.vtx":
  body parts:         8 bytes
  models:            20 bytes
  model LODs:        12 bytes
  meshes:             9 bytes
  strip groups:      25 bytes
  strips:            27 bytes
  verts:         254394 bytes
  indices:        84930 bytes
  bone changes:      16 bytes
  everything:    339465 bytes
        ---------------------
  Generating optimized mesh "I:\Steam\steamapps\common\GarrysMod\garrysmod\models/vanderagsn\test.dx80.vtx":
  body parts:         8 bytes
  models:            20 bytes
  model LODs:        12 bytes
  meshes:             9 bytes
  strip groups:      25 bytes
  strips:            27 bytes
  verts:         254394 bytes
  indices:        84930 bytes
  bone changes:      16 bytes
  everything:    339465 bytes
        ---------------------
  Generating optimized mesh "I:\Steam\steamapps\common\GarrysMod\garrysmod\models/vanderagsn\test.dx90.vtx":
  body parts:         8 bytes
  models:            20 bytes
  model LODs:        12 bytes
  meshes:             9 bytes
  strip groups:      25 bytes
  strips:            27 bytes
  verts:         254394 bytes
  indices:        84930 bytes
  bone changes:      16 bytes
  everything:    339465 bytes
  Completed "test.qc"

And with -fastbuild

    Generating optimized mesh "I:\Steam\steamapps\common\GarrysMod\garrysmod\models/vanderagsn\test.dx90.vtx":
  body parts:         8 bytes
  models:            20 bytes
  model LODs:        12 bytes
  meshes:             9 bytes
  strip groups:      25 bytes
  strips:            27 bytes
  verts:         254394 bytes
  indices:        84930 bytes
  bone changes:      16 bytes
  everything:    339465 bytes
  Error opening I:\Steam\steamapps\common\GarrysMod\garrysmod\models/vanderagsn\test.dx80.vtx
robotboy655 commented 3 years ago

I will look into it tomorrow.

robotboy655 commented 3 years ago

O I think I see what the problem, it's due to LOD with only some models.

robotboy655 commented 3 years ago

Should be fixed.

VanderAGSN commented 3 years ago

Everything works now, thank you!


      writing I:\Steam\steamcmd\sdk\garrysmod\models\test_new.vvd:
      vertices     46848 bytes (976 vertices)
      vertices    153936 bytes (3207 vertices)
      vertices     24096 bytes (502 vertices)
      vertices      7440 bytes (155 vertices)
      vertices         0 bytes (0 vertices)
      tangents     15616 bytes (976 vertices)
      tangents     51312 bytes (3207 vertices)
      tangents      8032 bytes (502 vertices)
      tangents      2480 bytes (155 vertices)
      tangents         0 bytes (0 vertices)
      total       309824 bytes
      ---------------------
      Generating optimized mesh "I:\Steam\steamcmd\sdk\garrysmod\models\test_new.dx90.vtx":
      body parts:        40 bytes
      models:           100 bytes
      model LODs:        60 bytes
      meshes:            72 bytes
      strip groups:     200 bytes
      strips:           216 bytes
      verts:          43560 bytes
      indices:        43182 bytes
      bone changes:     736 bytes
      everything:     88142 bytes

      Completed "test_new.qc"