ioquake / ioq3

The ioquake3 community effort to continue supporting/developing id's Quake III Arena
https://ioquake3.org/
GNU General Public License v2.0
2.37k stars 527 forks source link

normal/specular maps broken with latest opengl2 renderer #369

Open AndehX opened 6 years ago

AndehX commented 6 years ago

Quick rundown of a few things I’ve noticed are messed up:

When r_ForceSun is enabled, real time model shadows are shown. This causes the players shadow to render over the 1st person weapon models, thus completely hiding the specular maps. Standing in “sunlight” and looking directly up moves the shadow away and shows the specular maps again.

Specular maps don’t seem to show any shininess anymore, unless you're looking directly up at the "sun". Not much more I can say on that. Rolling back to an earlier OpenGL2 build from 2015, instantly correct this issue. See pics below.

I've tried all sorts of different mtr entries and values, but nothing seems to have any kind of positive effect. I have no coding experience, so I wouldn't know how to go about fixing this, but even if we could roll back to the old method of rendering normal/spec maps, that would be fine imo.

Latest opengl2 renderer: new

Older (2015) opengl2 renderer: old

SmileTheory commented 6 years ago

So I think I've figured it out, it turns out people would rather have the fake specular reflections from the deluxe map/lightgrid (removed in https://github.com/ioquake/ioq3/commit/e5aabdaff61421fce608099c9c9b80d67a3d627a ) than the cubemap reflections.

I'll figure out a fix.

AndehX commented 6 years ago

Ok well im not sure what that means exactly... All I know is that it looked alot better before the change, than it does now. Of course, if there is a new/different method of accomplishing the same look in the newest version of the renderer, by all means enlighten me, as im stumped :P

megatog615 commented 6 years ago

The short explanation is the lighting you think is broken is actually cubemap reflections rather than specular brightness. Cubemap reflections are more accurate.

AndehX commented 6 years ago

I see. Well it may be technically be more accurate, but damn, it looks like ass lol. Is it possible to disable it then? I mean I've tried disabling cube mapping but it looks no different.

ghost commented 6 years ago

@megatog615 I don't think AndehX only 'thinks' the lighting is broken, because the current specular stage really looks ugly, and to me there is not really an effect I would call 'specular', it looks more than some pixels (the inverted ones from alpha channel) are barely brighter than the rest of the texture.

@SmileTheory Probably AndehX and I did something completely wrong (I tried the shader he is using), but I can't see any chance to get good results. So assuming AndehX and I missed something, and cubemap reflections are more accurate, how to 'enable' them. If the cubemap reflections are 'better' than it is very likely people will use them, but how should they like to use them, when they don't know how? So can you please explain 'step-by-step' what conditions are necessary to make cubemap reflections work? Does/should r_cubemapping disabling the existing specular shader stages? Some technical explanations really would help!

AndehX commented 6 years ago

Right, so I did some testing with the update that SmileTheory submitted a few hours ago. r_deluxespecular definitely makes a positive difference, better than before, although now it makes textures look more like glossy plastic, than shiny metal like in the old renderer. Here are some images to show the difference:

This is the updated version with r_deluxespecular at 0.3 and r_cubemapping disabled: new

Old renderer old

modifying my textures a bit, I can see the new effect of cubemapping, it's definitely different and probably more "accurate" but it still makes metals look more like smooth plastic.

AndehX commented 6 years ago

r_cubemapping 1: cubemapping

Looks like plastic.

What would be awesome, would be a mtr entry that lets you choose between old specular maps and cubemapping. Would that be possible?

AndehX commented 6 years ago

Right, I had a chance to test a map that properly utilises cubemapping and I must say, it does look impressive. The problem though, is that those specular reflections feel out of place if the game is not built around them (which vanilla Quake 3 isnt) and thus they don't translate very well in maps that do not directly support the feature. Having this kind of cubemapping and specular in Quake 3 is awesome, but I think it's more of niche feature since there are pretty much no maps that support it. With that said, I think it's great to keep the feature in the engine, for people like myself, who would like to build maps using it, but I also think its a good idea to have it ONLY affect maps that use normal/specular textures, because trying to play vanilla maps with cubemapping enabled... is painful to say the least.

megatog615 commented 6 years ago

I think that for the best, in the case of old maps, they should look at least what they're supposed to look like in the retail release. As for modified content, I recommend you adjust the materials to better suit the cubemapping scheme. What mod are you using to have the higher-res textures like that? If it's your in-house mod I'd like to help you out in that department.

AndehX commented 6 years ago

Yeah I actually don't mind using cubemapping and adjusting my content to better work with it. I first need it to not affect the original maps though, otherwise it's pointless having it turned on. As for the textures im using, I assume you mean the weapons. They are the touched up versions of the original weapons from Quake Arena Arcade, I use them for myself personally.