Skip to content

Latest commit

 

History

History
59 lines (43 loc) · 3.84 KB

README.md

File metadata and controls

59 lines (43 loc) · 3.84 KB

Infinite-Map-OBJ-Example

This is an example obj in my .OBJ Parser for the Infinite Map project You NEED the Infinite Map base in order to use this!

This is NOT meant to be used as an on-the-fly object loader. It is meant as a MAP loader. IT IS LIKELY THAT THE SAME PERFORMANCE YOU GET IN BLENDER (in the material view mode) WILL BE THE PERFORMANCE YOU GET INGAME. OPIMIZE YOUR MODELS!

Example of what the loader can do: Assetto Corsa Map

KEEP IN MIND WHEN MAKING / IMPORTING YOUR .OBJS:

  • Make sure to optimize your .objs! Don't expect to be able to instantly port any model without lag.
  • Visual .objs can be optimized by simpily having less objects in the scene. Just make sure the triangle count per object is under 21,845.
  • Visual .objs with more than 20k tris per surface may break!
  • Make sure each visual object has a material or it will combine models!
  • Physical objs can be optimized just by making the tri count less.
  • Triangles larger than 1 chunk (10,000 hammer units) and smaller than 10 hammer units will not have collision.
  • Large and detailed OBJ files may take a while to load, just give it time!
  • Due to a memory leak related to vectors (garry moment) the OBJ loader takes a lot of ram. If you occur crashing I suggest switching to the 64 Bit branch as it is more stable and allows more ram to be allocated to the game.
  • Make sure to name your files to something unique or it may conflict with someone elses model!

Making your own map .obj in 10 steps

  1. Make a model using a modeling program. I used blender but things such as 3DS max work too. image

  2. Create an empty hammer map. Feel free to use the hammer map used in this example. image

  3. Create a new addon with this structure image

  4. Export your model AS AN OBJ to myaddon/maps/ (Just put it in the same file as the .bsp)

  5. Make sure you export with materials! image

  6. You should now have a .obj and .mtl file in (myaddon)/maps/ image

Now put your materials in (myaddon)/materials/infmap/ image

If the textures were exported in a folder (such as ./textures) just put that folder in (myaddon)/materials/infmap/

  1. Because of workshop restrictions it is impossible to upload a .obj and .mtl file. In order to combat this, turn the .obj and .mtl files into AIN files. I am aware this is kind of cursed, but I am at the mercy of gmpublisher.exe. If you do not wish to do this step, feel free to skip it. Just know that in order to upload to the workshop, you must change all .objs and .mtls into .AINs image

  2. Create a new LUA file in (myaddon)/lua/infmap/(mapname)/ image

  3. Use the InfMap.parse_obj function (see image for code) image

The shaders can be exchanged such as "nocull" or "alphatest" instead of "nocull alphatest"

  1. Start gmod and enter your new amazing map! image