Iris Shaders

Iris Shaders

38M Downloads

MC_Entity detecting glass a a form of leaf

WhyFenceCode opened this issue ยท 0 comments

commented

What happened?

I made a shader that has waving leaves, and added all the leaf types to an mc_entity. When I use my shader glass blocks also have the waving effect. I asked on the discord, and some people said that they heard of similar issues with other shaders. My code is below for reference.

Gbuffer Terrain

void main() {
    // Assign values to varying variables
    TexCoords = gl_MultiTexCoord0.st;
    // Use the texture matrix instead of dividing by 15 to maintain compatiblity for each version of Minecraft
    LightmapCoords = mat2(gl_TextureMatrix[1]) * gl_MultiTexCoord1.st;
    // Transform them into the [0, 1] range
    LightmapCoords = LightmapCoords * (16.0/15.0) - (16.0/15.0/32.0);
    Normal = gl_NormalMatrix * gl_Normal;
    Color = gl_Color;
    BlockID = mc_Entity.x;
    if (mc_Entity.x == 30.0){
        vec3 viewpos = (gl_ModelViewMatrix * gl_Vertex).xyz;
        vec3 feetPlayerpos = (gbufferModelViewInverse * vec4(viewpos, 1.0)).xyz;
        vec3 worldpos = feetPlayerpos + cameraPosition;

        worldpos.z += (generateWave(worldpos.x, worldpos.y, frameTimeCounter/800 * 200.0))/40;
        worldpos.x += (generateWave(worldpos.z, worldpos.y, frameTimeCounter/800 * 200.0 - 200))/40;

        worldpos.y -= 0.0001;

        vec3 feetPlayerpos2 = worldpos - cameraPosition;
        vec3 viewpos2 = (gbufferModelView * vec4(feetPlayerpos2, 1.0)).xyz;
        vec4 clippos = gl_ProjectionMatrix * vec4(viewpos2, 1.0);

        gl_Position = clippos;
    } else {
        gl_Position = ftransform();
    }
}

Block.Properties:

block.30 = oak_leaves spruce_leaves birch_leaves jungle_leaves acacia_leaves dark_oak_leaves mangrove_leaves cherry_leaves azalea_leaves flowering_azalea_leaves grass fern tall_grass large_fern rose_bush lilac peony sugar_cane 

Screenshots

No response

Log output

Too long, had to pastebin:
https://pastebin.com/1EvQgaaB

Minecraft Version

1.19.1

Iris Version

iris-fabric-loader-0.14.24-1.20.1/fabric/Fabric

Operating System

Windows 11

What is your GPU?

Iris X

Additional context

I had to pastebin the log it was too long:
https://pastebin.com/1EvQgaaB