[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.

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

Postby Snarboo » Sat May 02, 2020 5:12 pm

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
Snarboo
Bacon doesn't know it's not dogs
 
Joined: 29 Nov 2005

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

Postby Cherno » Sat May 02, 2020 7:19 pm

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
Cherno
 
Joined: 06 Dec 2016

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

Postby Snarboo » Sat May 02, 2020 8:55 pm

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
Snarboo
Bacon doesn't know it's not dogs
 
Joined: 29 Nov 2005

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

Postby Nash » Sat May 02, 2020 10:34 pm

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
Nash
Twitter/Facebook/Youtube: nashmuhandes
 
 
 
Joined: 27 Oct 2003
Location: Kuala Lumpur, Malaysia
Twitch ID: nashmuhandes
Github ID: nashmuhandes

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

Postby Snarboo » Sun May 03, 2020 9:42 am

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
Snarboo
Bacon doesn't know it's not dogs
 
Joined: 29 Nov 2005

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

Postby Cherno » Sun May 03, 2020 3:17 pm

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
Cherno
 
Joined: 06 Dec 2016

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

Postby Snarboo » Sun May 03, 2020 5:25 pm

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
Snarboo
Bacon doesn't know it's not dogs
 
Joined: 29 Nov 2005

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

Postby Cherno » Sun May 03, 2020 7:16 pm

Yes.
User avatar
Cherno
 
Joined: 06 Dec 2016

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

Postby Snarboo » Tue May 05, 2020 10:13 am

Awesome, thanks! :D
User avatar
Snarboo
Bacon doesn't know it's not dogs
 
Joined: 29 Nov 2005


Return to Assets (and other stuff)

Who is online

Users browsing this forum: No registered users and 1 guest