ComplementaryDevelopment / ComplementaryReimagined

Complementary is a graphical rework pack for Minecraft with exceptional quality, detail, and performance.
https://www.complementary.dev/shaders/
Other
185 stars 53 forks source link

Fully transparent pixels shouldn't be emissive #24

Closed Traister101 closed 1 year ago

Traister101 commented 1 year ago

Edited it locally and copied the change over, it worked fine in game but I've never worked with shaders before so just in case thoroughly review my 7 line PR lol. Do not wanna be the dingus that manages to screw up something this small.

EminGT commented 1 year ago

There are two problems with this pull request. 1) The old code already works fine, as specularMap.a is always between 0 and 1. The "255" value you are talking about is represented as "1" in specularMap.a. The behaviour have been tested by many people including labPBR RP developers. 2) The new code just breaks emission completely as the if check is checking for an impossible situation. A value can't be less than 1 and bigger than 255 at the same time.

Traister101 commented 1 year ago

Hey, yeah I did totally screw that up. I against better judgement fired off the pr right before bed and missed that while I fixed the weird issue I was having I did that by breaking emissives altogether. I'll look into this more and hopefully come back with something that actually works because I'm quite sure there is some sort of problem present with the speculars and transparency. I'm having specular maps that are incorrectly emissive. These speculars work perfectly fine with other shaders most notably Complementary v4 which I've been using up till yesterday.

Might just be best for me to make an issue and let somebody who knows their way around shaders figure it out instead of trying to figure it out myself but in short opaque pixles in the specular map are sometimes emissive such as in the attached image. Turing off the emissives prevents this as does making the texture entirely opaque (which screws up other stuff) hence my high quality pr. Apologies 2023-05-31_03 33 48 If I make an issue I'll also provide a minimal reproducible RP don't worry really not proud of this pr...