isHdActive
isHdActive: (Gfx) -> booleanWhether the client is drawing with its HD renderer right now (client.HD_ACTIVE). Raises on a build that does not place that field, rather than answering false: false is SD.
gfx| Method | Returns | Description |
|---|---|---|
isHdActive() | boolean | Whether the client is drawing with its HD renderer right now (client.HD_ACTIVE). Raises on a build that does not place that field, rather… |
isHdRequested() | boolean | Whether HD has been asked for (client.HD_REQUESTED). It can differ from isHdActive: the client picks the request up when it next applie… |
isDeferredRendering() | boolean | Whether the GL context records its draws for the deferred-render thread to replay (the render preferences' deferred-rendering flag). Raises… |
hasHdRenderer() | boolean | Whether the client holds an HD renderer (its renderer global is non-zero). False in SD. Raises on a build that does not place the global, o… |
setHdRequested(boolean) | () | Ask the client for HD (true) or SD (false) through its own switch, applied at the top of the next client tick, which clears its model c… |
setHdLook(boolean) | () | Which look HD draws with: the full one (true: sun, skybox, the map's environment), or the client's flat-lit default (false). Holds for… |
isAvailable() | boolean | Whether the post-process pipeline can run on this client. |
getCapabilities() | {string} | What holds on this client: any of "postfx", "environment" and "depth" (the fog and sky passes may read scene depth on this build), "lights"… |
getUnavailableReason() | string | Why the pipeline cannot run here, for a settings page: "" when it can. |
getPasses() | {string} | Every pass, in the order they run. |
setPassEnabled(string, boolean) | () | Ask for a pass or stop asking. Asking again brings back a pass the frame budget dropped. Raises on a pass that does not exist. |
isPassEnabled(string) | boolean | Whether a pass is asked for. |
getPassState(string) | string | What a pass is doing: "off", "on", "failed" (its shader or GL failed, off for the session) or "dropped" (over the frame budget, ask again t… |
setParam(string, number) | () | Set a param, pass.knob, or budget.ms. Raises on a name that does not exist and on a value outside its range, rather than clamping, so a… |
getParam(string) | number | A param's value. |
setLights({number}) | () | Replace the lights: a flat list of x, y, z, radius, r, g, b, strength. x and y are world tiles (fractions allowed), z is height above the g… |
clearLights() | () | Remove every light. |
setLut({number}, number) | () | Replace the colour LUT: packed ARGB of a size by size by size cube, as a size*size by size strip. grade.lut says how much of it shows. |
getDepthSource() | string | Where the depth passes got depth last frame: "none", "sd-copy", "sd-resolve" or "hd". |
getFrameMs() | number | The last frame's post-process cost in milliseconds. |
getAntiAliasing() | number? | The client's own anti-aliasing level, with 2 ^ level samples. nil where it cannot run on this build. |
getAntiAliasingMax() | number? | The highest level setAntiAliasing takes. nil where it cannot run on this build. |
setAntiAliasing(number) | boolean | Ask for the client's own anti-aliasing at a level, set at the top of the next client tick through its own setting, so it is the player's se… |
setRetexture(string, number, {number}, {number}) | boolean | Replace textures on a type: kind is "loc", "npc", "obj", "spotanim" or "kit", find and replace are the client's texture ids, paired.… |
setOverlayTexture(number, number) | boolean | Set an overlay's texture, shown from the next scene build. False when the overlay does not exist or overlays are not loaded yet. |
clearOverrides() | () | Forget every retexture and put every overlay back. Types the client already rebuilt keep their lists until flushOverrides. |
flushOverrides() | boolean | Have the client rebuild its types and reload the scene at the top of the next tick, with its loading screen. For types it had already loade… |
isHdActiveisHdActive: (Gfx) -> booleanWhether the client is drawing with its HD renderer right now (client.HD_ACTIVE). Raises on a build that does not place that field, rather than answering false: false is SD.
isHdRequestedisHdRequested: (Gfx) -> booleanWhether HD has been asked for (client.HD_REQUESTED). It can differ from isHdActive: the client picks the request up when it next applies it. Raises on a build that does not place that field.
isDeferredRenderingisDeferredRendering: (Gfx) -> booleanWhether the GL context records its draws for the deferred-render thread to replay (the render preferences' deferred-rendering flag). Raises on a build that does not place it, or before the client has its render preferences.
hasHdRendererhasHdRenderer: (Gfx) -> booleanWhether the client holds an HD renderer (its renderer global is non-zero). False in SD. Raises on a build that does not place the global, or when it cannot be read.
setHdRequestedsetHdRequested: (Gfx, boolean) -> ()Ask the client for HD (true) or SD (false) through its own switch, applied at the top of the next client tick, which clears its model caches and reloads the scene; nothing happens if it is already in that mode. Not a write of the request byte: that alone would leave the request and isHdActive disagreeing. Game thread only; raises when not logged in, when the client forbids HD, and on a client whose table has the switch off.
setHdLooksetHdLook: (Gfx, boolean) -> ()Which look HD draws with: the full one (true: sun, skybox, the map's environment), or the client's flat-lit default (false). Holds for the session, including the default the client puts back at each login, and waits for HD if asked in SD. Changing it while HD is on reloads the scene. Raises on a client whose table has the switch off.
isAvailableisAvailable: (Gfx) -> booleanWhether the post-process pipeline can run on this client.
getCapabilitiesgetCapabilities: (Gfx) -> {string}What holds on this client: any of "postfx", "environment" and "depth" (the fog and sky passes may read scene depth on this build), "lights" and "typeOverrides". Empty where the pipeline cannot run. Cheap enough for every tick. It is about the build, not a frame: getPassState says when a pass stood aside, getDepthSource where depth came from.
getUnavailableReasongetUnavailableReason: (Gfx) -> stringWhy the pipeline cannot run here, for a settings page: "" when it can.
getPassesgetPasses: (Gfx) -> {string}Every pass, in the order they run.
setPassEnabledsetPassEnabled: (Gfx, string, boolean) -> ()Ask for a pass or stop asking. Asking again brings back a pass the frame budget dropped. Raises on a pass that does not exist.
isPassEnabledisPassEnabled: (Gfx, string) -> booleanWhether a pass is asked for.
getPassStategetPassState: (Gfx, string) -> stringWhat a pass is doing: "off", "on", "failed" (its shader or GL failed, off for the session) or "dropped" (over the frame budget, ask again to bring it back).
setParamsetParam: (Gfx, string, number) -> ()Set a param, pass.knob, or budget.ms. Raises on a name that does not exist and on a value outside its range, rather than clamping, so a data bug shows.
getParamgetParam: (Gfx, string) -> numberA param's value.
setLightssetLights: (Gfx, {number}) -> ()Replace the lights: a flat list of x, y, z, radius, r, g, b, strength. x and y are world tiles (fractions allowed), z is height above the ground in tiles, radius is in tiles and rgb is 0 to 1. A light off the loaded scene is left out. Call it when the set changes and after a scene load.
clearLightsclearLights: (Gfx) -> ()Remove every light.
setLutsetLut: (Gfx, {number}, number) -> ()Replace the colour LUT: packed ARGB of a size by size by size cube, as a size*size by size strip. grade.lut says how much of it shows.
getDepthSourcegetDepthSource: (Gfx) -> stringWhere the depth passes got depth last frame: "none", "sd-copy", "sd-resolve" or "hd".
getFrameMsgetFrameMs: (Gfx) -> numberThe last frame's post-process cost in milliseconds.
getAntiAliasinggetAntiAliasing: (Gfx) -> number?The client's own anti-aliasing level, with 2 ^ level samples. nil where it cannot run on this build.
getAntiAliasingMaxgetAntiAliasingMax: (Gfx) -> number?The highest level setAntiAliasing takes. nil where it cannot run on this build.
setAntiAliasingsetAntiAliasing: (Gfx, number) -> booleanAsk for the client's own anti-aliasing at a level, set at the top of the next client tick through its own setting, so it is the player's setting too and is saved with their preferences. A renderer switch can put back the level the client cached, so set it after one. False where it cannot run on this build, or for a negative level.
setRetexturesetRetexture: (Gfx, string, number, {number}, {number}) -> booleanReplace textures on a type: kind is "loc", "npc", "obj", "spotanim" or "kit", find and replace are the client's texture ids, paired. Put back each time the client builds that type, so one call at startup lasts; a type it already loaded takes it at the next flushOverrides. An NPC only changes textures it already replaces. In SD an untextured model cannot gain a texture. False when overrides cannot run here, the kind is unknown, or the lists do not pair up; an id that never loads is simply never used.
setOverlayTexturesetOverlayTexture: (Gfx, number, number) -> booleanSet an overlay's texture, shown from the next scene build. False when the overlay does not exist or overlays are not loaded yet.
clearOverridesclearOverrides: (Gfx) -> ()Forget every retexture and put every overlay back. Types the client already rebuilt keep their lists until flushOverrides.
flushOverridesflushOverrides: (Gfx) -> booleanHave the client rebuild its types and reload the scene at the top of the next tick, with its loading screen. For types it had already loaded when their overrides were registered. False where overrides cannot run, or the client is not logged in by then.