Work with Level of Detail and GeoGroup Nodes

Using Lua to interact with LOD and GeoGroup nodes

Level of Detail (LOD) nodes control the visibility of geogroups based on camera distance. Geogroup nodes contain renderable meshes.

LOD Properties

Property

Type

Description

Enabled

boolean

Enabled or disabled. When disabled, no models under this LOD are rendered.

InOut

number[2]

Distance between which this LOD is rendered (rendered when view is at least In metres away, no longer rendered when further than Out metres away)

RefPoint

number[3]

Local coordinate from which the LOD distance is calculated

LOD Example

Simple script example which prints to the Log window details of the LOD including the in-out distances and the LOD reference point.

-- Drag/Drop section BEGINS - Do not edit between BEGINS and ENDS.
local LODX = __Script.dragdrop.LODX
-- Drag/Drop section ENDS

-- Simply prints out the attributes of a LOD
print(LODX.Enabled)
print("In distance ", LODX.InOut[1], " Out distance ", LODX.InOut[2])
print("Ref pt ", LODX.RefPoint)

GeoGroup Properties

Property

Type

Description

Enabled

boolean

Enabled or disabled. When disabled, child meshes are not rendered.

Material

vrnode

Link to a material to render this GeoGroup with

CullFace

number

Cull face mode. See the Cull Face mode table below.

LockMaterial

boolean

Indicates if the material can be overridden on the Visual level.

DrawMode

number

Draw mode overriding the values in the GeoGroups. See the Draw Mode table below.

BakedLighting

boolean

Apply the GeoGroup's stored baked lighting. NOTE: The GeoGroup needs to contain baked lighting information for this property to have any effect. This is usually read from imported files.

ShadowCaster

boolean

Indicates that the GeoGroup should cast shadows when lit by a shadow casting light.

IgnoreCoverageLOD

boolean

Indicates whether this GeoGroup should ignore the coverage LOD setting and render even when failing the test.

Cull Face Modes

These modes control which faces of geometry in the model are rendered.

Mode

Description

__GeoGroup_CullFaceNone

Does not cull any faces (both back and front are drawn)

__GeoGroup_CullFaceBack

Culls back faces

__GeoGroup_CullFaceFront

Culls front faces

Draw Modes

These modes control how the model is rendered

Mode

Description

__GeoGroup_DrawModeSolid

Forces solid rendering (model faces are filled)

__GeoGroup_DrawModeLines

Forces line rendering (model is drawn as wireframe)

__GeoGroup_DrawModePoints

Forces point rendering (only the vertices are drawn)

GeoGroup Example

Simple script which checks the current DrawMode of a GeoGroup and changes it to the next possible Mode. This script would typically be called on a keypress event.

-- Drag/Drop section BEGINS - Do not edit between BEGINS and ENDS.
local Geo = __Script.dragdrop.Geo
-- Drag/Drop section ENDS

-- Geogroup example

-- Simple check of current GeoGroup DrawMode
-- then change it to another mode
if Geo.DrawMode == __GeoGroup_DrawModeSolid then
   print("__GeoGroup_DrawModeSolid")
   Geo.DrawMode = __GeoGroup_DrawModeLines
elseif Geo.DrawMode == __GeoGroup_DrawModeLines then
   print("__GeoGroup_DrawModeLines")
   Geo.DrawMode = __GeoGroup_DrawModePoints
elseif Geo.DrawMode == __GeoGroup_DrawModePoints then
   print("__GeoGroup_DrawModePoints")
   Geo.DrawMode = __GeoGroup_DrawModeSolid
end


No Results.

Getting StartedArchitectureBest PracticesHow ToAdvanced TopicsChangelogvrtreevrtree_cppvtCoreCoreForeign Function InterfaceMetanodesMigrationsObserversPropertiesSettingsTreeUtilitiesAPI DefinitionsVR ExchangePluginsLua API