LODMap

Overview

LODMap creates a mask based on pixel footprint (using the same state determining Level Of Detal in a texture) or distance from the camera. The mode parameter chooses which to use in the map.


Attribute Reference

General attributes

far_value

Rgb bindable
default: [ 1, 1, 1 ]

value output when feature_width/camera_distance is more than or equal to stop

mode

Int enum
  0 = “feature width” (default)
  1 = “camera distance”

Use feature_width for LOD based on average, world-space feature-width visible in a pixel, correctly changing with resolution. Use camera_distance for LOD based on distance from render cam.

near_value

Rgb bindable
default: [ 0, 0, 0 ]

value output when feature_width/camera_distance is less than or equal to start

start

Float
default: 0.01

feature_width/camera_distance at which to start blending near_value->far_value

stop

Float
default: 0.1

feature_width/camera_distance at which to stop blending near_value->far_value


Examples

local lodMapTopPixelWidth = LODMap("/Scene/surfacing/LODMapPixelWidth") {
}

local lodMapCamera = LODMap("/Scene/surfacing/LODMapCamera") {
    ["mode"] = "camera distance",
    ["start"] = 1,
    ["stop"]  = 100
}