Skip to main content

Class: ShaderClock

Constructors​

constructor​

• new ShaderClock(): ShaderClock

Returns​

ShaderClock

Properties​

isShared​

• isShared: boolean = true

Whether the clock follows the shared clock. Off, it runs on local frame time from zero like the old page-uptime clock: an A/B switch.

Accessors​

seconds​

• get seconds(): number

Seconds, unwrapped: what the clock reads now.

Returns​

number


wrappedSeconds​

• get wrappedSeconds(): number

Seconds in [0, SHADER_CLOCK_WRAP_SECONDS): what the uniform holds.

Returns​

number

Methods​

advance​

▸ advance(shared, deltaSeconds): number

Advances by one frame toward shared, the world's shared clock, and returns the unwrapped reading.

Parameters​

NameType
sharednumber
deltaSecondsnumber

Returns​

number