The Wild Mod [Fabric]

The Wild Mod [Fabric]

658k Downloads

Warden Emissive Overlay Improvements

MerpisMe opened this issue ยท 25 comments

commented
  • figure out how to edit the opacity/brightness of overlays dynamically

#76 (comment)

  • make warden's souls pulse
  • make the emissive overlay adjust its opacity to inversely match its current light level
  • figure out a way to change the overlay to match the secret texture
  • make warden's tendrils light up using tendril emissive overlay when detecting vibrations
commented

then idk what is wrong there with those colors

commented

try not setting all values to 0, but something like this: .color(255, 255, 255, 100)

I think it's actually just a problem with the EyesFeatureRenderer, I tried to change the light value instead of rbga and it worked!

commented

haha issue 69 funny number

commented

haha issue 69 funny number

yeah

commented

nonono the that's not how the vertex consumer is used, it's not a global state it writes to OpenGL buffers
you have to set it in vertex method:

private static void vertex(VertexConsumer vertexConsumer, Matrix4f matrix4f, Matrix3f matrix3f, int i, float f, int j, int k, int l) {
        vertexConsumer
                .vertex(matrix4f, f - 0.5F, j - 0.5F, 0.0F)
                .color(255, 255, 255, 255) // HERE
                .texture(k, l)
                .overlay(OverlayTexture.DEFAULT_UV)
                .light(i)
                .normal(matrix3f, 0.0F, 1.0F, 0.0F)
                .next();
    }
commented

also the order of those calls is very important, you can't move the color() around

commented

also the order of those calls is very important, you can't move the color() around

` @OverRide
public void render(MatrixStack matrices, VertexConsumerProvider vertexConsumers, int light, WardenEntity entity, float limbAngle, float limbDistance, float tickDelta, float animationProgress, float headYaw, float headPitch) {
matrices.push();
MatrixStack.Entry entry = matrices.peek();
Matrix4f matrix4f = entry.getPositionMatrix();
Matrix3f matrix3f = entry.getNormalMatrix();

    VertexConsumer vertexConsumer = vertexConsumers.getBuffer(SOULS);

    int j = getLight(240);
    
    vertex(vertexConsumer, matrix4f, matrix3f, j, 0.0F, 0, 0, 1);
    vertex(vertexConsumer, matrix4f, matrix3f, j, 1.0F, 0, 1, 1);
    vertex(vertexConsumer, matrix4f, matrix3f, j, 1.0F, 1, 1, 0);
    vertex(vertexConsumer, matrix4f, matrix3f, j, 0.0F, 1, 0, 0);

    matrices.pop();
    super.render(matrices, vertexConsumers, light, entity, limbAngle, limbDistance, tickDelta, animationProgress, headYaw, headPitch);
}
private static void vertex(VertexConsumer vertexConsumer, Matrix4f matrix4f, Matrix3f matrix3f, int i, float f, int j, int k, int l) {
    vertexConsumer
            .vertex(matrix4f, f - 0.5F, j - 0.5F, 0.0F)
            .color(255, 255, 255, 0)
            .texture(k, l)
            .overlay(OverlayTexture.DEFAULT_UV)
            .light(i)
            .normal(matrix3f, 0.0F, 1.0F, 0.0F)
            .next();
}

I took your advice and copied over some of the firefly code, but changing the alpha seems to do nothing, and I'm pretty sure the problem is that you can't use VertexConsumer on super.render() in this case, but it needs VertexConsumerProvider. Do you know if there's a way to get around this? (I have no clue what any of it means so I'm really just trying my best)
(WHY DOES GITHUB KEEP GLITCHING MY COMMENTS)

commented

but changing the alpha seems to do nothing

are you using a transparent render layer?

and I'm pretty sure the problem is that you can't use VertexConsumer on super.render() in this case, but it needs VertexConsumerProvider

can you elaborate? I'm not sure what do you mean by this

commented

but changing the alpha seems to do nothing

are you using a transparent render layer?

and I'm pretty sure the problem is that you can't use VertexConsumer on super.render() in this case, but it needs VertexConsumerProvider

can you elaborate? I'm not sure what do you mean by this

I'm using the Translucent RenderLayer

private static final RenderLayer SOULS = RenderLayer.getEntityTranslucent(new Identifier(WildMod.MOD_ID, "textures/entity/warden/warden_souls.png"));

Edit: yeah i had no clue what I was talking about when I mentioned the VertexConsumerProvider thing, the firefly code does the same thing and works fine

commented

It's probably easier to look here since I can't explain this stuff well: https://github.com/Osmiooo/wildmod/blob/master/src/main/java/frozenblock/wild/mod/entity/WardenEntitySoulsFeatureRenderer.java
Setting any value in .color() to any other value doesn't change the outcome of what gets rendered, not alpha nor r, g, or b

commented

Screenshot from 2022-01-27 22-31-58
well it works for me

commented

try not setting all values to 0, but something like this:
.color(255, 255, 255, 100)

commented

The method says this
VertexConsumerProvider vertexConsumers
And because it's a different class than VertexConsumer, I can't put it in

that's fine, you don't want a vertexConsumer there.

commented

try not setting all values to 0, but something like this: .color(255, 255, 255, 100)

I tried that and it didn't do anything either

commented

WHY WONT IT WORK

commented

WHY WONT IT WORK

@magistermaks any ideas?

commented

WHY WONT IT WORK

@magistermaks any ideas?

I can't find out how exactly to edit the colors, putting it either before or after the super.render() doesn't work

    vertexConsumers.getBuffer(this.getEyesTexture()).color(1F, 1F, 1F, 0);
    super.render(matrices, vertexConsumers, light, entity, limbAngle, limbDistance, tickDelta, animationProgress, headYaw, headPitch);
     vertexConsumers.getBuffer(this.getEyesTexture()).color(1F, 1F, 1F, 0);

For some reason the alpha won't set

commented

@Merp check latest commits

commented

@Merp check latest commits

i am experiencing very strong symptoms of HOLY SHIT

commented

@Merp check latest commits

i am experiencing very strong symptoms of HOLY SHIT

why
Also the WardenEntityModel caused insanely ugly Z-Fighting with the tendril overlays, I set the scale of the tendrils to be 0.001 to stop it- it's unnoticeable unless you have a 500K display, the only difference is that there isn't Z-fighting

commented

@Merp check latest commits

i am experiencing very strong symptoms of HOLY SHIT

Also apparently there is a way to change the alpha of an overlay: if R, G, and B are ALL set to a value below 1.0f, it starts decreasing the alpha

commented

@Merp check latest commits

i am experiencing very strong symptoms of HOLY SHIT

why Also the WardenEntityModel caused insanely ugly Z-Fighting with the tendril overlays, I set the scale of the tendrils to be 0.001 to stop it- it's unnoticeable unless you have a 500K display, the only difference is that there isn't Z-fighting

oh nice, i was trying to find a solution to that lol

commented

@Merp check latest commits

i am experiencing very strong symptoms of HOLY SHIT

Also apparently there is a way to change the alpha of an overlay: if R, G, and B are ALL set to a value below 1.0f, it starts decreasing the alpha

that makes a lot of sense actually. i've always wondered why the warden's souls faded to black and then to completely transparent in official footage

commented

@Merp check latest commits

i am experiencing very strong symptoms of HOLY SHIT

Also apparently there is a way to change the alpha of an overlay: if R, G, and B are ALL set to a value below 1.0f, it starts decreasing the alpha

that makes a lot of sense actually. i've always wondered why the warden's souls faded to black and then to completely transparent in official footage

well I guess we accurately recreated something about the warden then

commented
  • figure out how to edit the opacity/brightness of overlays dynamically

#76 (comment)

  • make warden's souls pulse
  • make the emissive overlay adjust its opacity to inversely match its current light level
  • figure out a way to change the overlay to match the secret texture
  • make warden's tendrils light up using tendril emissive overlay when detecting vibrations

Done!