sp614x / optifine

1.79k stars 418 forks source link

Shaders/CTM - Displacement maps edges between CTM textures #750

Open OriAlon opened 7 years ago

OriAlon commented 7 years ago

the same kind of edges that appear between different blocks with Displacement maps also happen between textures of the same CTM rule

sp614x commented 7 years ago

Example screenshot?

OriAlon commented 7 years ago

sp614x commented 7 years ago

The problem is that the shader pack wraps around the normal texture UV so the other side of the same texture is being used for the transition. This usually works for non-CTM textures as they are symmetrical left-right and up-down. The CTM textures are not always symmetrical and then sampling the other side of the texture causes visual artifacts.

sp614x commented 7 years ago

Currently most shaders use REPEAT mode which works for seamless textures with symmetrical sides. For non-symmetrical textures the shaders could use REPEAT_MIRRORED which reverses the texture at the border which should fix the problem.

image