Interface to create/destroy render resources.
Other related reference items
Related help topics
create_resource ( type, format, width, height ) : stingray.RenderResourceCreates a GPU resource.
|
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 |
The new render resource |
NOTE: This interface will be extended with more options in the future.
destroy_resource ( resource )Destroys a GPU resource.
|
resource : | Type RenderResource you want to destroy |
This function does not return any values. |
is_d3d12_supported ( ) : booleanQuery if D3D12 is supported by the engine.
|
This function does not accept any parameters. |
boolean |
true if D3D12 is supported by the engine, or false otherwise. |
resource ( name ) : stingray.RenderResourceReturns an existing GPU resource.
|
name : | string | The name of the resource to load |
The render resource |
NOTE: This interface will be extended with more options in the future.
run_resource_generator ( generator, resource_mapping )Runs an arbitrary resource generator wihtin the render_config file.
|
generator : | string | Name of resource generator to run |
resource_mapping : | table | Binding table, associates slot name with user crated RenderResource |
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})
These functions control the behavior of the texture streaming system.
This function does not accept any parameters. |
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).
immediate_streaming ( on_off )Toggles immediate streaming mode.
|
on_off : | boolean | Use true to enable immediate streaming mode, or false to disable (the default). |
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.
override_texture_pool_size ( on_off )Determines whether or not the texture streaming system is permitted to increase the size of its shared memory pool above the limit set by the streaming_texture_pool_size setting in the project's settings.ini file.
|
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). |
This function does not return any values. |
This function does not accept any parameters. |
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).
Other related reference items
set_automatic_streaming ( on_off )Toggles automatic texture streaming.
|
on_off : | boolean | Use true to enable automatic streaming (the default), or false to disable. |
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().
Other related reference items
set_texture_requested_mip_level ( texture_resource, mip_level )Requests the texture streaming system to load a specific mip level for the specified texture.
|
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. |
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).
Other related reference items