Ability to exclude a specific model from AO

Remember, just because you request it, that doesn't mean you'll get it.

Moderator: GZDoom Developers

Ability to exclude a specific model from AO

Postby Enjay » Sat Jul 25, 2020 8:15 am

Would it be possible to add a flag to MODELDEF to exclude the model being defined from having ambient occlusion applied to it?

The reason I ask is that I have come across a couple of models where AO doesn't look good - and this is exacerbated if the model animates because the AO can flicker and change as the model moves - but a player might want AO to be on for most of their game.

For example, I have just been working on a model of a radar dish and as it pans left and right, the AO on its surfaces changes in a way that doesn't look good. If I switch off AO for the whole game, the model looks fine. The radar dish doesn't move around the map (pretty obviously), it just sits in place and pans left/right. So it's easy to set up the model to look good with respects to nearby lighting etc but the changing AO during animation doesn't look great.

I imagine that this suggestion would be useful for excluding specific models from AO (and where the model skin would have suitable shadows backed on to it anyway) for cases specifically like a large, mostly static, decoration of some sort - like the radar dish mentioned above.

I don't know if such a thing is even possible, but if it is, it would be nice to have. Thanks.
User avatar
Enjay
Everyone is a moon, and has a dark side which he never shows to anybody. Twain
 
 
 
Joined: 15 Jul 2003
Location: Scotland

Re: Ability to exclude a specific model from AO

Postby Nash » Sun Jul 26, 2020 1:31 am

Instead of MODELDEFS however, I think it should be done at the texture level, because there are also situations where one might intentionally not want SSAO on certain kinds of level surfaces (like sectors meant to be light emitters or whatever).

Doing it on a texture basis would easily allow you to exempt certain model textures from receiving SSAO.

Alternatively, SSAO should take into account the brightmap to determine if it should be shaded or not.
User avatar
Nash
 
 
 
Joined: 27 Oct 2003
Location: Kuala Lumpur, Malaysia
Github ID: nashmuhandes

Re: Ability to exclude a specific model from AO

Postby dpJudas » Sun Jul 26, 2020 4:53 am

This unfortunately not possible. SSAO works by looking at the depth buffer and the model has to be written into it. Thus the SSAO pass loses the ability to see what is behind the model it should be ignoring.
dpJudas
 
 
 
Joined: 28 May 2016

Re: Ability to exclude a specific model from AO

Postby Graf Zahl » Sun Jul 26, 2020 5:01 am

Would this be solvable by having another buffer that works like a stencil for the SSAO pass?
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: Ability to exclude a specific model from AO

Postby dpJudas » Sun Jul 26, 2020 5:24 am

I suppose technically the main shader could write null normals into the normal gbuffer. The ssao pass already checks for that as its way to avoid shading portal entrances. It removes partly the artifact Enjay is talking about, but still leaves one as things near the ignored objects may appear brighter than they otherwise would have.
dpJudas
 
 
 
Joined: 28 May 2016

Re: Ability to exclude a specific model from AO

Postby Enjay » Sun Jul 26, 2020 6:10 am

Given that I was imagining this being used on a case-by-case basis for specific actors where no AO was preferable, then exactly how and where the model would be used would be part of the modders consideration on whether to disable AO for it or not. So that needn't necessarily be a problem. i.e. the modder could evaluate whether AO or no AO worked better for the particular circumstances where it was being considered.


Nash's point about textures is also something that would be interesting to look at - but I suspect it could be even more than that. For example, if I make a small recess in a wall with, say, LITE3 on the back wall and light it with light value 255, I would expect the LITE texture to look nice and bright, and indeed, all of the surfaces inside the recess to look bright. I literally cannot make it any brighter within normal Doom parameters. However, AO can make the texture looks far darker than intended - almost as if I had intended the lights to look like they were not on at all.
Spoiler:

I've tried using brightmaps and wall-specific brightness, but not come up with something that really helps.

I suspect that this is a different thing to what this particular feature suggestion is about though and, again, I have no idea how possible addressing this in some practical way would be.
User avatar
Enjay
Everyone is a moon, and has a dark side which he never shows to anybody. Twain
 
 
 
Joined: 15 Jul 2003
Location: Scotland

Re: Ability to exclude a specific model from AO

Postby Graf Zahl » Sun Jul 26, 2020 2:29 pm

You posted some good reasons why I do not use SSAO - I find the entire feature way too rough because it cannot interpret what a texture is supposed to represent.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: Ability to exclude a specific model from AO

Postby Enjay » Sun Jul 26, 2020 3:52 pm

Generally, I personally quite like it - so I prefer it on rather than off but it certainly isn't perfect. Being able to exclude specific textures from it (either at a texture definition level somehow, or on a mapping line-by-line (and ceiling/floor) basis) would address the most common issues that I have with it. Again, I have no idea how possible that would be.
User avatar
Enjay
Everyone is a moon, and has a dark side which he never shows to anybody. Twain
 
 
 
Joined: 15 Jul 2003
Location: Scotland

Re: Ability to exclude a specific model from AO

Postby phantombeta » Sun Jul 26, 2020 4:57 pm

I imagine this can be done based on emissive maps. (i.e., what we have as brightmaps) It could probably also be done with some kind of material map that controls how much AO is allowed in that part of the texture.
Of course, this is usually not really a problem when the SSAO is applied properly (i.e., only applied to the ambient component of the light), but Doom maps generally mostly use ambient sector lighting, so that won't help here.
User avatar
phantombeta
In the meadow of sinful thoughts, every flower's a perfect one
 
Joined: 02 May 2013
Location: Brazil, South America, Earth, Orion-Cygnus Arm, Milky Way
Discord: phantombeta#2461
Twitch ID: phantombeta_
Github ID: Doom2fan
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia with Vulkan support

Re: Ability to exclude a specific model from AO

Postby axredneck » Wed Jul 29, 2020 2:56 pm

Good idea. SSAO doesn't work properly for voxels anyway (because they have no normals, right?)
User avatar
axredneck
excuse me for my bad English
 
Joined: 11 Dec 2017
Location: Russia
Github ID: axredneck
Operating System: Other Linux 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia with Vulkan support


Return to Feature Suggestions

Who is online

Users browsing this forum: No registered users and 0 guests