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

Far Scene water is drawn behind everything but the sky when HDR rendering is being used #104

Open DoctorAnsem opened 4 years ago

DoctorAnsem commented 4 years ago

Doesn't need much explanation, but I'll mention this was with HDR enabled - not sure if the same happens without.

2020-02-03 16_39_39

By the way, what was the verdict for PBR and stock alpha? I'm still seeing sky objects abruptly pop in and out instead of fading.

PrismaticFlower commented 4 years ago

Darn, that's quite bad. I'm having a hard time reproducing it though. Does this happen on all maps for you?

By the way, what was the verdict for PBR and stock alpha? I'm still seeing sky objects abruptly pop in and out instead of fading.

It sounds familiar but I've completely forgot about it to be honest. (That's on me probably, I need to get better at organization.) Do PBR materials in the far scene and near scene not transition properly?

DoctorAnsem commented 4 years ago

Yeah it's affecting all the maps that I've gone through so far.

Do PBR materials in the far scene and near scene not transition properly?

That's not it, I'm talking about the transparency transitions where models are supposed to fade in and out of existence at the start and end of their lifetime. At the moment PBR materials are ignoring the fade and they just pop in and out in a frame's time. To be honest, I believe sky objects use lod0 for all scene ranges so there's no visible problem there, but now that you mention it, the scene transitions could have the same issue. Never caught my eye though.

DoctorAnsem commented 4 years ago

There's a bigger problem here than originally anticipated... I'm having maps with water crashing left and right and there's no way to tell what's happening - I know it's a Shader Patch thing, maybe HDR specific but that's all I've put together so far. It's not consistent either. In some cases the crashing I was able to resolve by setting near scene range stupidly low, which is not a good permanent solution, of course. Still, it seems the root of the cause is when there's a lot of water on a map. With Shader Patch disabled there was no problem at all.

And I don't understand why it started happening now of all times, either - it didn't happen before I stopped using the material flags for these maps but that seems like a ridiculous stretch. Surely that can't be it?

PrismaticFlower commented 4 years ago

I'm honestly not entirely sure what could be going on. But what I'm going to do when I get the chance is go through the code base as best I can and try add better handling and logging around anything that looks like it could be causing a crash. Hopefully that could help track down what's going wrong here and other places.

I'll also try putting a whole bunch of water in my test map and see if I can get a crash as well.

DoctorAnsem commented 4 years ago

Well we can rule out water as the cause of this latest problem. Did a test with water disabled for this map and it still crashed - it looks to be like there's some material issues at play here that weren't a problem when I was using the flags section. I imagine I'll have to make some more shots in the dark to figure this out.

DoctorAnsem commented 3 years ago

2021-01-24 00_57_02

Have a look at this. It's a one in a million chance that I happened to stumble across this, but it instantly rang a bell and I think this is what's happening with the far scene water - looks like the problem is not that it isn't being drawn, but it's being sorted behind everything, both objects and terrain, so vanishes as soon as it's out of near scene range.