xScatta Posted January 25, 2015 Posted January 25, 2015 Hey guys. How can i apply image to texture? I don't mean replacing it cause i know how to do it. I want to apply image to an texture i wan't to choose the opacity or alpha of the texture applied. Thanks. Or how to make rust shader so i can apply it to anything. It's fine to celebrate success but it is more important to heed the lessons of failure.
MTA Team botder Posted January 26, 2015 MTA Team Posted January 26, 2015 Do you want to fuse 2 pictures together? Make a render target big enough to fit the images. Get the pixels (result) with dxGetTexturePixels and convert them to a PNG with dxConvertPixels or use the render target to render both images at once. You can also load an image as texture with the dxCreateTexture function and then also draw the image with the texture. GitHub: Debug Console • MTA-Discord Relay Scripting: How to draw a line chart with DirectX functions? • Doppler Effect in MTA • Get the client's FPS • Customizable Blur Shader
xScatta Posted January 29, 2015 Author Posted January 29, 2015 No no. I wan't to apply an image .png to a texture in MTA:SA but not completely replace it, just apply it so two textures will be visible. Like that: applying image texture = : actual ingame texture = I :I It's fine to celebrate success but it is more important to heed the lessons of failure.
MTA Team botder Posted January 29, 2015 MTA Team Posted January 29, 2015 Do you want to lay the image .png on the texture in MTA or move the original one and place it next to it? GitHub: Debug Console • MTA-Discord Relay Scripting: How to draw a line chart with DirectX functions? • Doppler Effect in MTA • Get the client's FPS • Customizable Blur Shader
xScatta Posted January 29, 2015 Author Posted January 29, 2015 I want to lay a .png so it will be applied to the MTA texture, So the mta texture will be visible UNDER the transparent places of the image applied It's fine to celebrate success but it is more important to heed the lessons of failure.
xScatta Posted January 30, 2015 Author Posted January 30, 2015 *BUMP* It's fine to celebrate success but it is more important to heed the lessons of failure.
xScatta Posted February 2, 2015 Author Posted February 2, 2015 *BUMP* x2... Really? It's fine to celebrate success but it is more important to heed the lessons of failure.
Dealman Posted February 2, 2015 Posted February 2, 2015 Are you looking to make something like a dynamic texture? Similar to this? If I help you in a thread and you need further assistance, please don't PM me - use the thread you created instead. This way everyone on the forum can take advantage of it.
Ren_712 Posted February 3, 2015 Posted February 3, 2015 Hey guys. How can i apply image to texture? I don't mean replacing it cause i know how to do it. I want to apply image to an texture i wan't to choose the opacity or alpha of the texture applied. Thanks. Or how to make rust shader so i can apply it to anything. If it is a world texture then this might be enough: http://pastebin.com/CP3Ujccx This lerps between the original texture and an additional one (by the alpha channel of the additional texture). Use gColorMult to manipulate all the colors and alpha. Manipulating the alpha - sets whether you want to see the original or the additional. You can rescale the texture uv to make it fit. I make shaders .. mainly. My community resources I'll do some custom stuff, I'm open for cooperation.
xScatta Posted February 4, 2015 Author Posted February 4, 2015 @Ren_712 thanks that's that what i wanted but there's one problem. I'm not sure how to use it It's fine to celebrate success but it is more important to heed the lessons of failure.
FranklinRoosevelt Posted February 4, 2015 Posted February 4, 2015 Ren_712, hey looking this viewtopic.php?f=104&t=84334
Ren_712 Posted February 4, 2015 Posted February 4, 2015 @Ren_712 thanks that's that what i wanted but there's one problem. I'm not sure how to use it addEventHandler( "onClientResourceStart", resourceRoot, function() -- Create shader local myShader, tec = dxCreateShader ( "myshader.fx" ) if not myShader then outputChatBox( "Could not create shader. Please use debugscript 3" ) else outputChatBox( "Using technique " .. tec ) -- get texture and set dxSetShaderValues local additionalTexture = dxCreateTexture ( "texture.png" ); dxSetShaderValue ( myShader, "gAdditionalTexture", additionalTexture ); dxSetShaderValue ( myShader, "posAdd", 1,1 ); -- Apply to global txd engineApplyShaderToWorldTexture ( myShader, "myWorldTextureName" ) end end ) Like this. Dood - read some wiki, look at the examples. What i post above is supposed to give you some idea. I make shaders .. mainly. My community resources I'll do some custom stuff, I'm open for cooperation.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now