parallax_cube.material
- .metadata230 B
- README.md2.0 KB
- mat.yaml1.5 KB
- preview.png81.7 KB
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_albedonormal_texture→bricks_normalroughness_metallic_texture→bricks_roughnessocclusion_texture→bricks_aoheight_texture→bricks_height, a depth map (white deepest), which the material states withheight_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.SetPropertymutations are global — every entity usingparallax_cubesees 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
pbrmaterial carries the same relief (height_texturewithparallax_depth_scale), withuv_scaleto tile it. It reads the map as height, white highest, unless the material setsheight_map_is_depth;bricks_heightonpbrtakesheight_map_is_depth = true.