PrismaticFlower / shaderpatch

Improved shaders (and fun stuff for modders) for Star Wars Battlefront II (2005) - Incompatible with Classic Collection
MIT License
39 stars 2 forks source link

normal_ext base material gets wrong lighting #57

Closed DoctorAnsem closed 5 years ago

DoctorAnsem commented 5 years ago

2019-04-05 19_14_04

I did remark on this before that normal_ext materials were somewhat dark but only now it occurred to me that there is a mismatch with how the material gets lit. From the looks of it, I want to say it's not receiving all the lights, I think. In the screenshot there is a normal_ext.specular material to contrast it, as the specular extension does get lit as it should as far as diffuse is concerned.

However, I need to question the specular reflection itself here; it's rather limited to one face of the pillar as if it was being calculated per vertex. The stock specular interacts with the polygons much better, I want to say per pixel but my terminology might be misled here. But then, this could also be related to #55 because I am seeing a lot of polygon seams bleeding in this map and they sometimes bleed through a color so bright that it spikes the bloom. It's hard to tell what's going on at this point.

PrismaticFlower commented 5 years ago

Just so I have a better grasp on what's going on, does this happen with normal_ext.specular.dynamic as the rendertype?

DoctorAnsem commented 5 years ago

I'm not sure which one you mean? Also I'll take back that second point about the specular, it's the same as the stock specular so it's just what it is. I think the geometry itself would need to be redone better for the specular effect to look more natural.

But no, the color issue doesn't happen on any kind of specular extensions whatsoever. The specular mapped materials are correct, it's the regular normal_ext materials that have gone daffy. I did check if it might be because the normal maps between these materials use a different compression, but it doesn't seem to be the case.

PrismaticFlower commented 5 years ago

Sorry, I was being hasty earlier and I think I misread what you were saying. (I thought the issue may have been to do with the normal mapping, but I realize now I was way off.)

Okay so the problem actually is (as opposed to whatever nonsense I was thinking it was) that normal_ext materials without specular lighting are darker than they should be yeah?

After checking out the responsible shader it looks like the diffuse texture is getting multiplied over the ambient and static lighting twice. Which in some cases will significantly decrease the amount brightness of the "reflected" light. It'll be an easy fix.

Do you think this could explain the problems you've been seeing?

DoctorAnsem commented 5 years ago

Yeah that sounds like the root of it.