Jump to content

Recommended Posts

Posted (edited)

My custom block model is having UV issues (see attached images). I've never messed with UV values so I have no idea how to fix them.

oven.json (model)

  Reveal hidden contents

The first image is the only picture I could get of the model looking how it should.

2018-05-18_17.44.13.png

2018-05-18_17.44.18.png

2018-05-18_17.44.24.png

Edited by SeanOMik

Developer of "A Realistic Foods Mod"

  • 2 weeks later...
Posted
  On 5/18/2018 at 10:46 PM, SeanOMik said:

My custom block model is having UV issues (see attached images). I've never messed with UV values so I have no idea how to fix them.

oven.json (model)

  Reveal hidden contents

The first image is the only picture I could get of the model looking how it should.

2018-05-18_17.44.13.png

2018-05-18_17.44.18.png

2018-05-18_17.44.24.png

Expand  

Hard to see from your code but I believe this is z-fighting, it’s pretty easy to fix. Just remove overlapping parts

About Me

  Reveal hidden contents

Versions below 1.14.4 are no longer supported on this forum. Use the latest version to receive support.

When asking support remember to include all relevant log files (logs are found in .minecraft/logs/), code if applicable and screenshots if possible.

Only download mods from trusted sites like CurseForge (minecraft.curseforge.com). A list of bad sites can be found here, with more information available at stopmodreposts.org

Edit your own signature at www.minecraftforge.net/forum/settings/signature/ (Make sure to check its compatibility with the Dark Theme)

Posted
  On 5/29/2018 at 2:10 AM, Cadiboo said:

Hard to see from your code but I believe this is z-fighting, it’s pretty easy to fix. Just remove overlapping parts

Expand  

So in my model I would remove the red and black 2x1 blocks?

Developer of "A Realistic Foods Mod"

Posted
  On 5/30/2018 at 10:07 PM, SeanOMik said:

So in my model I would remove the red and black 2x1 blocks?

Expand  

Or just make them smaller

About Me

  Reveal hidden contents

Versions below 1.14.4 are no longer supported on this forum. Use the latest version to receive support.

When asking support remember to include all relevant log files (logs are found in .minecraft/logs/), code if applicable and screenshots if possible.

Only download mods from trusted sites like CurseForge (minecraft.curseforge.com). A list of bad sites can be found here, with more information available at stopmodreposts.org

Edit your own signature at www.minecraftforge.net/forum/settings/signature/ (Make sure to check its compatibility with the Dark Theme)

Posted

Is it a JSON model? Remove the faces

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Posted

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Posted

Post the json model code.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Posted
  On 6/1/2018 at 5:35 PM, Draco18s said:

Post the json model code.

Expand  

oven.json (JSON model)

  Reveal hidden contents

 

Developer of "A Realistic Foods Mod"

Posted

Ok, you have this face:

"east": {"uv": [0, 0, 1, 9], "texture": "#missing"},

Notice the missing texture reference?

That face can likely be removed as its internal to the model (hidden by another cube).

 

Systematically going through the model, I have removed all hidden faces. I did this by setting the texture to something known and easily visible (in this case, texture #2, as it was easy to type, used rarely, and bright red). I would identify a single portion of the model and decide which of its faces I could not see from any angle, and I'd remove them from the json file.

{
	"parent": "block/block",
	"textures": {
		"0": "blocks/iron_block",
		"1": "blocks/coal_block",
		"2": "blocks/redstone_block",
		"3": "blocks/glass",
		"4": "blocks/iron_bars",
		"particle": "blocks/iron_block"
	},
	"elements": [
		{
			"from": [0, 0, 2],
			"to": [16, 1, 16],
			"faces": {
				"north": {"uv": [0, 0, 16, 1], "texture": "#0"},
				"east": {"uv": [0, 0, 16, 1], "texture": "#0"},
				"south": {"uv": [0, 0, 16, 1], "texture": "#0"},
				"west": {"uv": [0, 0, 16, 1], "texture": "#0"},
				"up": {"uv": [0, 1, 16, 15], "texture": "#0"},
				"down": {"uv": [0, 1, 16, 15], "texture": "#0"}
			}
		},
		{
			"from": [0, 1, 15],
			"to": [16, 13, 16],
			"faces": {
				"north": {"uv": [0, 0, 16, 12], "texture": "#0"},
				"east": {"uv": [0, 0, 1, 12], "texture": "#0"},
				"south": {"uv": [0, 1, 16, 13], "texture": "#0"},
				"west": {"uv": [0, 0, 1, 12], "texture": "#0"}
			}
		},
		{
			"from": [15, 1, 2],
			"to": [16, 13, 15],
			"faces": {
				"north": {"uv": [0, 0, 1, 12], "texture": "#0"},
				"east": {"uv": [1, 3, 14, 15], "texture": "#0"},
				"west": {"uv": [1, 3, 14, 15], "texture": "#0"},
				"up": {"uv": [0, 0, 1, 13], "texture": "#0"}
			}
		},
		{
			"from": [0, 1, 2],
			"to": [1, 13, 15],
			"faces": {
				"north": {"uv": [0, 0, 1, 12], "texture": "#0"},
				"east": {"uv": [1, 3, 14, 15], "texture": "#0"},
				"west": {"uv": [1, 3, 14, 15], "texture": "#0"},
				"up": {"uv": [0, 0, 1, 13], "texture": "#0"}
			}
		},
		{
			"from": [1, 1, 2],
			"to": [15, 2, 3],
			"faces": {
				"north": {"uv": [1, 3, 15, 4], "texture": "#0"},
				"south": {"uv": [1, 2, 15, 3], "texture": "#0"},
				"up": {"uv": [1, 0, 15, 1], "texture": "#0"}
			}
		},
		{
			"from": [1, 11, 2],
			"to": [15, 13, 3],
			"faces": {
				"north": {"uv": [1, 0, 15, 2], "texture": "#0"},
				"south": {"uv": [1, 0, 15, 2], "texture": "#0"},
				"up": {"uv": [1, 0, 15, 1], "texture": "#0"},
				"down": {"uv": [1, 0, 15, 1], "texture": "#0"}
			}
		},
		{
			"from": [2, 2, 2],
			"to": [14, 11, 3],
			"faces": {
				"north": {"uv": [2, 3, 14, 12], "texture": "#3"},
				"south": {"uv": [2, 3, 14, 12], "texture": "#3"}
			}
		},
		{
			"from": [1, 12, 3],
			"to": [15, 13, 15],
			"faces": {
				"up": {"uv": [1, 1, 15, 13], "texture": "#0"},
				"down": {"uv": [1, 1, 15, 13], "texture": "#0"}
			}
		},
		{
			"from": [1, 2, 2],
			"to": [2, 11, 3],
			"faces": {
				"north": {"uv": [1, 2, 2, 11], "texture": "#0"},
				"east": {"uv": [0, 0, 1, 9], "texture": "#0"},
				"south": {"uv": [1, 2, 2, 11], "texture": "#0"}
			}
		},
		{
			"from": [14, 2, 2],
			"to": [15, 11, 3],
			"faces": {
				"north": {"uv": [1, 2, 2, 11], "texture": "#0"},
				"south": {"uv": [1, 2, 2, 11], "texture": "#0"},
				"west": {"uv": [0, 0, 1, 9], "texture": "#0"}
			}
		},
		{
			"from": [4, 11, 1],
			"to": [12, 12, 2],
			"faces": {
				"north": {"uv": [4, 4, 12, 5], "texture": "#1"},
				"east": {"uv": [0, 0, 1, 1], "texture": "#1"},
				"south": {"uv": [4, 4, 12, 5], "texture": "#1"},
				"west": {"uv": [0, 0, 1, 1], "texture": "#1"},
				"up": {"uv": [3, 7, 11, 8], "texture": "#1"},
				"down": {"uv": [6, 5, 14, 6], "texture": "#1"}
			}
		},
		{
			"from": [1, 3, 4],
			"to": [15, 4, 15],
			"faces": {
				"north": {"uv": [1, 0, 15, 1], "texture": "#4"},
				"up": {"uv": [1, 2, 15, 13], "texture": "#4"},
				"down": {"uv": [1, 2, 15, 13], "texture": "#4"}
			}
		},
		{
			"from": [0, 13, 14],
			"to": [16, 16, 16],
			"faces": {
				"north": {"uv": [0, 0, 16, 3], "texture": "#0"},
				"east": {"uv": [0, 0, 2, 3], "texture": "#0"},
				"south": {"uv": [0, 0, 16, 3], "texture": "#0"},
				"west": {"uv": [14, 0, 16, 3], "texture": "#0"},
				"up": {"uv": [0, 1, 16, 3], "texture": "#0"}
			}
		},
        {
            "from": [13, 14, 13],
            "to": [15, 15, 14],
            "faces": {
                "north": {"uv": [11, 6, 13, 7], "texture": "#2"},
                "east": {"uv": [0, 0, 1, 1], "texture": "#2"},
                "west": {"uv": [5, 3, 6, 4], "texture": "#2"},
                "up": {"uv": [4, 3, 6, 4], "texture": "#2"},
                "down": {"uv": [4, 3, 6, 4], "texture": "#2"}
            }
        },
        {
            "from": [1, 14, 13],
            "to": [3, 15, 14],
            "faces": {
                "north": {"uv": [0, 0, 2, 1], "texture": "#1"},
                "east": {"uv": [0, 0, 1, 1], "texture": "#1"},
                "west": {"uv": [0, 0, 1, 1], "texture": "#1"},
                "up": {"uv": [0, 0, 2, 1], "texture": "#1"},
                "down": {"uv": [0, 0, 2, 1], "texture": "#1"}
            }
        }
	]
}

There's one or two more faces that could be removed (only visible from inside the oven space) but I left those

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Posted
  On 6/1/2018 at 7:10 PM, Draco18s said:

Ok, you have this face:

"east": {"uv": [0, 0, 1, 9], "texture": "#missing"},

Notice the missing texture reference?

That face can likely be removed as its internal to the model (hidden by another cube).

 

Systematically going through the model, I have removed all hidden faces. I did this by setting the texture to something known and easily visible (in this case, texture #2, as it was easy to type, used rarely, and bright red). I would identify a single portion of the model and decide which of its faces I could not see from any angle, and I'd remove them from the json file.

{
	"parent": "block/block",
	"textures": {
		"0": "blocks/iron_block",
		"1": "blocks/coal_block",
		"2": "blocks/redstone_block",
		"3": "blocks/glass",
		"4": "blocks/iron_bars",
		"particle": "blocks/iron_block"
	},
	"elements": [
		{
			"from": [0, 0, 2],
			"to": [16, 1, 16],
			"faces": {
				"north": {"uv": [0, 0, 16, 1], "texture": "#0"},
				"east": {"uv": [0, 0, 16, 1], "texture": "#0"},
				"south": {"uv": [0, 0, 16, 1], "texture": "#0"},
				"west": {"uv": [0, 0, 16, 1], "texture": "#0"},
				"up": {"uv": [0, 1, 16, 15], "texture": "#0"},
				"down": {"uv": [0, 1, 16, 15], "texture": "#0"}
			}
		},
		{
			"from": [0, 1, 15],
			"to": [16, 13, 16],
			"faces": {
				"north": {"uv": [0, 0, 16, 12], "texture": "#0"},
				"east": {"uv": [0, 0, 1, 12], "texture": "#0"},
				"south": {"uv": [0, 1, 16, 13], "texture": "#0"},
				"west": {"uv": [0, 0, 1, 12], "texture": "#0"}
			}
		},
		{
			"from": [15, 1, 2],
			"to": [16, 13, 15],
			"faces": {
				"north": {"uv": [0, 0, 1, 12], "texture": "#0"},
				"east": {"uv": [1, 3, 14, 15], "texture": "#0"},
				"west": {"uv": [1, 3, 14, 15], "texture": "#0"},
				"up": {"uv": [0, 0, 1, 13], "texture": "#0"}
			}
		},
		{
			"from": [0, 1, 2],
			"to": [1, 13, 15],
			"faces": {
				"north": {"uv": [0, 0, 1, 12], "texture": "#0"},
				"east": {"uv": [1, 3, 14, 15], "texture": "#0"},
				"west": {"uv": [1, 3, 14, 15], "texture": "#0"},
				"up": {"uv": [0, 0, 1, 13], "texture": "#0"}
			}
		},
		{
			"from": [1, 1, 2],
			"to": [15, 2, 3],
			"faces": {
				"north": {"uv": [1, 3, 15, 4], "texture": "#0"},
				"south": {"uv": [1, 2, 15, 3], "texture": "#0"},
				"up": {"uv": [1, 0, 15, 1], "texture": "#0"}
			}
		},
		{
			"from": [1, 11, 2],
			"to": [15, 13, 3],
			"faces": {
				"north": {"uv": [1, 0, 15, 2], "texture": "#0"},
				"south": {"uv": [1, 0, 15, 2], "texture": "#0"},
				"up": {"uv": [1, 0, 15, 1], "texture": "#0"},
				"down": {"uv": [1, 0, 15, 1], "texture": "#0"}
			}
		},
		{
			"from": [2, 2, 2],
			"to": [14, 11, 3],
			"faces": {
				"north": {"uv": [2, 3, 14, 12], "texture": "#3"},
				"south": {"uv": [2, 3, 14, 12], "texture": "#3"}
			}
		},
		{
			"from": [1, 12, 3],
			"to": [15, 13, 15],
			"faces": {
				"up": {"uv": [1, 1, 15, 13], "texture": "#0"},
				"down": {"uv": [1, 1, 15, 13], "texture": "#0"}
			}
		},
		{
			"from": [1, 2, 2],
			"to": [2, 11, 3],
			"faces": {
				"north": {"uv": [1, 2, 2, 11], "texture": "#0"},
				"east": {"uv": [0, 0, 1, 9], "texture": "#0"},
				"south": {"uv": [1, 2, 2, 11], "texture": "#0"}
			}
		},
		{
			"from": [14, 2, 2],
			"to": [15, 11, 3],
			"faces": {
				"north": {"uv": [1, 2, 2, 11], "texture": "#0"},
				"south": {"uv": [1, 2, 2, 11], "texture": "#0"},
				"west": {"uv": [0, 0, 1, 9], "texture": "#0"}
			}
		},
		{
			"from": [4, 11, 1],
			"to": [12, 12, 2],
			"faces": {
				"north": {"uv": [4, 4, 12, 5], "texture": "#1"},
				"east": {"uv": [0, 0, 1, 1], "texture": "#1"},
				"south": {"uv": [4, 4, 12, 5], "texture": "#1"},
				"west": {"uv": [0, 0, 1, 1], "texture": "#1"},
				"up": {"uv": [3, 7, 11, 8], "texture": "#1"},
				"down": {"uv": [6, 5, 14, 6], "texture": "#1"}
			}
		},
		{
			"from": [1, 3, 4],
			"to": [15, 4, 15],
			"faces": {
				"north": {"uv": [1, 0, 15, 1], "texture": "#4"},
				"up": {"uv": [1, 2, 15, 13], "texture": "#4"},
				"down": {"uv": [1, 2, 15, 13], "texture": "#4"}
			}
		},
		{
			"from": [0, 13, 14],
			"to": [16, 16, 16],
			"faces": {
				"north": {"uv": [0, 0, 16, 3], "texture": "#0"},
				"east": {"uv": [0, 0, 2, 3], "texture": "#0"},
				"south": {"uv": [0, 0, 16, 3], "texture": "#0"},
				"west": {"uv": [14, 0, 16, 3], "texture": "#0"},
				"up": {"uv": [0, 1, 16, 3], "texture": "#0"}
			}
		},
        {
            "from": [13, 14, 13],
            "to": [15, 15, 14],
            "faces": {
                "north": {"uv": [11, 6, 13, 7], "texture": "#2"},
                "east": {"uv": [0, 0, 1, 1], "texture": "#2"},
                "west": {"uv": [5, 3, 6, 4], "texture": "#2"},
                "up": {"uv": [4, 3, 6, 4], "texture": "#2"},
                "down": {"uv": [4, 3, 6, 4], "texture": "#2"}
            }
        },
        {
            "from": [1, 14, 13],
            "to": [3, 15, 14],
            "faces": {
                "north": {"uv": [0, 0, 2, 1], "texture": "#1"},
                "east": {"uv": [0, 0, 1, 1], "texture": "#1"},
                "west": {"uv": [0, 0, 1, 1], "texture": "#1"},
                "up": {"uv": [0, 0, 2, 1], "texture": "#1"},
                "down": {"uv": [0, 0, 2, 1], "texture": "#1"}
            }
        }
	]
}

There's one or two more faces that could be removed (only visible from inside the oven space) but I left those

Expand  

Okay, well its a lot better, but there is still a few issues. You can see the red and black blocks behind the block, and when to the side of the block you can sometimes see the handle through the door... The 2nd image is it being correctly viewed

 

2018-06-02_15.05.04.png

2018-06-02_15.05.11.png

2018-06-02_15.05.14.png

2018-06-02_15.05.15.png

2018-06-02_15.05.21.png

Developer of "A Realistic Foods Mod"

Posted

Show your block class

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Posted
  On 6/2/2018 at 11:28 PM, Draco18s said:

Show your block class

Expand  

Okay, well this block is also a furnace type block.

oven.java

  Reveal hidden contents

And since its extending BlockBase... heres that class:

BlockBase.java

  Reveal hidden contents

 

Developer of "A Realistic Foods Mod"

Posted
  On 6/3/2018 at 1:31 AM, SeanOMik said:
	@Override
	public BlockRenderLayer getBlockLayer() {
		return BlockRenderLayer.TRANSLUCENT;
	}

 

Expand  

Translucent layer means that things get rendered during the transparent rendering pass, and correctly sorting transparent triangles is hard.

 

I suggest changing it to Cutout. Glass and iron don't need full transparency.

 

But if you don't want to do that, there's a way to handle blocks like this as two passes, one part in a translucent pass, the rest during opaque, but I don't remember how to do that.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Posted
  On 6/3/2018 at 2:51 AM, Draco18s said:

Translucent layer means that things get rendered during the transparent rendering pass, and correctly sorting transparent triangles is hard.

 

I suggest changing it to Cutout. Glass and iron don't need full transparency.

 

But if you don't want to do that, there's a way to handle blocks like this as two passes, one part in a translucent pass, the rest during opaque, but I don't remember how to do that.

Expand  

Yup, seemed to be the issue thanks!

Developer of "A Realistic Foods Mod"

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.