Jump to content

Recommended Posts

Posted (edited)

I have a custom IBakedModel that delegates all methods except for getQuads to the model that it replaces.  It works great aside from two issues:

  1. The block break cracks do not render.  I've looked at other peoples' custom IBakedModels and it doesn't appear that they have any custom code to render this.  Is it supposed to render automatically?
  2. When in item form (ie. in a player's hand) the depth buffer doesn't seem to work.  The different layers of the model render on top of each other.  I'll attach a screenshot for this one.

 

Spoiler

image.thumb.png.9a801553504dfab5acbe5e1b39ae8962.png

image.thumb.png.621c3d8dbbc2965432fe4d24ed336adc.png

image.thumb.png.ad1ab752e371df8b3926a25354b65523.png

 

getQuads adds vertices for the block itself on the CUTOUT_MIPPED layer, and vertices for the fluids on the TRANSLUCENT layer.  Here's the underlying model:

Spoiler

{
  "credit": "Made with Blockbench",
  "textures": {
    "0": "gradient:blocks/bronze_machine_hull",
    "1": "gradient:blocks/bronze_boiler.glass",
    "particle": "gradient:blocks/bronze_machine_hull"
  },
  "elements": [
    {
      "name": "bottom",
      "from": [0, 0, 0],
      "to": [16, 1, 16],
      "faces": {
        "north": {"uv": [0, 15, 16, 16], "texture": "#0"},
        "east": {"uv": [0, 15, 16, 16], "texture": "#0"},
        "south": {"uv": [0, 15, 16, 16], "texture": "#0"},
        "west": {"uv": [0, 15, 16, 16], "texture": "#0"},
        "up": {"uv": [0, 0, 16, 16], "texture": "#0"},
        "down": {"uv": [0, 0, 16, 16], "texture": "#0"}
      }
    },
    {
      "name": "top",
      "from": [0, 15, 0],
      "to": [16, 16, 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, 0, 16, 16], "texture": "#0"},
        "down": {"uv": [0, 0, 16, 16], "texture": "#0"}
      }
    },
    {
      "name": "middle",
      "from": [0, 7, 0],
      "to": [16, 9, 16],
      "faces": {
        "north": {"uv": [0, 7, 16, 9], "texture": "#0"},
        "east": {"uv": [0, 7, 16, 9], "texture": "#0"},
        "south": {"uv": [0, 7, 16, 9], "texture": "#0"},
        "west": {"uv": [0, 7, 16, 9], "texture": "#0"},
        "up": {"uv": [0, 0, 16, 16], "texture": "#0"},
        "down": {"uv": [0, 0, 16, 16], "texture": "#0"}
      }
    },
    {
      "name": "north",
      "from": [0, 1, 0],
      "to": [16, 7, 0],
      "faces": {
        "north": {"uv": [0, 0, 16, 6], "texture": "#1", "cullface": "north"},
        "south": {"uv": [16, 0, 0, 6], "texture": "#1", "cullface": "north"}
      }
    },
    {
      "name": "south",
      "from": [0, 1, 16],
      "to": [16, 7, 16],
      "faces": {
        "south": {"uv": [0, 0, 16, 6], "texture": "#1", "cullface": "south"},
        "north": {"uv": [16, 0, 0, 6], "texture": "#1", "cullface": "south"}
      }
    },
    {
      "name": "east",
      "from": [16, 1, 0],
      "to": [16, 7, 16],
      "faces": {
        "east": {"uv": [0, 0, 16, 6], "texture": "#1", "cullface": "east"},
        "west": {"uv": [16, 0, 0, 6], "texture": "#1", "cullface": "east"}
      }
    },
    {
      "name": "west",
      "from": [0, 1, 0],
      "to": [0, 7, 16],
      "faces": {
        "west": {"uv": [0, 0, 16, 6], "texture": "#1", "cullface": "west"},
        "east": {"uv": [16, 0, 0, 6], "texture": "#1", "cullface": "west"}
      }
    },
    {
      "name": "north",
      "from": [0, 9, 0],
      "to": [16, 15, 0],
      "faces": {
        "north": {"uv": [0, 0, 16, 6], "texture": "#1", "cullface": "north"},
        "south": {"uv": [16, 0, 0, 6], "texture": "#1", "cullface": "north"}
      }
    },
    {
      "name": "south",
      "from": [0, 9, 16],
      "to": [16, 15, 16],
      "faces": {
        "south": {"uv": [0, 0, 16, 6], "texture": "#1", "cullface": "south"},
        "north": {"uv": [16, 0, 0, 6], "texture": "#1", "cullface": "south"}
      }
    },
    {
      "name": "east",
      "from": [16, 9, 0],
      "to": [16, 15, 16],
      "faces": {
        "east": {"uv": [0, 0, 16, 6], "texture": "#1", "cullface": "east"},
        "west": {"uv": [16, 0, 0, 6], "texture": "#1", "cullface": "east"}
      }
    },
    {
      "name": "west",
      "from": [0, 9, 0],
      "to": [0, 15, 16],
      "faces": {
        "west": {"uv": [0, 0, 16, 6], "texture": "#1", "cullface": "west"},
        "east": {"uv": [16, 0, 0, 6], "texture": "#1", "cullface": "west"}
      }
    }
  ],
  "display": {
    "thirdperson_righthand": {
      "scale": [0.375, 0.375, 0.375],
      "rotation": [75, 45, 0],
      "translation": [0, 2.5, 0]
    },
    "thirdperson_lefthand": {
      "scale": [0.375, 0.375, 0.375],
      "rotation": [75, 45, 0],
      "translation": [0, 2.5, 0]
    },
    "firstperson_righthand": {
      "scale": [0.4, 0.4, 0.4],
      "rotation": [0, 45, 0],
      "translation": [0, 0, 0]
    },
    "firstperson_lefthand": {
      "scale": [0.4, 0.4, 0.4],
      "rotation": [0, 225, 0],
      "translation": [0, 0, 0]
    },
    "ground": {
      "scale": [0.25, 0.25, 0.25],
      "rotation": [0, 0, 0],
      "translation": [0, 3, 0]
    },
    "fixed": {
      "scale": [0.5, 0.5, 0.5],
      "rotation": [0, 0, 0],
      "translation": [0, 0, 0]
    },
    "gui": {
      "scale": [0.625, 0.625, 0.625],
      "rotation": [30, 225, 0],
      "translation": [0, 0, 0]
    }
  },
  "groups": [0, 1, 2,
    {
      "name": "water",
      "isOpen": true,
      "shade": true,
      "display": {
        "visibility": true,
        "autouv": true
      },
      "children": [3, 4, 5, 6]
    },
    {
      "name": "steam",
      "isOpen": true,
      "shade": true,
      "display": {
        "visibility": true,
        "autouv": true
      },
      "children": [7, 8, 9, 10]
    }
  ]
}

 

 

Edited by Corey

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.