Miika 11 Posted November 18, 2017 Hello! I have small script that replaces texture with image using shader and scrolls it from left to right. But i would like that there would be more images scrolling, example: coca cola ad, mcdonalds ad, etc... Would it be possible? I'm quite bad with shaders.. Shader: // // Example shader - uv_scroll.fx // /////////////////////////////////////////////////////////////////////////////// //Global variables /////////////////////////////////////////////////////////////////////////////// float gTime : TIME; /////////////////////////////////////////////////////////////////////////////// // Functions /////////////////////////////////////////////////////////////////////////////// //------------------------------------------- // Returns UV anim transform //------------------------------------------- float3x3 getTextureTransform () { float posU = -fmod( gTime/8 ,1 ); // Scroll Right float posV = 0; return float3x3( 1, 0, 0, 0, 1, 0, posU, posV, 1 ); } /////////////////////////////////////////////////////////////////////////////// // Techniques /////////////////////////////////////////////////////////////////////////////// texture Tex0; technique simple { pass P0 { Texture[0] = Tex0; // Set the UV thingy TextureTransform[0] = getTextureTransform (); // Enable UV thingy TextureTransformFlags[0] = Count2; } } Client-sided script: shader = dxCreateShader("shader.fx") coce = dxCreateTexture("bobo_3.png") dxSetShaderValue(shader, "Tex0", coce) engineApplyShaderToWorldTexture( shader, "buymorejeans") Share this post Link to post
IIYAMA 885 Posted November 19, 2017 (edited) Use a render target to merge multiple images. https://wiki.multitheftauto.com/wiki/DxCreateRenderTarget Edited November 19, 2017 by IIYAMA 1 Share this post Link to post
Ren_712 12 Posted December 3, 2017 you can use material3D_flipbook or material3D_blinds classes https://community.mtasa.com/index.php?p=resources&s=details&id=13314 so you don't need to apply shader to world texture but line mateiral. Share this post Link to post