Rendering HUD weapons

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.
Post Reply
User avatar
Cherno
Posts: 1309
Joined: Tue Dec 06, 2016 11:25 am

Rendering HUD weapons

Post by Cherno »

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
Pixel Eater
 
 
Posts: 667
Joined: Wed Aug 02, 2017 12:31 am
Location: In between the Moon and you, between the buried and me.

Re: Rendering HUD weapons

Post by Pixel Eater »

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
wildweasel
Posts: 21706
Joined: Tue Jul 15, 2003 7:33 pm
Preferred Pronouns: He/Him
Operating System Version (Optional): A lot of them
Graphics Processor: Not Listed
Contact:

Re: Rendering HUD weapons

Post by wildweasel »

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
Pixel Eater
 
 
Posts: 667
Joined: Wed Aug 02, 2017 12:31 am
Location: In between the Moon and you, between the buried and me.

Re: Rendering HUD weapons

Post by Pixel Eater »

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 79 times
User avatar
Cherno
Posts: 1309
Joined: Tue Dec 06, 2016 11:25 am

Re: Rendering HUD weapons

Post by Cherno »

Reactivating this thread since I'd like to expand my knowledge of rendering hud sprites. The one thing I still havent't mastered is how to set up lighting in 3D Studio Max. I use the Scanline renderer and so far use just a simple directional light to simualte sunlight coming from above at an angle, which is ok but creates stark shadows. I'd like to use some kind of simulated daylight setup that softens the shadows and maybe scatters the lighting a bit.
User avatar
Pixel Eater
 
 
Posts: 667
Joined: Wed Aug 02, 2017 12:31 am
Location: In between the Moon and you, between the buried and me.

Re: Rendering HUD weapons

Post by Pixel Eater »

I saw this blender tutorial the other day on the three point lighting system. It looks to be the de facto setup even for studio lighting.

Post Reply

Return to “Assets (and other stuff)”