xScatta Posted January 25, 2015 Share 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. Link to comment
MTA Team botder Posted January 26, 2015 MTA Team Share 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. Link to comment
xScatta Posted January 29, 2015 Author Share 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 Link to comment
MTA Team botder Posted January 29, 2015 MTA Team Share 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? Link to comment
xScatta Posted January 29, 2015 Author Share 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 Link to comment
xScatta Posted February 2, 2015 Author Share Posted February 2, 2015 *BUMP* x2... Really? Link to comment
Dealman Posted February 2, 2015 Share Posted February 2, 2015 Are you looking to make something like a dynamic texture? Similar to this? Link to comment
Ren_712 Posted February 3, 2015 Share 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. Link to comment
xScatta Posted February 4, 2015 Author Share 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 Link to comment
FranklinRoosevelt Posted February 4, 2015 Share Posted February 4, 2015 Ren_712, hey looking this viewtopic.php?f=104&t=84334 Link to comment
Ren_712 Posted February 4, 2015 Share 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. Link to comment
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