Page 1 of 1

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

Posted: Sat May 02, 2020 5:12 pm
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

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

Posted: Sat May 02, 2020 7:19 pm
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.

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

Posted: Sat May 02, 2020 8:55 pm
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.

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

Posted: Sat May 02, 2020 10:34 pm
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).

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

Posted: Sun May 03, 2020 9:42 am
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...

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

Posted: Sun May 03, 2020 3:17 pm
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

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

Posted: Sun May 03, 2020 5:25 pm
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?

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

Posted: Sun May 03, 2020 7:16 pm
by Cherno
Yes.

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

Posted: Tue May 05, 2020 10:13 am
by Snarboo
Awesome, thanks! :D