- Documentation
- Shaders
Category
Shaders
All Lua functions and events in the Shaders category, on the server and the client.
Client functions 9
dxCreates a shader from a resource .fx file or from code given as a string. In Trilogy Hub a shader performs texture replacement: the image set withCreate Shader dxSetShaderValueunder a texture parameter replaces the world textures chosen withengineApplyShaderToWorldTexture(e.g. custom billboards, signs on buildings, car wraps). The game material stays (lighting, reflections); only the image changes. Pixel and vertex effects from HLSL code are not executed.dxSets the mesh density for a shader's vertex effects. In Trilogy Hub it has no effect, because shaders only perform texture replacement.Set Shader Tessellation dxRotates a shader image drawn withSet Shader Transform dxDrawImagein 3D. Not supported - always returnsfalse.dxSets a shader parameter. When the parameter is a texture declared in the .fx code (or the shader has none) and the value is a texture (Set Shader Value dxCreateTexture, render target, browser) or an image path, that image becomes the new texture swapped into the world. Numbers and vectors are stored for compatibility with existing scripts.engineReplaces a San Andreas world texture with the given name with the shader's image. The name may containApply Shader To World Texture *and?(e.g."vehiclegrunge*"). Without an element the replacement applies to all objects with that texture, including those loaded later; with an element (vehicle, object, ped) - only to it. The names of textures currently visible in the game are returned byengineGetVisibleTextureNames.engineReplaces a world texture with a script texture without writing a shader: a texture fromApply Texture To World Texture dxCreateTexture, a render target, a screen source or a browser is enough. Works likeengineApplyShaderToWorldTexture(*and?patterns, optional element). A render target or browser gives a live image, e.g. an in-game TV showing a web page.engineReturns the names of San Andreas textures currently loaded in the game (around the player), with an optionalGet Visible Texture Names *and?filter. Helps find a texture name to replace: stand next to an object and print the list. The second argument (model) is ignored.engineRemoves a texture replacement made withRemove Shader From World Texture engineApplyShaderToWorldTexture- you must pass the same name pattern and the same element. The original game texture comes back.engineRemoves a replacement made withRemove Texture From World Texture engineApplyTextureToWorldTexture(the same texture, pattern and element). The original comes back.