PrismaticFlower / shaderpatch

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

basic_unlit with RGBA vertex colors is bugged #102

Open DoctorAnsem opened 5 years ago

DoctorAnsem commented 5 years ago

Tested a space skydome just now, but there are problems. Firstly some polygons of the skydome models are discarded, filled with black. Second, where the vertex alpha is used, it doesn't appear to blend correctly; there are still hard edges even though there is some transparency. Third, I can't screenshot exactly what I mean because when I look downward at the planet too much, the game consistently crashes with the "application stopped working" message.

PrismaticFlower commented 4 years ago

I wasn't able to recreate the first and third issues myself. But I was able replicate the transparency issue (or at least some type of it), the cause as it turns out I had left out the correct Flags from the .mtrl file.

This is what made me decide to deprecate the Flags section outright, if I could forget to do it then I'm sure others can to and the information the Flags section provides is already probably been setup in the .msh file which means it'll already be there in the .model file. So there is even really no point in making people repeat themselves.

Anyone should feel free to let me know however if they have an issue with transparency and basic_unlit materials still though. Could be what I reproduced and what is actually happening here are two separate things. Anyone should also feel free to get in touch if they feel deprecating the Flags was a mistake.

DoctorAnsem commented 4 years ago

Actually, I've always had the full set of material flags defined in each and every material file so it's not that I forgot, in fact, I fiddled around with them several ways but it's always the same result. Fortunately this time I was able to catch a few screenshots before the game crashed. It turns out, I think, that the first and second problems here are one and the same - the missing polygons aren't actually missing, they've got vertex colors and they vanished because something bad happens to the color smoothing when the basic_unlit material is patched in. In essence, instead of colors smoothly fading into each other, they become hard edges.

2020-02-02 15_24_36 2020-02-02 15_24_44 2020-02-02 15_24_53

But then there's the game crashing part. I don't understand why or how that is a thing, and it feels like it consistently happens when the camera is facing down at the planet there. I've actually had this happen a few times before with other materials, but they always fixed themselves after a clean munge. Not this time though.

PrismaticFlower commented 4 years ago

I see what you're talking about, that's pretty bad and the crash obviously is even worse. I may need to bother you again for a copy of the problematic files to track down what's going on.

DoctorAnsem commented 4 years ago

Do you mean munged or source files?

PrismaticFlower commented 4 years ago

Either, whatever is easiest for you will be fine.

DoctorAnsem commented 4 years ago

Source it shall be, then.

spa5_skyfiles.zip