OBJ support in GZDoom

Forum rules
Please don't start threads here asking for help. This forum is not for requesting guides, only for posting them. If you need help, the Editing forum is for you.

Post a reply

Smilies
:D :) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :wink: :geek: :ugeek: :!: :?: :idea: :arrow: :| :mrgreen: :3: :wub: >:( :blergh:
View more smilies

BBCode is OFF
Smilies are ON

Topic review
   

Expand view Topic review: OBJ support in GZDoom

Re: OBJ support in GZDoom

by Arctangent » Sun Mar 03, 2019 2:47 pm

Trusty McLegit wrote:Ohhhhh okay, that makes sense. This is something you couldn't do with MD3?
I'm pretty sure you could make an MD3 of a map, but the MD3 format has hard limits on various aspects of the model and thus any map past a certain complexity would be a complete no-go.

Re: OBJ support in GZDoom

by Kappes Buur » Sun Mar 03, 2019 2:43 pm

Request :D :

Could somebody make a step by step tutorial about using wavefront obj for GZDOOM.
How to export from GZDoom, manipulate with Blender and import back into GZDoom.
Something like OBJ for Dummies.

moved to viewtopic.php?f=39&t=63858

Re: OBJ support in GZDoom

by Steve5563 » Thu Feb 28, 2019 6:29 pm

hi there, quick question. i am trying to export a very basic map as the .obj file and then import the same exact same file ( map ) back into gzdoom builder using the "wavefront obj as terrain" so i can open the level back up in gzdoom builder and then save the map as a .wad file. but its coming up with a error saying "only triangular faces are supported".
am i doing something wrong here as its my first time using this feature or doing anything with 3d model / files.
i am wanting to modify some textures in a 3d program with out altering the maps geometry in anyway. can this be fixed or a feature added to gzdoom builder, exporting the map as a .obj file and then importing the file back into gzdoom builder as a map and saving it as a .wad file? cheers

Re: OBJ support in GZDoom

by Trusty McLegit » Mon Oct 15, 2018 5:58 pm

Ohhhhh okay, that makes sense. This is something you couldn't do with MD3?

Re: OBJ support in GZDoom

by Caligari87 » Mon Oct 15, 2018 4:25 pm

Trusty McLegit wrote:
Talon1024 wrote:
  • OBJs are not bound by the same limits as MD2, MD3, or UE1 models. For example, you can export a model of The Given MAP01 from GZDoom Builder and use it in GZDoom. With OBJ support, GZDoom has come full circle in that regard.
Wait, what??? You can export an .Obj of a map and use it AS a map? Or do you just mean you could use a 3d model of a doom map as a decoration or something? Because if you mean the first one, that would imply collision detection out of the box right? And if you meant the latter, than what would hold you back from exporting the map as an .obj, converting that to an md3, and using that as a decoration? Slightly confused as to what you meant here :P
You can use an OBJ as a "map" in GZDoom, but it will not have collision support. You'd still need to build a "skeleton" level for the player to walk and move in, but the visible geometry could be a single OBJ model with much more detail than can be achieved with linedefs/sectors.
Trusty McLegit wrote:Also, not very familiar with .obj in general. Can you still animate with OBJ models, or is it just for static models? Or would you need to have a separate obj for each frame?
OBJ does not support animations, to my knowledge, you're better off using MD3 for that. OBJ is better for static decorations.

8-)

Re: OBJ support in GZDoom

by Trusty McLegit » Mon Oct 15, 2018 1:59 pm

Talon1024 wrote:
  • OBJs are not bound by the same limits as MD2, MD3, or UE1 models. For example, you can export a model of The Given MAP01 from GZDoom Builder and use it in GZDoom. With OBJ support, GZDoom has come full circle in that regard.
Wait, what??? You can export an .Obj of a map and use it AS a map? Or do you just mean you could use a 3d model of a doom map as a decoration or something? Because if you mean the first one, that would imply collision detection out of the box right? And if you meant the latter, than what would hold you back from exporting the map as an .obj, converting that to an md3, and using that as a decoration? Slightly confused as to what you meant here :P

Also, not very familiar with .obj in general. Can you still animate with OBJ models, or is it just for static models? Or would you need to have a separate obj for each frame?

Finally, hope I'm not asking too much, but could you provide a simple example wad so I can get a clearer understanding of how to use them? I didn't really follow what you wrote in the OP, and it would be easier to simply see it in action

Re: OBJ support in GZDoom

by Talon1024 » Wed Sep 05, 2018 6:10 am

Nash wrote:How to embed texture paths into each mesh group?

Code: Select all

usemtl "models/my character/head 01.png"
You won't need quotes if you remove the spaces or replace them with underscores, BTW.
Reinchard2 wrote:Is automatic polygonal collision detection possible in near future? Or is it still one of engine limitations?
ZZYZX did just that with ZScript.

Re: OBJ support in GZDoom

by Nash » Wed Sep 05, 2018 5:44 am

How to embed texture paths into each mesh group? This is still unclear. MD3 let you use full texture path names ("models/my character/head 01.png") per object/mesh group/surface/whatever you call it.

Re: OBJ support in GZDoom

by Reinchard2 » Wed Sep 05, 2018 5:36 am

Is automatic polygonal collision detection possible in near future? Or is it still one of engine limitations?

Re: OBJ support in GZDoom

by Talon1024 » Tue Sep 04, 2018 3:14 pm

  • Blender's MD3 export plugins are poorly documented and clunky to use IMO. OBJs are much more convenient, and much easier to change if necessary.
  • OBJs are not bound by the same limits as MD2, MD3, or UE1 models. For example, you can export a model of The Given MAP01 from GZDoom Builder and use it in GZDoom. With OBJ support, GZDoom has come full circle in that regard.

Re: OBJ support in GZDoom

by HAL9000 » Tue Sep 04, 2018 2:30 pm

So, a quick question.... What are the benefits of using OBJ over MD3 file format in GZDoom?
(Except that I don't have to use extra steps to convert OBJ to MD3)

Don't get me wrong, I welcome this addition to the engine.
It's a nice thing that I can use OBJ straight away without converting it to other file formats

Re: OBJ support in GZDoom

by Reinchard2 » Tue Sep 04, 2018 12:39 pm

Oh, so smoothing groups works ok, I just don't understand you correctly in your previous post.

Re: OBJ support in GZDoom

by Talon1024 » Tue Sep 04, 2018 10:58 am

Well, you can get smooth groups if you include the normals in the OBJ, since smooth groups are only a way to control calculation of vertex normals. However, I'm afraid that if I were to add code that searches for adjacent faces, I would end up increasing loading times too much.

Re: OBJ support in GZDoom

by Reinchard2 » Tue Sep 04, 2018 10:52 am

Wow, that's really great news. Thanks for your work. I'm hope you can add support for smoothing groups some time, it's very important in some cases.

OBJ support in GZDoom

by Talon1024 » Tue Sep 04, 2018 10:47 am

If you've seen the recent GZDoom changelog, you'll notice that I've added OBJ model support to GZDoom. However, due to the way GZDoom works, OBJ models for GZDoom are a little bit different than regular OBJ models.

First of all, GZDoom does not load the .mtl files that usually come with .obj models. Instead, GZDoom uses the materials that it has already loaded. So, if you have a material in your OBJ file called STARGR2, GZDoom will use the STARGR2 texture from the Doom/Doom 2 IWAD, instead of the STARGR2 material defined in the .mtl file.

Secondly, you can swap out materials on OBJ models using SurfaceSkin in the model definition file. Each "surface" on an OBJ model corresponds to a "usemtl" statement, so if you use "SurfaceSkin 0 0" in your model definition file, you'll change the texture on the faces below the first "usemtl" statement in the OBJ file, and if you use "SurfaceSkin 0 1" in your model definition file, you'll change the texture on the faces below the second "usemtl" statement. Because of an engine limit, however, you cannot replace any textures after the 32nd "usemtl" statement. If you really want, you can just open the OBJ file in a text editor and change the usemtl statements directly.

Third, some features supported by OBJ have been omitted because I thought they would be unimportant or too hard to add. Parametric surfaces, smooth groups for models without normals (although I am considering adding this feature), (Added as of this commit!) and faces with more than 4 sides fall under this category.

But, with this new feature, you can already load gigantic, highly detailed 3D models, such as levels exported from GZDoom Builder, or this model from Turbosquid (thanks, Rachael!). I've already stress-tested GZDoom's OBJ loader with a model of The Given RC2 MAP01 exported from GZDB, and several other maps from Ancient Aliens and Freedoom. Although OBJ rendering is supported in the software renderers, just bear in mind that the more highly-detailed models may crash the software renderers.

Top