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!
-
Make a model using a modeling program. I used blender but things such as 3DS max work too.
-
Create an empty hammer map. Feel free to use the hammer map used in this example.
-
Export your model AS AN OBJ to myaddon/maps/ (Just put it in the same file as the .bsp)
Now put your materials in (myaddon)/materials/infmap/
If the textures were exported in a folder (such as ./textures) just put that folder in (myaddon)/materials/infmap/
-
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
The shaders can be exchanged such as "nocull" or "alphatest" instead of "nocull alphatest"