[Models | Solved] Are view models supposed to be fullbright?

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
Snarboo
Posts: 2599
Joined: Tue Nov 29, 2005 4:37 am

[Models | Solved] Are view models supposed to be fullbright?

Post by Snarboo »

TL;DR Setting the light rendering mode to "Vanilla" in hardware settings affects how view and world models are lit.

So I've been investigating view models as an alternative to first person weapon sprites. I've found a workflow from Blender -> GZDoom that works, and everything looks good. Except for one little problem...

(Pictured: A dark room, a very bright gun)

It appears as though view models are rendered full bright, except when they aren't:


(Slightly better!)

World models render just fine:


I thought I was doing something wrong. However, this issue also appears in other mods with 3D view models, such as the Extra Heroes mod for Samsara:

(Quake 2 edition)

I cannot tell if this is user error, an actual bug, or a limitation of the engine. I am using a few visual mods, such as NightFright's Brightmaps mod, but none of the effected models have brightmaps associated with their textures, nor do their frames have BRIGHT attached to them. I also understand that GZDoom handles view models and HUD sprites differently than "world" objects. However, this doesn't seem like intended behavior.

I'm posting this here, since it is an asset issue, and I'm curious if anyone else knows of a solution to this. I'm including a slimmed down version of a model test mod I've been working on to sort out my workflow: modeltest2.pk3
Last edited by Snarboo on Sun May 03, 2020 10:51 am, edited 2 times in total.
User avatar
Cherno
Posts: 1337
Joined: Tue Dec 06, 2016 11:25 am

Re: [Models] Are view models supposed to be fullbright?

Post by Cherno »

No, models behave exactly as sprites do as far as sector lighting is concerned. That being said, the model on the first screenshot you posted actually looks like it should without any shaders; models are lit by sector lighting as a whole, without regard for normals, so texture pixels or the same color will always look the same on the whole model, no matter where they are (and which direction their normal is facing). The model still seems too bright overall considering the sector brightness but that may or may be another issue. The hud model in screenshot 2 and the UAC box would only look like this (with the differently shaded faces) if they use a vertex shader, there is a dynamic light near them, or if they are textured like this.
User avatar
Snarboo
Posts: 2599
Joined: Tue Nov 29, 2005 4:37 am

Re: [Models] Are view models supposed to be fullbright?

Post by Snarboo »

Cherno wrote:The model still seems too bright overall considering the sector brightness but that may or may be another issue.
The model's texture might be too bright, then. It was something I whipped together in an hour just to see if my UV unwrap worked. The view model is also placed close to the camera's clipping plane, or at least it is in Blender. The offsets are almost 1-to-1 between Blender and GZDoom, so I'm not sure if I want to mess with the model's position too much after getting it just right, though. :p

Edit:
Cherno wrote:The hud model in screenshot 2 and the UAC box would only look like this (with the differently shaded faces) if they use a vertex shader, there is a dynamic light near them, or if they are textured like this.
The weird thing is that the gun model has shading when I look down, as though it's receiving some kind of light even when it's only being illuminated by the sector's lighting. The crate also looks like that out of the box without any shaders. I'm not running any dynamic light mods either, at least not since I last setup my autoload.
User avatar
Nash
 
 
Posts: 17487
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia
Contact:

Re: [Models] Are view models supposed to be fullbright?

Post by Nash »

Are you using the "vanilla" light mode by any chance? There's some shader stuff going on that's exclusive to that mode that changes a surface's lighting (regardless of whether it's a model, or the map itself*) depending on the view angle.

If you are, you can confirm this by choosing another light mode - the model will revert to truly flat lighting. :)

* In hardware rendering, the behaviour of surfaces are unified because everything that's 3D use the same main shader. So if you seem something happening to the walls and floors, it will also happen to models (both in-world and in weapon-space).
User avatar
Snarboo
Posts: 2599
Joined: Tue Nov 29, 2005 4:37 am

Re: [Models] Are view models supposed to be fullbright?

Post by Snarboo »

Nash wrote:Are you using the "vanilla" light mode by any chance?
Turns out I am! :D Setting it to anything but Vanilla or Doom renders the model according to sector lighting. Kind of a bummer, since I love the look of the vanilla lighting mode, especially now that I know it renders world models with better lighting. I wonder if there's a solution that allows view models to be rendered "flatter," or with their own lighting? I unfortunately know nothing about shaders...
User avatar
Cherno
Posts: 1337
Joined: Tue Dec 06, 2016 11:25 am

Re: [Models] Are view models supposed to be fullbright?

Post by Cherno »

Snarboo wrote:
Nash wrote:Are you using the "vanilla" light mode by any chance?
Turns out I am! :D Setting it to anything but Vanilla or Doom renders the model according to sector lighting. Kind of a bummer, since I love the look of the vanilla lighting mode, especially now that I know it renders world models with better lighting. I wonder if there's a solution that allows view models to be rendered "flatter," or with their own lighting? I unfortunately know nothing about shaders...
SimSun Shader - Simulated directional light for models
User avatar
Snarboo
Posts: 2599
Joined: Tue Nov 29, 2005 4:37 am

Re: [Models | Solved] Are view models supposed to be fullbri

Post by Snarboo »

Hey, that does improve the appearance, even using Vanilla shading! :D Would it be okay to include this in a project, if credit is given?
User avatar
Cherno
Posts: 1337
Joined: Tue Dec 06, 2016 11:25 am

Re: [Models | Solved] Are view models supposed to be fullbri

Post by Cherno »

Yes.
User avatar
Snarboo
Posts: 2599
Joined: Tue Nov 29, 2005 4:37 am

Re: [Models | Solved] Are view models supposed to be fullbri

Post by Snarboo »

Awesome, thanks! :D
Post Reply

Return to “Assets (and other stuff)”