Rendering HUD weapons

Ask about editing graphics, sounds, models, music, etc here!
Shaders (GLSL) and SNDINFO questions also go here!
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.

Rendering HUD weapons

Postby Cherno » Wed Jul 04, 2018 8:55 am

I would like get some info about how to render HUD weapons (viewmodels).

I have all assets I need, including the weapon / arms/hands model, rigged, animated, lighting set up, camera and so on.

What I am not sure about is:

How to position the model in the lower right corner of the camera viewport so that it has the correct angle. I assume that most angled weapons in Doom have a diagonal angle, coming into view in the lower right corner or near it, and pointing towards the crosshair/middle of the screen. In a square viewport, this is easy, but with modern 16:9 etc. screen in GZDoom, it seems to be more complicated. What dimensions should the rendered image have? For vanilla Doom, it's 320*240 or 320*200, right? That results in the weapon being cut off on the right border, which causes problems with wider screens. Also, what fov should the camera use? It's currently set to 90 degrees.
User avatar
Cherno
 
Joined: 06 Dec 2016

Re: Rendering HUD weapons

Postby Pixel Eater » Wed Jul 04, 2018 4:30 pm

I don't know if this is super helpful, but I think of 320x240 as being for 4:3 monitors, 320x200 for 16:10 and 320x180 for 16:9.
User avatar
Pixel Eater
In my thoughts I have seen rings of smoke through the trees.
 
 
 
Joined: 02 Aug 2017
Location: In between the Moon and you, between the buried and me.

Re: Rendering HUD weapons

Postby wildweasel » Wed Jul 04, 2018 6:13 pm

Pixel Eater wrote:I don't know if this is super helpful, but I think of 320x240 as being for 4:3 monitors, 320x200 for 16:10 and 320x180 for 16:9.

That's kind of the opposite of what actually goes on, unless you're scaling the image with Textures or something.

Doom's original screen resolution was 320x200, but the pixels on that screen were not square; I believe it's a ratio of 1.2:1. So it still fills out a 4:3 display, thanks to the way CRTs worked at the time. More here: https://doomwiki.org/wiki/Aspect_ratio

The TL;DR of it, though: if you're not messing with Textures-based scaling, your graphic should be about 80% normal height - Doom's aspect ratio will correct that back up.
User avatar
wildweasel
I love the smell of sourdough in the morning
Moderator Team Lead
 
Joined: 15 Jul 2003
Location: avatar by kurashiki

Re: Rendering HUD weapons

Postby Pixel Eater » Wed Jul 04, 2018 7:07 pm

I was just stating that to simplify things. I would recommend going the 'textures' route and post-scale the sprites instead of degrading them going in. This is sprites from 3D models correct? (if it's models I'm probably no help there).

Take a look at the attached .wad file as it demonstrates how to maintain your aspect once in DooM by scaling the default weapons to keep their square pixels. In Slade, double click the TEXTURES file for the textures editor and tick 'Apply Scale' and 'Aspect Ratio Correction' near the top-right corner to see how it should look in game. Notice how the X scale is 0.833, that might be what you want for your own sprites.



If your images started life with non-square pixels then just ignore all of this I guess :lol:
Attachments
BigButts.wad
(3.91 KiB) Downloaded 4 times
User avatar
Pixel Eater
In my thoughts I have seen rings of smoke through the trees.
 
 
 
Joined: 02 Aug 2017
Location: In between the Moon and you, between the buried and me.


Return to Assets

Who is online

Users browsing this forum: No registered users and 1 guest