Bliss Shaders

Bliss Shaders

423k Downloads

Issue Loading Shader with Distant Horizons Beta

dupontinquiries opened this issue ยท 31 comments

commented

Not sure if you are looking for testing on DH beta, but here is an issue if you are.

Reproduce:

  1. run Asahi Linux
  2. install prism launcher and create an instance
  3. install Distant Horizons beta on 1.20.4
    1. sodium-fabric-0.5.8+mc1.20.4
    2. iris-1.7.0-snapshot+mc1.20.4-5983468
    3. indium-1.0.30+mc1.20.4
    4. fabric-api-0.91.1+1.20.3
    5. DistantHorizons-fabric-2.0.2-a-dev-1.20.4
  4. run game
  5. enable shaders and select shader from menu

Expected:

  • shader works with DH LODs

Actual Result:

  • composite2: composite2: error: Too many fragment shader texture samplers in chat box when shader is enabled
  • shader fails to load: world appears to be rendering with vanilla game lighting
  • fails with master branch ZIP as well as shader provided by Iris beta installer

Please let me know if there is anything else I can do to help.

commented

Woah! This looks amazing. I just tested with my M1 Max and got stable 40-50FPS on 1008p with default settings.

commented

@dupontinquiries i really didn't do anything too special, just commented resource usage out until it worked haha.

i was really just trying to see if it was even worth pursuing, but you can check it out here if you'd like https://github.com/lilac-eclipse/Bliss-Shader/releases/tag/mac-compat-pre-0.0.1

Nice. I was hoping it would also work on Linux but unfortunately it doesn't. I just tried it out.

commented

this is an issue relating to apple's opengl support in general. you're out of luck for now.
the shader should atleast compile without distant horizons.

when that mod is enabled, 2 additional texture samplers get used, and it pushes it over the limit apple has. i just have to manage data better and do the same stuff with less samplers

commented

Ah ok. Is it a complicated issue or is it something I could mess around with in a fork? What part of the code should I look in?

Also, just to be clear, this isn't running on macOS. Idk how familiar you are with mac but in short Asahi is using the Apple hardware and a Linux driver + Mesa to do the GL stuff. Maybe this can mean that in the future the number of samplers you have access to will increase and the problem will be solved as the driver evolves. I can check this out for you and let you know what the future looks like on that end in case that affects your decision making... maybe some other platforms also have this issue or maybe this is just a mac thing.

commented

Apparently there is a workaround that can be done from the driver side. I am looking into it to see if it is viable and, if so, what the performance is.

commented

mac support is rough, because apple just hates opengl. they have a low limit of how many color attachment buffers i can use in any one shader program.
when distant horizons is enabled, it samples 2 additional depth buffers in the main lighting pass shader program, and makes it go over apples max limit, thus making the shader fail to compile. so i'd have to re-manage all my buffer storage stuffs (it is admittedly bad right now) to make it stay under apples limit. no other vendor has such a low limit but apple, so... its not much of a priority.

bliss can function on macs without distant horizons + colored shadows disabled, is it stays under the limit at that point.

commented

hi @dupontinquiries ! just curious if you were able to find anything out as i'm running into a similar issue!

commented

also @X0nk do you have any plans to make a mac + DH compatible version? Even just disabling a couple of features to make a lightweight version of the shader would be amazing! i don't have much graphics programming experience, but if you point me to the areas to change to reduce the number of textures i could also take a look!

commented

gotcha that makes sense! is there a way/are there any settings that can be disabled to allow bliss to run with distant horizons?

commented

hi @dupontinquiries ! just curious if you were able to find anything out as i'm running into a similar issue!

Nothing that directly fixes this yet unfortunately. In the meantime I have been running a pack called Distantly Optimized v2.2.1 via Modrinth on Prism launcher with the BSL shader in order to get some nice shaders, but I still think Bliss takes the cake when it comes to the shader atmosphere and look. This all via Asahi Linux that has OpenGL 4.6 support which helps the game run albeit with more fan noise.

Will post when I have more info.

commented

gotcha that makes sense! is there a way/are there any settings that can be disabled to allow bliss to run with distant horizons?

nope

commented

shader settings -> direct light -> shadows

not there
Screenshot 2024-05-09 at 18 29 09

commented

this is an issue relating to apple's opengl support in general. you're out of luck for now. the shader should atleast compile without distant horizons.

when that mod is enabled, 2 additional texture samplers get used, and it pushes it over the limit apple has. i just have to manage data better and do the same stuff with less samplers

that's weird, this shader runs with the modpack "better adventures+" which uses iris 1.6.17

so i was thinking that it was something to do with iris 1.7 since that worked

also, where can i find the colored shadows option?

commented

shader settings -> direct light -> shadows

commented

i see, so the options are basically:

  1. optimize the buffer storage units to add compatibility and preserve functionality
  2. remove some features+textures to bring the resource usage under the limit

is that correct? if so, could you point me to good removal candidates for 2?

commented

then you have an old bliss in-development version

is this expected for macos?

Screenshot 2024-05-10 at 13 32 20

commented

there is an issue for mac i am currently trying to figure out, where entities behind translucent stuff are weirdly colored/super bright. and enchanted items, and vanilla emissives. im currently trying to figure it out

commented

then you have an old bliss in-development version

commented

then you have an old bliss in-development version

oh ok thanks

commented

i see, so the options are basically:

  1. optimize the buffer storage units to add compatibility and preserve functionality
  2. remove some features+textures to bring the resource usage under the limit

is that correct? if so, could you point me to good removal candidates for 2?

@X0nk

commented

that is a very complicated task, and would require you to know the ins-and-outs of the shader structure, how optifine/iris shaders work, and how to code in the language its written in (GLSL). i am not up to giving you a guide on how to do this, but you are free to edit your personal copy of the pack as much as you want.

i will tell you where the fragment shader that the main lighting pass is done in though, since thats where it goes over apples limit: shaders/dimensions/composite1.fsh. you dont have to worry about the .vsh (vertex shader) of it,

the issue apple has is sampling many different colortex's or depthtex/dhDepthTex's, or anything marked as a uniform sampler2D. apples limit is like 16 different color attachments being sampled at least once. i wish you luck.

commented

thank you for the info!!

with this i decided to try a prototype and removed the usage of a few of the textures and was able to get the shader (with reduced/partially broken) functionality running on my 2018 macbook pro.

unfortunately even with the reduced features i was only able to get 9fps in a vanilla world, so this is likely not worth pursuing further.

IMG_4119

commented

Wow nice work on this. @lilac-eclipse do you have a prism zip of this reduced version I could test out? I would be able to report back with fps numbers for a Mac Studio M1 and an M2 Max laptop which should have different numbers than the 2018 MacBook.

commented

thank you for the info!!

with this i decided to try a prototype and removed the usage of a few of the textures and was able to get the shader (with reduced/partially broken) functionality running on my 2018 macbook pro.

unfortunately even with the reduced features i was only able to get 9fps in a vanilla world, so this is likely not worth pursuing further.

IMG_4119

it looks like you're playing at the native resolution

try playing in 1080p with easyres

should double or even triple fps

commented

@dupontinquiries i really didn't do anything too special, just commented resource usage out until it worked haha.

i was really just trying to see if it was even worth pursuing, but you can check it out here if you'd like https://github.com/lilac-eclipse/Bliss-Shader/releases/tag/mac-compat-pre-0.0.1

commented

Screenshot 2024-06-02 at 15 47 48
still working on glowing things?

commented

linux should have no issues running bliss + distant horizons. it doesnt have terrible openGL support like apple does.

but they do share a common issue, the glowing mobs behind translucent things. refer to issue#123 for that.

commented

issue#123, should be resolved now, please refer to that issue thread.

commented

I know the issue is closed but I wanted to leave notes here to track progress on getting this to work. I had some time to try the latest version of bliss with DH today and the composite2 error is no longer showing up. Now I am getting this error msg: No more available texture units while activating sampler depthtex1

I am not sure what this means but I will leave the info here in case it helps in any way. I am also curious if there is a simple explanation as to what the issue might be.

commented

with this i decided to try a prototype and removed the usage of a few of the textures and was able to get the shader (with reduced/partially broken) functionality running on my 2018 macbook pro.

Were you able to get this running with distant horizons? I wasn't able to run it at all:

composite2.fsh: composite2.fsh: 0:1173(49): error: `shadowtex1' undeclared
0:1173(41): error: no matching function for call to `texture(error, vec3)'; candidates are:
0:1173(41): error:    vec4 texture(sampler1D, float)
0:1173(41): error:    ivec4 texture(isampler1D, float)
0:1173(41): error:    uvec4 texture(usampler1D, float)
0:1173(41): error:    vec4 texture(sampler2D, vec2)
0:1173(41): error:    ivec4 texture(isampler2D, vec2)
0:1173(41): error:    uvec4 texture(usampler2D, vec2)
0:1173(41): error:    vec4 texture(sampler3D, vec3)
0:1173(41): error:    ivec4 texture(isampler3D, vec3)
0:1173(41): error:    uvec4 texture(usampler3D, vec3)
0:1173(41): error:    vec4 texture(samplerCube, vec3)
0:1173(41): error:    ivec4 texture(isamplerCube, vec3)
0:1173(41): error:    uvec4 texture(usamplerCube, vec3)
0:1173(41): error:    float texture(sampler1DShadow, vec3)
0:1173(41): error:    float texture(sampler2DShadow, vec3)
0:1173(41): error:    float texture(samplerCubeShadow, vec4)
0:1173(41): error:    vec4 texture(sampler1DArray, vec2)
0:1173(41): error:    ivec4 texture(isampler1DArray, vec2)
0:1173(41): error:    uvec4 texture(usampler1DArray, vec2)
0:1173(41): error:    vec4 texture(sampler2DArray, vec3)
0:1173(41): error:    ivec4 texture(isampler2DArray, vec3)
0:1173(41): error:    uvec4 texture(usampler2DArray, vec3)
0:1173(41): error:    vec4 texture(samplerCubeArray, vec4)
0:1173(41): error:    ivec4 texture(isamplerCubeArray, vec4)
0:1173(41): error:    uvec4 texture(usamplerCubeArray, vec4)
0:1173(41): error:    float texture(sampler1DArrayShadow, vec3)
0:1173(41): error:    float texture(sampler2DArrayShadow, vec4)
0:1173(41): error:    float texture(samplerCubeArrayShadow, vec4, float)
0:1173(41): error:    vec4 texture(sampler2DRect, vec2)
0:1173(41): error:    ivec4 texture(isampler2DRect, vec2)
0:1173(41): error:    uvec4 texture(usampler2DRect, vec2)
0:1173(41): error:    float texture(sampler2DRectShadow, vec3)
0:1173(41): error:    vec4 texture(sampler1D, float, float)
0:1173(41): error:    ivec4 texture(isampler1D, float, float)
0:1173(41): error:    uvec4 texture(usampler1D, float, float)
0:1173(41): error:    vec4 texture(sampler2D, vec2, float)
0:1173(41): error:    ivec4 texture(isampler2D, vec2, float)
0:1173(41): error:    uvec4 texture(usampler2D, vec2, float)
0:1173(41): error:    vec4 texture(sampler3D, vec3, float)
0:1173(41): error:    ivec4 texture(isampler3D, vec3, float)
0:1173(41): error:    uvec4 texture(usampler3D, vec3, float)
0:1173(41): error:    vec4 texture(samplerCube, vec3, float)
0:1173(41): error:    ivec4 texture(isamplerCube, vec3, float)
0:1173(41): error:    uvec4 texture(usamplerCube, vec3, float)
0:1173(41): error:    float texture(sampler1DShadow, vec3, float)
0:1173(41): error:    float texture(sampler2DShadow, vec3, float)
0:1173(41): error:    float texture(samplerCubeShadow, vec4, float)
0:1173(41): error:    vec4 texture(sampler1DArray, vec2, float)
0:1173(41): error:    ivec4 texture(isampler1DArray, vec2, float)
0:1173(41): error:    uvec4 texture(usampler1DArray, vec2, float)
0:1173(41): error:    vec4 texture(sampler2DArray, vec3, float)
0:1173(41): error:    ivec4 texture(isampler2DArray, vec3, float)
0:1173(41): error:    uvec4 texture(usampler2DArray, vec3, float)
0:1173(41): error:    vec4 texture(samplerCubeArray, vec4, float)
0:1173(41): error:    ivec4 texture(isamplerCubeArray, vec4, float)
0:1173(41): error:    uvec4 texture(usamplerCubeArray, vec4, float)
0:1173(41): error:    float texture(sampler1DArrayShadow, vec3, float)
0:1173(36): error: cannot construct `vec4' from a non-numeric data type
0:1173(36): error: type mismatch
0:1173(36): error: operands to arithmetic operators must be numeric
0:1173(35): error: operands to arithmetic operators must be numeric
0:1173(29): error: no matching function for call to `clamp(error, float, float)'; candidates are:
0:1173(29): error:    float clamp(float, float, float)
0:1173(29): error:    vec2 clamp(vec2, float, float)
0:1173(29): error:    vec3 clamp(vec3, float, float)
0:1173(29): error:    vec4 clamp(vec4, float, float)
0:1173(29): error:    vec2 clamp(vec2, vec2, vec2)
0:1173(29): error:    vec3 clamp(vec3, vec3, vec3)
0:1173(29): error:    vec4 clamp(vec4, vec4, vec4)
0:1173(29): error:    int clamp(int, int, int)
0:1173(29): error:    ivec2 clamp(ivec2, int, int)
0:1173(29): error:    ivec3 clamp(ivec3, int, int)
0:1173(29): error:    ivec4 clamp(ivec4, int, int)
0:1173(29): error:    ivec2 clamp(ivec2, ivec2, ivec2)
0:1173(29): error:    ivec3 clamp(ivec3, ivec3, ivec3)
0:1173(29): error:    ivec4 clamp(ivec4, ivec4, ivec4)
0:1173(29): error:    uint clamp(uint, uint, uint)
0:1173(29): error:    uvec2 clamp(uvec2, uint, uint)
0:1173(29): error:    uvec3 clamp(uvec3, uint, uint)
0:1173(29): error:    uvec4 clamp(uvec4, uint, uint)
0:1173(29): error:    uvec2 clamp(uvec2, uvec2, uvec2)
0:1173(29): error:    uvec3 clamp(uvec3, uvec3, uvec3)
0:1173(29): error:    uvec4 clamp(uvec4, uvec4, uvec4)
0:1173(29): error:    double clamp(double, double, double)
0:1173(29): error:    dvec2 clamp(dvec2, double, double)
0:1173(29): error:    dvec3 clamp(dvec3, double, double)
0:1173(29): error:    dvec4 clamp(dvec4, double, double)
0:1173(29): error:    dvec2 clamp(dvec2, dvec2, dvec2)
0:1173(29): error:    dvec3 clamp(dvec3, dvec3, dvec3)
0:1173(29): error:    dvec4 clamp(dvec4, dvec4, dvec4)
0:1173(25): error: no matching function for call to `pow(error, float)'; candidates are:
0:1173(25): error:    float pow(float, float)
0:1173(25): error:    vec2 pow(vec2, vec2)
0:1173(25): error:    vec3 pow(vec3, vec3)
0:1173(25): error:    vec4 pow(vec4, vec4)
0:1174(35): error: `shadowtex0' undeclared
0:1174(27): error: no matching function for call to `texture(error, vec3)'; candidates are:
0:1174(27): error:    vec4 texture(sampler1D, float)
0:1174(27): error:    ivec4 texture(isampler1D, float)
0:1174(27): error:    uvec4 texture(usampler1D, float)
0:1174(27): error:    vec4 texture(sampler2D, vec2)
0:1174(27): error:    ivec4 texture(isampler2D, vec2)
0:1174(27): error:    uvec4 texture(usampler2D, vec2)
0:1174(27): error:    vec4 texture(sampler3D, vec3)
0:1174(27): error:    ivec4 texture(isampler3D, vec3)
0:1174(27): error:    uvec4 texture(usampler3D, vec3)
0:1174(27): error:    vec4 texture(samplerCube, vec3)
0:1174(27): error:    ivec4 texture(isamplerCube, vec3)
0:1174(27): error:    uvec4 texture(usamplerCube, vec3)
0:1174(27): error:    float texture(sampler1DShadow, vec3)
0:1174(27): error:    float texture(sampler2DShadow, vec3)
0:1174(27): error:    float texture(samplerCubeShadow, vec4)
0:1174(27): error:    vec4 texture(sampler1DArray, vec2)
0:1174(27): error:    ivec4 texture(isampler1DArray, vec2)
0:1174(27): error:    uvec4 texture(usampler1DArray, vec2)
0:1174(27): error:    vec4 texture(sampler2DArray, vec3)
0:1174(27): error:    ivec4 texture(isampler2DArray, vec3)
0:1174(27): error:    uvec4 texture(usampler2DArray, vec3)
0:1174(27): error:    vec4 texture(samplerCubeArray, vec4)
0:1174(27): error:    ivec4 texture(isamplerCubeArray, vec4)
0:1174(27): error:    uvec4 texture(usamplerCubeArray, vec4)
0:1174(27): error:    float texture(sampler1DArrayShadow, vec3)
0:1174(27): error:    float texture(sampler2DArrayShadow, vec4)
0:1174(27): error:    float texture(samplerCubeArrayShadow, vec4, float)
0:1174(27): error:    vec4 texture(sampler2DRect, vec2)
0:1174(27): error:    ivec4 texture(isampler2DRect, vec2)
0:1174(27): error:    uvec4 texture(usampler2DRect, vec2)
0:1174(27): error:    float texture(sampler2DRectShadow, vec3)
0:1174(27): error:    vec4 texture(sampler1D, float, float)
0:1174(27): error:    ivec4 texture(isampler1D, float, float)
0:1174(27): error:    uvec4 texture(usampler1D, float, float)
0:1174(27): error:    vec4 texture(sampler2D, vec2, float)
0:1174(27): error:    ivec4 texture(isampler2D, vec2, float)
0:1174(27): error:    uvec4 texture(usampler2D, vec2, float)
0:1174(27): error:    vec4 texture(sampler3D, vec3, float)
0:1174(27): error:    ivec4 texture(isampler3D, vec3, float)
0:1174(27): error:    uvec4 texture(usampler3D, vec3, float)
0:1174(27): error:    vec4 texture(samplerCube, vec3, float)
0:1174(27): error:    ivec4 texture(isamplerCube, vec3, float)
0:1174(27): error:    uvec4 texture(usamplerCube, vec3, float)
0:1174(27): error:    float texture(sampler1DShadow, vec3, float)
0:1174(27): error:    float texture(sampler2DShadow, vec3, float)
0:1174(27): error:    float texture(samplerCubeShadow, vec4, float)
0:1174(27): error:    vec4 texture(sampler1DArray, vec2, float)
0:1174(27): error:    ivec4 texture(isampler1DArray, vec2, float)
0:1174(27): error:    uvec4 texture(usampler1DArray, vec2, float)
0:1174(27): error:    vec4 texture(sampler2DArray, vec3, float)
0:1174(27): error:    ivec4 texture(isampler2DArray, vec3, float)
0:1174(27): error:    uvec4 texture(usampler2DArray, vec3, float)
0:1174(27): error:    vec4 texture(samplerCubeArray, vec4, float)
0:1174(27): error:    ivec4 texture(isamplerCubeArray, vec4, float)
0:1174(27): error:    uvec4 texture(usamplerCubeArray, vec4, float)
0:1174(27): error:    float texture(sampler1DArrayShadow, vec3, float)
0:1174(22): error: cannot construct `vec4' from a non-numeric data type
0:1174(22): error: type mismatch
0:1175(18): warning: `opaqueShadow' used uninitialized
0:1175(32): warning: `shadowDepthDiff' used uninitialized
0:1176(34): error: `shadowcolor0' undeclared
0:1176(26): error: no matching function for call to `texture(error, vec2)'; candidates are:
0:1176(26): error:    vec4 texture(sampler1D, float)
0:1176(26): error:    ivec4 texture(isampler1D, float)
0:1176(26): error:    uvec4 texture(usampler1D, float)
0:1176(26): error:    vec4 texture(sampler2D, vec2)
0:1176(26): error:    ivec4 texture(isampler2D, vec2)
0:1176(26): error:    uvec4 texture(usampler2D, vec2)
0:1176(26): error:    vec4 texture(sampler3D, vec3)
0:1176(26): error:    ivec4 texture(isampler3D, vec3)
0:1176(26): error:    uvec4 texture(usampler3D, vec3)
0:1176(26): error:    vec4 texture(samplerCube, vec3)
0:1176(26): error:    ivec4 texture(isamplerCube, vec3)
0:1176(26): error:    uvec4 texture(usamplerCube, vec3)
0:1176(26): error:    float texture(sampler1DShadow, vec3)
0:1176(26): error:    float texture(sampler2DShadow, vec3)
0:1176(26): error:    float texture(samplerCubeShadow, vec4)
0:1176(26): error:    vec4 texture(sampler1DArray, vec2)
0:1176(26): error:    ivec4 texture(isampler1DArray, vec2)
0:1176(26): error:    uvec4 texture(usampler1DArray, vec2)
0:1176(26): error:    vec4 texture(sampler2DArray, vec3)
0:1176(26): error:    ivec4 texture(isampler2DArray, vec3)
0:1176(26): error:    uvec4 texture(usampler2DArray, vec3)
0:1176(26): error:    vec4 texture(samplerCubeArray, vec4)
0:1176(26): error:    ivec4 texture(isamplerCubeArray, vec4)
0:1176(26): error:    uvec4 texture(usamplerCubeArray, vec4)
0:1176(26): error:    float texture(sampler1DArrayShadow, vec3)
0:1176(26): error:    float texture(sampler2DArrayShadow, vec4)
0:1176(26): error:    float texture(samplerCubeArrayShadow, vec4, float)
0:1176(26): error:    vec4 texture(sampler2DRect, vec2)
0:1176(26): error:    ivec4 texture(isampler2DRect, vec2)
0:1176(26): error:    uvec4 texture(usampler2DRect, vec2)
0:1176(26): error:    float texture(sampler2DRectShadow, vec3)
0:1176(26): error:    vec4 texture(sampler1D, float, float)
0:1176(26): error:    ivec4 texture(isampler1D, float, float)
0:1176(26): error:    uvec4 texture(usampler1D, float, float)
0:1176(26): error:    vec4 texture(sampler2D, vec2, float)
0:1176(26): error:    ivec4 texture(isampler2D, vec2, float)
0:1176(26): error:    uvec4 texture(usampler2D, vec2, float)
0:1176(26): error:    vec4 texture(sampler3D, vec3, float)
0:1176(26): error:    ivec4 texture(isampler3D, vec3, float)
0:1176(26): error:    uvec4 texture(usampler3D, vec3, float)
0:1176(26): error:    vec4 texture(samplerCube, vec3, float)
0:1176(26): error:    ivec4 texture(isamplerCube, vec3, float)
0:1176(26): error:    uvec4 texture(usamplerCube, vec3, float)
0:1176(26): error:    float texture(sampler1DShadow, vec3, float)
0:1176(26): error:    float texture(sampler2DShadow, vec3, float)
0:1176(26): error:    float texture(samplerCubeShadow, vec4, float)
0:1176(26): error:    vec4 texture(sampler1DArray, vec2, float)
0:1176(26): error:    ivec4 texture(isampler1DArray, vec2, float)
0:1176(26): error:    uvec4 texture(usampler1DArray, vec2, float)
0:1176(26): error:    vec4 texture(sampler2DArray, vec3, float)
0:1176(26): error:    ivec4 texture(isampler2DArray, vec3, float)
0:1176(26): error:    uvec4 texture(usampler2DArray, vec3, float)
0:1176(26): error:    vec4 texture(samplerCubeArray, vec4, float)
0:1176(26): error:    ivec4 texture(isamplerCubeArray, vec4, float)
0:1176(26): error:    uvec4 texture(usamplerCubeArray, vec4, float)
0:1176(26): error:    float texture(sampler1DArrayShadow, vec3, float)
0:1177(36): warning: `translucentShadow' used uninitialized
0:1179(39): warning: `translucentShadow' used uninitialized
0:1179(77): warning: `opaqueShadow' used uninitialized
0:1179(150): warning: `shadowDepthDiff' used uninitialized
0:1180(33): warning: `shadowDepthDiff' used uninitialized
0:1180(51): warning: `opaqueShadow' used uninitialized
0:1181(59): warning: `opaqueShadow' used uninitialized
0:1181(74): warning: `shadowDepthDiff' used uninitialized
commented

yeah you wont be able to get past that without removing shader features