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

Spot lights may not be working with custom materials #113

Open DoctorAnsem opened 4 years ago

DoctorAnsem commented 4 years ago

Spot lights are not casting anything on materials, I think. Neither specular nor diffuse. The reason I think so being that in the same map, I still had a few stock materials which were receiving the light as should be.

In addition, PBR materials don't appear to receive "diffuse" lighting from omni lights. If that makes sense. Admittedly I'm not entirely up to speed if PBR actually differentiates between diffuse and reflection in the same manner, but I figured it might seeing as I've read metallicness is basically reflection only, with the diffusion completely negated.

PrismaticFlower commented 4 years ago

I think they (both point and spot lights) should be (though I will try and test to be sure), the fall off (which is different to the one used for non-PBR materials) might be making them very weak though.

This might another "pending baked GI and proper HDR lighting" issue as well.

DoctorAnsem commented 4 years ago

Yeah fair enough.

As a side note, do you plan on adding envmap support for PBR? I've been thinking about this a lot and I feel like it could help a lot with the general outlook of things and potentially even provide options for some patchwork solutions on a modder's behalf if need be, but I don't actually remember seeing any note about it being planned/scrapped/anything?

PrismaticFlower commented 4 years ago

Yes, for once I have a tool able to do it I expect bake a whole bunch of reflection probes ahead of time. And I've thought about adding an Image Based Lighting rendertype for PBR so that users could specify one as a stopgap measure in the meantime.

The primary reason why this has never happened yet is that you need to do a whole bunch of processing over the input environment map in order for it to be usable and give correct results in PBR. This only problematic in that I've never been sure how best to integrate it into sp_texture_munge's processing pipeline (which delegates most of it's work to external libraries).

We'll see though, I've been working on random little things for v1.4 so it could be IBL ends up finding it's way there.