diff --git a/assets/cubyz/shaders/item_drop.fs b/assets/cubyz/shaders/item_drop.fs index 616d7e19..c3e41c3b 100644 --- a/assets/cubyz/shaders/item_drop.fs +++ b/assets/cubyz/shaders/item_drop.fs @@ -280,11 +280,9 @@ void mainItemDrop() { - vec4 color = decodeColor(block); - color.a = 1; // No transparency supported! - color = color*vec4(ambientLight*normalVariations[lastNormal], 1); - - fragColor.rgb /= 4; + fragColor = decodeColor(block); + fragColor.a = 1; // No transparency supported! + fragColor = fragColor*vec4(ambientLight*normalVariations[lastNormal], 1); } void main() { diff --git a/src/itemdrop.zig b/src/itemdrop.zig index 2b8d5bae..c1d5714e 100644 --- a/src/itemdrop.zig +++ b/src/itemdrop.zig @@ -541,9 +541,9 @@ pub const ItemDropRenderer = struct { // MARK: ItemDropRenderer var z: u32 = 0; while(z < 1) : (z += 1) { var x: u32 = 0; - while(x < self.size[0]) : (x += 1) { + while(x < img.width) : (x += 1) { var y: u32 = 0; - while(y < self.size[1]) : (y += 1) { + while(y < img.height) : (y += 1) { dataSection[i] = img.getRGB(x, y).toARBG(); i += 1; } @@ -690,7 +690,7 @@ pub const ItemDropRenderer = struct { // MARK: ItemDropRenderer modelMatrix = modelMatrix.mul(Mat4f.rotationZ(-rot[2])); c.glUniformMatrix4fv(itemUniforms.modelMatrix, 1, c.GL_TRUE, @ptrCast(&modelMatrix)); - if(item == .baseItem and item.baseItem.block != null) { + if(item == .baseItem and item.baseItem.block != null and item.baseItem.image.imageData.ptr == graphics.Image.defaultImage.imageData.ptr) { const blockType = item.baseItem.block.?; const block = blocks.Block{.typ = blockType, .data = 0}; c.glUniform1i(itemUniforms.modelIndex, block.mode().model(block));