Log inGet started
Package

parallax_cube.material

Newest version

This package holds more than this page lists. See all of its files in its world.

README.md

parallax_cube

Brick wall material using @builtin::shaders.pbr_parallax_occlusion with the parallax march enabled (parallax_depth_scale = 0.025, 48 ray-march layers). Pair with parallax_cube_flat for a same-textures, no-POM A/B comparison.

The depth scale is in UV units, the furthest the march moves a UV, and it stays below the pitch of the courses the height map draws (about 0.033 of a tile): a relief deeper than a course draws the side of each brick across the course below it, stretched from the texels at its edge.

Shader

@builtin::shaders.pbr_parallax_occlusion — see that shader's README for the full parameter list.

Textures

All from @builtin::textures.parallax_bricks (height/normal derived from three.js's MIT-licensed brick_bump + brick_diffuse):

  • base_color_texture → bricks_albedo
  • normal_texture → bricks_normal
  • roughness_metallic_texture → bricks_roughness
  • occlusion_texture → bricks_ao
  • height_texture → bricks_height, a depth map (white deepest), which the material states with height_map_is_depth: true

Usage

Material.Apply(entityId, "parallax_cube")
-- Override at runtime:
Material.SetProperty("parallax_cube", "parallax_depth_scale", 0.03)

Pair it with parallax_cube_flat (same textures, parallax_depth_scale = 0) to compare the ray-marched surface against a flat-mapped baseline.

Notes

  • Material.SetProperty mutations are global — every entity using parallax_cube sees the change. If you need per-entity variation, derive a new material name and override the property there.
  • The relief draws under a forward and a deferred camera alike.
  • A pbr material carries the same relief (height_texture with parallax_depth_scale), with uv_scale to tile it. It reads the map as height, white highest, unless the material sets height_map_is_depth; bricks_height on pbr takes height_map_is_depth = true.