Lua API
  • 🔎Overview
  • Introduction
    • 🚀Creating scripts
      • 🧠First Steps
      • 🖥️Adding UI
      • 📚Creating Libraries
  • API
    • 🌐Global Functions
    • ⚙️Instances
      • 🔢Math
      • ☎️Events
        • event_t
      • 🎮Game
        • global_vars_t
        • cengine_client
          • cnet_chan
        • ccsgo_input
        • cinput_system
        • cgame_ui_funcs
        • ccvar
          • convar
      • 🕹️Mods
        • events_t
      • ✏️Draw
        • ⚙️Types
          • ⚙️rect
          • ⚙️vec2
          • ⚙️color
          • ⚙️accessor
        • 🖥️Adapter
        • ✏️Layer
          • outline_mode
          • rounding
          • glow_parts
          • text_params
            • text_alignment
          • shadow_dir
          • command
            • render_mode
        • 🖼️Managed
          • 🖼️texture
            • svg_texture
            • animated_texture
          • 🖼️shader
          • ™️font_base
            • font
            • font_gdi
            • glyph_t
            • font_flags
      • 🙋Entities
        • entity_list_t
          • entity_entry_t
        • base_entity
          • schema_accessor_t
          • cs2_weapon_base_gun
          • cs2_player_pawn
          • cs2_player_controller
          • cs2_weapon_base
          • cs2_grenade_projectile
        • ccsweapon_base_vdata
          • cfiring_mode
        • chandle
        • csweapon_mode
        • csweapon_type
        • weapon_id
        • csweapon_category
        • observer_mode_t
      • 🖥️Gui
        • ⚙️Types
          • ⚙️bits
          • ⚙️control_id
        • context
          • user_t
        • context_input
          • mouse_button
        • notification_system
          • notification
        • control
          • control_type
          • value_param
          • checkbox
          • slider
          • label
          • selectable
          • button
          • color_picker
          • spacer
          • text_input
          • combo_box
          • image
        • container
          • control_container
            • layout
            • group
      • ⚙️Utils
    • ⚙️Types
      • ⚙️ptr
      • ⚙️ref_holder_t
      • ⚙️vector
      • ⚙️vector4d
      • 🎮veccolor
      • 🎮color
      • 🎮cview_setup
      • 🎮cuser_cmd
      • 🎮game_event_t
    • 🟰Enums
      • 🟰client_frame_stage
      • 🟰input_bit_mask
Powered by GitBook

© 2025 - FATALITY

On this page
  • texture
  • frag_shader
  • clip_rect
  • uv_rect
  • alpha
  • rotation
  • anti_alias
  • ignore_scaling
  • chained_call
  • only_downsampled
  • capture_back_buffer
  • is_tile
  • mode
  • set_texture
  • set_shader
Export as PDF
  1. API
  2. Instances
  3. Draw
  4. Layer

command

Previousshadow_dirNextrender_mode

Last updated 3 months ago

This type is used to change render command parameters.

Be cautious when changing stuff in an instance of this type. Passing invalid data to texture or frag_shader, or not restoring some changes after you're done drawing can lead to undefined behavior, and more likely, a crash. If you are not sure how to operate this type, take a look into examples.

texture

Type:

Texture pointer. You can get one from an instance of texture type by accessing obj field. Passing invalid data to this field WILL result in a crash. For a safer way, please use .


frag_shader

Type: Type:

Fragment shader (aka Pixel Shader in DirectX terms) pointer. You can get one from an instance of shader type by accessing obj field. Passing invalid data to this field WILL result in a crash. For a safer way, please use .


clip_rect

Type:

Clip rectangle used for scissor testing. If this is set to nil, will not clip anything.

It is advised to instead use layer's override_clip_rect method. While you can pass custom rect to this field, you will lose information about previous clip rects set before. Using that method will make sure to intersect the previous rect with the one you pass and produce a probably more expected result.


uv_rect

UV rect used for texture mapping. If this field is set to nil, will use 0, 0, 1, 1 rectangle to map the texture. You can learn more about texture mapping in the tutorial section.


alpha

Type: float

Global opacity override. Defaults to 1, but if you set anything else - will modulate opacity of every next shape you will render.


rotation

Type: float

Shape rotation. Not all shapes support this field. The value is set in degrees, not radians.


anti_alias

Type: bool

If set to true, will apply tesselation to shapes.

As of now, not every shape supports tesselation, but it is advised to have it enabled at all times anyway. It will produce much better result anyway.


ignore_scaling

Type: bool

If set to true, will ignore global DPI scale. This is set to true by default, but you are free to change it to false if you are trying to render some custom UI elements.


chained_call

Type: bool

Only useful when using shaders. If set to true, will not update back buffer texture. This can be used if you need the very same texture data, as when applying several shaders to the back buffer.

Please note that capturing back buffer is a rather slow operation. It is better to not capture it too often. Back buffer is automatically captured to the only layer you can use anyway, and it is better to use that one instead, to make sure rendering happens as fast as it is possible.


only_downsampled

Type: bool

If set to true, will capture back buffer (as long as chained_call is set to false). The name of this field is quite misleading due to the fact that in the CS:GO version of Fatality, it was used to configure if the rendering system should also downsample the captured backbuffer into another texture. In DirectX11, this operation is much faster, so it is done regardless.


capture_back_buffer

Type: bool

An alias to only_downsampled.


is_tile

Type: bool

If set to true, will use a separate texture sampler that supports tiling. By default, all textures are stretched, but if you enable this option - their tiling and stretch will be fully configurable by the uv_rect field.


mode

Rendering mode. You can read more about it in the type's documentation.


set_texture

Sets a texture in a safe manner.

Arguments

Name

Type

Description

tex

Texture object.

Returns

Nothing.

Example

cmd:set_texture(my_tex);

set_shader

Sets a fragment shader in a safe manner.

Arguments

Name

Type

Description

sh

[shader]

Shader object.

Returns

Nothing.

Example

cmd:set_shader(my_shader);

Type:

Type:

⚙️
✏️
✏️
rect?
render_mode
ptr
ptr
rect?
set_texture
set_shader
texture