Farm plant textures are missing 1 row of pixels #286

Closed
opened 2022-02-26 16:55:51 +01:00 by Li0n_2 · 4 comments
Member
What happened?

farm plant textures fit nicely into their 16x16 pixel box. however, the farmland under them is 1 pixel lower than a full node, causing a 1 pixel gap between the farmland and the crops.

What did I expect?

I expected crops to not be floating above farmland

How to get it to happen

plant some crops into farmland, try to get eyelevel with the top of the farmland, and look through the crops.

Environment

Mineclonia Version: 8810a24ce0 (current)
Minetest Version: 5.4.0

Solution

either draw an extra row of pixels at the bottom of each crop texture, or move them down by 1 pixel.

##### What happened? farm plant textures fit nicely into their 16x16 pixel box. however, the farmland under them is 1 pixel lower than a full node, causing a 1 pixel gap between the farmland and the crops. ##### What did I expect? I expected crops to not be floating above farmland ##### How to get it to happen plant some crops into farmland, try to get eyelevel with the top of the farmland, and look through the crops. ##### Environment Mineclonia Version: 8810a24ce0c9c180edd1c69778a5482f20880a01 (current) Minetest Version: 5.4.0 ##### Solution either draw an extra row of pixels at the bottom of each crop texture, or move them down by 1 pixel.
Li0n_2 added the
bug
unconfirmed
labels 2022-02-26 16:55:51 +01:00
Owner

I can confirm this.

I can confirm this.
erlehmann removed the
unconfirmed
label 2022-04-16 02:54:19 +02:00
Owner

Thanks to #minetest IRC user ROllerozxa I found a way to make this happen for #-shaped plantlike drawtype nodes: Use a nodebox drawtype instead … and then use texture modifier trickery to shift textures for the nodebox 1 pixel down with wraparound.

Thanks to #minetest IRC user ROllerozxa I found a way to make this happen for `#`-shaped `plantlike` drawtype nodes: Use a `nodebox` drawtype instead … and then use texture modifier trickery to shift textures for the nodebox 1 pixel down with wraparound.
erlehmann changed title from farm plant textures are missing 1 row of pixels to Farm plant textures are missing 1 row of pixels 2022-04-18 02:59:12 +02:00
Owner

This is what is needed to make a fake-plantlike nodebox:

	drawtype = "nodebox",
	node_box = {
		type = "fixed",
		fixed = {
			{ 4/16, -9/16, -8/16,  4/16,  4/16,  8/16},
			{-4/16, -9/16, -8/16, -4/16,  4/16,  8/16},
			{-8/16, -9/16, -4/16,  8/16,  4/16, -4/16},
			{-8/16, -9/16,  4/16,  8/16,  4/16,  4/16},
		}
	},

A 16px × 16px texture for this must have its bottom row at the top.
This can be achieved using the [combine texture modifier like so:

[combine:16x16:0,-15=plant.png;0,1=plant.png
This is what is needed to make a fake-plantlike nodebox: ``` drawtype = "nodebox", node_box = { type = "fixed", fixed = { { 4/16, -9/16, -8/16, 4/16, 4/16, 8/16}, {-4/16, -9/16, -8/16, -4/16, 4/16, 8/16}, {-8/16, -9/16, -4/16, 8/16, 4/16, -4/16}, {-8/16, -9/16, 4/16, 8/16, 4/16, 4/16}, } }, ``` A 16px × 16px texture for this must have its bottom row at the top. This can be achieved using the `[combine` texture modifier like so: ``` [combine:16x16:0,-15=plant.png;0,1=plant.png ```
Owner

Fixed with merge of this PR: #293

Fixed with merge of this PR: https://git.minetest.land/Mineclonia/Mineclonia/pulls/293
This repo is archived. You cannot comment on issues.
No Milestone
No project
No Assignees
2 Participants
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: Mineclonia/Mineclonia#286
No description provided.