sixthsurge / photon

A gameplay-focused shader pack for Minecraft
MIT License
998 stars 192 forks source link

Transition from rough to smooth seems harsh #72

Closed andrwcrr closed 5 months ago

andrwcrr commented 10 months ago

What happened?

There is a clear and harsh change from a rough surface transitioning to a smooth surface with Specular Mapping and a PBR resource pack enabled. Expected results are a much smoother transition between rough and smooth. Here is an example of VNR's gold and lapis blocks: image

Minecraft Version

1.20.1

Which shader mod are you using?

Iris

Shader mod version

1.6.10

Shader settings

#Mon Nov 06 19:54:08 AST 2023
SPECULAR_MAPPING=true

Relevant log output

No response

Patomosm commented 10 months ago

Can be a peculiarity of the texture pack. Photon has LabPBR (old and new) support, not autogenerated PBR ones, like Complementary Shader has. My texture pack is not affected. What's your? Base Profile Screenshot 2023 11 07 - 20 07 59 25

andrwcrr commented 10 months ago

The resource pack I'm using is VNR. What's the name of your resource pack and where can I get it?

Patomosm commented 10 months ago

Here it is! The description says: "... based on vanilla but with normals and proper glossiness information." The previews below the description show reflections like yours, so it's just the feature of the texture-pack, not an issue.

My pack is Here

andrwcrr commented 10 months ago

Can you recommend a free resource pack that does not have this issue?

Patomosm commented 10 months ago

https://modrinth.com/resourcepack/patrix-32x/changelog?g=1.20.1

andrwcrr commented 10 months ago

It does indeed happen with Patrix, see the 9th row of pixels from the bottom on the face of the iron block thats is facing to the right, it is just less noticeable owing to the fact that it is a higher resolution pack:

image

Heres what it looks like with Bliss:

image

Here's also some random reflective pixels on some wood planks:

image

Patomosm commented 10 months ago

It's not the same reflection appearance. I noticed that you are missing somo mods to complete some effects like continued grass. This list for 1.20.2 version will help you: image

andrwcrr commented 10 months ago

Those mods would not have any effect on the specular textures of the blocks we looked at, however I added them anyways. Here is a video showcasing the same 9th row of pixels from the bottom reflecting no light whereas the adjacent pixels do reflect light, this suggests there is some sort of cutoff value where a pixel does not reflect light in photon, which shouldn't be, it should gradually decrease. I then switch to Bliss and I show that the same row of pixels do indeed reflect (less but still some) light as they should:

https://github.com/sixthsurge/photon/assets/128940455/8e49d6e6-c6a3-4eca-92fe-4bac45e03c0b

Patomosm commented 10 months ago

A LabPBR texture pack consists of 3 images for the same texture: 1) the base image, 2) the bump-map image, and 3) the image for the lighting and reflection effects. In the case of the iron block, the base image represents a sheet metal with darker areas of rust, which do not reflect light in the same way as shiny light iron does; In addition, the horizontal dark lines are located right in the shadow position of the simulated bend of the sheet metal, so there is nothing weird about it.

The comparison below shows how two different shaders calculate the interaction of texture images: Photon on the left is more effective with highlights and reflections (flattening reliefs), while Bliss on the right is more effective with bump-maps (blurring reflections).

Comparazione

I reiterate that all this is not an issue, but only programming choices.

Patomosm commented 10 months ago

Again: Photon is more effective with lights and reflections. Do you understand where the soul-torch is?

Screenshot 2023-11-08 170833

andrwcrr commented 10 months ago

Can you name a shader with similar "programming choices" to photon to see if this is the case on that shader too?

Patomosm commented 10 months ago

No, because Photon is unique in its programming choices. That's why it's my favorite. Photon mimics path-traced shaders but without a heavy performance cost.

andrwcrr commented 10 months ago

Well they weren't the best "programming choices" in my humble opinion which is why I opened an issue. I am however glad that you agree that this is to to with the shader and not the resource pack.

Patomosm commented 10 months ago

No, you didn't understand me. I've explained why the effect is more noticeable with photon rather than with other shaders, not that photon is the only one responsible.

andrwcrr commented 10 months ago

So this effect has to do with the shader right? And not the resource pack like you initially claimed?

Patomosm commented 10 months ago

Look at this image: PURE VANILLA, PHOTON and NO ISSUE... understood?

Base Profile Screenshot 2023 11 08 - 16 24 41 34

Please don't troll in this chat.

andrwcrr commented 10 months ago

I am not trying to troll, this is a genuine concern I have, I am happy to agree to disagree if we cannot come to a conclusion. Also I don't see any reflections at all in that image so I'm assuming that isn't the default settings for photon because photon has hardcoded speculars enabled by default correct?

Patomosm commented 10 months ago

A LabPBR texture pack consists of 3 images for the same texture: 1) the base image, 2) the bump-map image, and 3) the image for the lighting and reflection effects. In the case of the iron block, the base image represents a sheet metal with darker areas of rust, which do not reflect light in the same way as shiny light iron does; In addition, the horizontal dark lines are located right in the shadow position of the simulated bend of the sheet metal, so there is nothing weird about it.

The comparison below shows how two different shaders calculate the interaction of texture images: Photon on the left is more effective with highlights and reflections (flattening reliefs), while Bliss on the right is more effective with bump-maps (blurring reflections).

Comparazione

I reiterate that all this is not an issue, but only programming choices.

Do you really read at that post of mine? Reflections depend on the presence of extra textures within a package, not just the shader's ability to read them! Flat Vanilla textures doesn't have LabPBR features, so ANY SHADER won't be able to show reflections on it! Again: it is not a bug! It is not an issue!

tsumi7 commented 10 months ago

Yes, it's a bug related to the shader, the transition from rough/smooth can be improved.

@Patomosm Photon has builtin pbr properties for certain blocks even if there is no pbr resource pack installed. Reset your shader settings, remove all resource packs and place a gold block to see this easily.

Patomosm commented 10 months ago

There are shaders that have a feature called "Autogen. PBR" or "Integrated PBR" that creates generic reflections, such as Complementary Shader. Photon has "LabPBR" mode or "SeusPBRmode".

andrwcrr commented 10 months ago

I rest my case. Thanks tsumi

tsumi7 commented 10 months ago

Current Behavior:

https://github.com/sixthsurge/photon/assets/90137856/ddf1d43a-452b-4ff4-b63f-8bd448cb6850

Proposed fix (WIP):

https://github.com/sixthsurge/photon/assets/90137856/ed7f47b7-0f30-452c-b5f3-d7f33afdc00f

Patomosm commented 10 months ago

You are playing with a custom texture-pack, not with original Vanilla. I'm very sure because I tried Vanilla with all reflection options enabled in photon. And that is the prove I'm right: Base Profile Screenshot 2023 11 08 - 20 01 39 65

Patomosm commented 10 months ago

Ok, I'm a fairplay man and I wanted to try to reset Photon and... Yes, reflections appeared on the metal blocks in Flat Vanilla mode. So, sorry... We agree except for one thing: the problem isn't a bug if you consider a custom package, but it's an oddity if you play with the original Vanilla. That's my final opinion. Thank you for your contributions.

Patomosm commented 10 months ago

Try this: enable all "reflection" in "materials" section. disable "roughness Support" in "Reflections" subsection.

andrwcrr commented 10 months ago

If roughness support is disabled then what's the point of this issue? I want to use roughness without it transitioning harshly to smoothness, rather than not enabling roughness at all.

Patomosm commented 10 months ago

Try my options and let me know. Roughness support is enabled. Remember my explication about LabPBR... the third image type of a texture is the key to set roughness, reflections and emitting parts. Therefore, the custom package has the first weight to the issue. There isn't a general fix for this on shader programming, I think.

photon-main.zip.txt

Patomosm commented 10 months ago

The transition from rough to smooth can be reduced as the texture resolution increases. With smaller pixels, the gradation will be almost invisible. My advice is to try a texture pack that is 128x or higher, at the cost of performance.

Patomosm commented 10 months ago

Look at this picture below. The armors have higher resolution than previously metallic blocks and have no rusty effects. Do you see any related issue? Let me know what you dislike.

Base Profile Screenshot 2023 11 08 - 21 44 32 86

Patomosm commented 10 months ago

I finally found the option that is causing the problem: "Specular Mapping". Maybe it can't handle textures with indexed colors, that's my theory.

Senzanome

Patomosm commented 10 months ago

Calcite material made by me. At the right side, with "Specular Mapping" on, you can bare distinguish reflective pixels. In the screenshot before, copper rusty pixels have completely no reflective green channel, appearing very scratched.

image

sixthsurge commented 5 months ago

fixed