Simple model help

Ask about editing graphics, sounds, models, music, etc here!
Shaders (GLSL) and SNDINFO questions also go here!

Moderators: GZDoom Developers, Raze Developers

Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.
User avatar
Sir Robin
Posts: 537
Joined: Wed Dec 22, 2021 7:02 pm
Graphics Processor: Intel (Modern GZDoom)
Location: Medellin, Colombia

Simple model help

Post by Sir Robin »

Hi, I have not yet delved into modeling and want to know how to get started.

To start: How to create a cube, add textures to the 6 sides, set the offset/origin, and save that into something that can be imported in GZDoom.
And if there's a way to save the model in a way that I can reuse it with different textures that's a plus.
And I can apply materials to those texture files the same as other textures for flats and walls, right?

Can anyone tell me how to do that or point me to a tutorial? Thanks
User avatar
Sir Robin
Posts: 537
Joined: Wed Dec 22, 2021 7:02 pm
Graphics Processor: Intel (Modern GZDoom)
Location: Medellin, Colombia

Re: Simple model help

Post by Sir Robin »

Let me start at step 1 - what modeler program should I use? Blender? I jst want to create a cube, so don't need anything fancy. If I could create a model by hand in a text file I'd be fine with that.
User avatar
ramon.dexter
Posts: 1537
Joined: Tue Oct 20, 2015 12:50 pm
Graphics Processor: nVidia with Vulkan support
Location: Kozolupy, Bohemia

Re: Simple model help

Post by ramon.dexter »

Blender, definitely blender.
How to make a cube, how to texture it - youtube is full of videos. Just type blender modelling basics and watch.
User avatar
Sir Robin
Posts: 537
Joined: Wed Dec 22, 2021 7:02 pm
Graphics Processor: Intel (Modern GZDoom)
Location: Medellin, Colombia

Re: Simple model help

Post by Sir Robin »

OK, got it going. This was way easier than I thought it was going to be, don't know why I was stressing.

For anyone else wondering how to do it, it's prett easy:
Open blender, create a cube (or whatever) apply a texture image as a material, adjust the UV coordinates as you want, then save it as Waveform OBJ
Here's the thing - OBJ is a text format, so you don't even need Blender. If you know what you want to make you can make it by hand in a text editor.
After that create a modeldef file to link the model to an actor's sprite frames.

I'm not sure why there are posts saying to convert the obj to md3 - why is md3 prefered? Is that for animation and other features I'm not using?

The issues I'm seeing so far:
The model is too short, I have to use "scale 1.0 1.0 1.2" in the modeldef to get it the right size. Is that normal or am I doing somethiing wrong?
How to apply materials to model skin?
User avatar
ramon.dexter
Posts: 1537
Joined: Tue Oct 20, 2015 12:50 pm
Graphics Processor: nVidia with Vulkan support
Location: Kozolupy, Bohemia

Re: Simple model help

Post by ramon.dexter »

Yes, md3 is much more effective format, which also allows animations. I personally prefer it, because it greatly reduces file size.

Edit: materials are applied to the texture the same way as you apply it to texture.
User avatar
Sir Robin
Posts: 537
Joined: Wed Dec 22, 2021 7:02 pm
Graphics Processor: Intel (Modern GZDoom)
Location: Medellin, Colombia

Re: Simple model help

Post by Sir Robin »

ok, I figured out the skin materials thing.

In the GLDEFS you usually start a material def with "Material Texture [texture name]"
But in the case of model skins you put the full path to the skin file, like "Material "models/MyModel01/skins/MySkin01.png"" and the rest is as usual
User avatar
Sir Robin
Posts: 537
Joined: Wed Dec 22, 2021 7:02 pm
Graphics Processor: Intel (Modern GZDoom)
Location: Medellin, Colombia

Re: Simple model help

Post by Sir Robin »

Other things I've learned:
You don't have to provide a skin file, you can specify a texture name and it will be used along with it's material definition, brightmap, and animation, so you don't have to redefine all that again for the skin file.
The wiki MODELDEF page says that SurfaceSkin can only be used on MD3 models, but it works on OBJ models, as the wiki OBJ page says.
User avatar
ramon.dexter
Posts: 1537
Joined: Tue Oct 20, 2015 12:50 pm
Graphics Processor: nVidia with Vulkan support
Location: Kozolupy, Bohemia

Re: Simple model help

Post by ramon.dexter »

Well, to add: if you set the name of the material in blender the same as the filename of the texture file, you don't need to specifically define the textures as skins in modeldef. This is useful when the model uses more than one texture, but I'm not sur if this approach will allow multi-textured materials.
User avatar
Sir Robin
Posts: 537
Joined: Wed Dec 22, 2021 7:02 pm
Graphics Processor: Intel (Modern GZDoom)
Location: Medellin, Colombia

Re: Simple model help

Post by Sir Robin »

ramon.dexter wrote: Sat Nov 04, 2023 10:32 am Well, to add: if you set the name of the material in blender the same as the filename of the texture file, you don't need to specifically define the textures as skins in modeldef. This is useful when the model uses more than one texture, but I'm not sur if this approach will allow multi-textured materials.
Yes, I found that also, name the materials in Blender or whatever to be the same names as your textures (and doesn't have to be an actual texture file, could be a texture defined in TEXTURES lump)
And if that texture has a material definition (like brightmap and normalmap and all that), then the material is used when shading the model, so I think that's a yes to your multi-texture material comment.

One annoying thing in Blender is you have to set all your objects to link materials as you go. Otherwise if for example you create an object with a material called PineWood to reference a gzdoom texture of that name, then you create another object in the same scene and give it that same material, it automatically renames the other one to PineWood.001 and then it doesn't work in GZDoom. So, yeah, remember to link your material between objects.
Fragger
Posts: 41
Joined: Sat Mar 19, 2022 11:59 am
Graphics Processor: Intel (Modern GZDoom)

Re: Simple model help

Post by Fragger »

Sir Robin wrote: Mon Sep 25, 2023 6:17 pm Let me start at step 1 - what modeler program should I use? Blender? I just want to create a cube, so don't need anything fancy. If I could create a model by hand in a text file I'd be fine with that.
If a cube is all you need, you can use ultimate Doom builder and export it as obj, then import the model as an actor. UDB creates the modeldef and the zscript.

Return to “Assets (and other stuff)”