Renderer - stingray.Renderer namespace reference - Stingray Lua API Reference

stingray.Renderer namespace reference

Description

Interface to create/destroy render resources.

Functions

Parameters

type :

string

Type of GPU resource to create, must be "render_target"

format :

string

Pixel format for render_target, must be "R8G8B8A8"

width :

integer

Width of render target in pixels

height :

integer

Height of render target in pixels

Returns

stingray.RenderResource

The new render resource

NOTE: This interface will be extended with more options in the future.

Parameters

resource :

stingray.RenderResource

Type RenderResource you want to destroy

Returns
This function does not return any values.
Parameters
This function does not accept any parameters.
Returns

boolean

true if D3D12 is supported by the engine, or false otherwise.

Parameters

name :

string

The name of the resource to load

Returns

stingray.RenderResource

The render resource

NOTE: This interface will be extended with more options in the future.

Parameters

generator :

string

Name of resource generator to run

resource_mapping :

table

Binding table, associates slot name with user crated RenderResource

Returns
This function does not return any values.

Typically this function should be called within the Gameplay layer's rendering scope before any World rendering has happened.

For example:

stingray.Renderer.run_resource_generator(self.resource_generator_name, {output_color = self.color})

Texture streaming

These functions control the behavior of the texture streaming system.

Parameters
This function does not accept any parameters.
Returns
This function does not return any values.

Calling this function overrides the automatic mip level selection made by the texture streamer. However, if the texture streaming system is set to stream textures automatically, your instruction will be overridden the next time the system chooses the best mip level for it to display. If you want to set mip levels in your own code, you will probably also want to disable automatic streaming by calling set_automatic_streaming(false).

Parameters

on_off :

boolean

Use true to enable immediate streaming mode, or false to disable (the default).

Returns
This function does not return any values.

In this mode, the texture streaming system loads all requested mip levels immediately within the same frame they are first needed. This mode will prevent high-quality mip levels from being visibly loaded in after they are needed. However, it may also cause slowdowns in the frame rate of the game.

Parameters

on_off :

boolean

Use true to allow the streamer to go over its maximum memory pool size, or false to cap the size of the shared memory pool (the default).

Returns
This function does not return any values.
Parameters
This function does not accept any parameters.
Returns
This function does not return any values.

Calling this function overrides the automatic mip level selection made by the texture streamer. However, if the texture streaming system is set to stream textures automatically, your instruction will be overridden the next time the system chooses the best mip level for it to display. If you want to set mip levels in your own code, you will probably also want to disable automatic streaming by calling set_automatic_streaming(false).

Parameters

on_off :

boolean

Use true to enable automatic streaming (the default), or false to disable.

Returns
This function does not return any values.

If you pass false to this function, the texture streaming system will no longer stream texture data unless you explicitly instruct it to by calling other functions in this interface, like set_texture_requested_mip_level() or request_textures_to_highest_mip_level().

Parameters

texture_resource :

string

The name of the texture resource whose mip level you want to set.

mip_level :

integer

The mip level you want to load for the specified texture. This is a zero-based value that indexes mip levels starting from the smallest and least detailed. So, 0 refers to the lowest resolution mip level, 1 refers to the next smallest level, etc. For example, if a texture has 10 mip levels, and you want to request the most detailed level, you should use 9.

Returns
This function does not return any values.

Calling this function overrides the automatic mip level selection made by the texture streamer. However, if the texture streaming system is set to stream textures automatically, your instruction will be overridden the next time the system chooses the best mip level for it to display for that texture. If you want to set mip levels in your own code, you will probably also want to disable automatic streaming by calling set_automatic_streaming(false).