External GLBs

GLB Support

The Hiber Engine has basic support for loading 3D assets in the .glb format.

ℹ️

External files must be hosted somewhere, and are not uploaded by HDK.

Basic usage

import { HNode, render, GLB } from '@hiber3d/hdk-react';
import { Ground } from '@hiber3d/hdk-react-components';
 
const World = () => (
  <HNode y={-1}>
    <Ground />
    <GLB z={4} src="https://cdn.hibervr.com/external/hdk/en_p_cube_sculpture_01.glb" />
  </HNode>
);
 
render(<World />);

External GLB

Advanced usage

A GLB may contain lots of information. An HNode can refer to a single mesh and material in its rendering prop. We can however pick out a node from the GLB by appending a hash with the mesh name to the url:

<GLB src="https://example.com/example.glb#helmet" />

Caveats

  • The Hiber Engine will only render one mesh and material per HNode
  • When running locally, your CDN may prevent loading assets
  • The first node of a GLB cannot be referred to by name. Not appending a name to the meshId/materialId will choose the first one.
  • The max vertex count on external GLBs is 65 535

Recommendation

Our recommendation is to join your meshes into a single mesh.