Jump to content

raynner

Members
  • Posts

    223
  • Joined

  • Last visited

5 Followers

Details

  • Gang
    LOS RED
  • Location
    Brazil
  • Occupation
    Scripting in Lua, Scripting in Mta Lua, Zmodeler, Bikes
  • Interests
    RPG MTA Server, Real City MTA

Recent Profile Visitors

2,446 profile views

raynner's Achievements

Trick

Trick (18/54)

12

Reputation

  1. ok ! I will test as soon as possible, thank you men
  2. Hey guys, I have the S@moke box shader, I need to apply the shader to the texture, not the screen I know I need to add the raplace part to the code but I don't know how to remove the screensource part correctly from the encoder. Can someone help me ? original code i change texture screenSource to tex to use dxSetShaderValue(mytexture) I don't know how to modify texturesample and remove self PixelShaderFunction texture screenSource; float2 screenSize = float2(0.0f, 0.0f); float pencilStrength = 1.0f; float saturation = 1.0f; float contrast = 1.0f; float brightness = 1.0f; sampler TextureSampler = sampler_state { Texture = <screenSource>; AddressU = Mirror; AddressV = Mirror; }; static const float2 blurring[16] = { float2(-0.326212f, -0.40581f), float2(-0.840144f, -0.07358f), float2(-0.695914f, 0.457137f), float2(-0.203345f, 0.620716f), float2(0.96234f, -0.194983f), float2(0.473434f, -0.480026f), float2(0.519456f, 0.767022f), float2(0.185461f, -0.893124f), float2(0.507431f, 0.064425f), float2(0.89642f, 0.412458f), float2(-0.32194f, -0.932615f), float2(-0.65432f, -0.87421f), float2(-0.456899f, -0.633247f), float2(-0.123456f, -0.865433f), float2(-0.664332f, -0.25680f), float2(-0.791559f, -0.59771f) }; float4 PixelShaderFunction(float2 texCoords : TEXCOORD0) : COLOR0 { float4 baseColor = tex2D(TextureSampler, texCoords); for(int i = 0; i < 16; i++) { float2 newCoords = texCoords.xy + (blurring[i] / screenSize * pencilStrength); baseColor += tex2D(TextureSampler, newCoords); } baseColor /= 17.0f; if (baseColor.r <= 0.1f) { baseColor.a = 0.0f; } if (baseColor.g <= 0.1f) { baseColor.a = 0.0f; } if (baseColor.b <= 0.1f) { baseColor.a = 0.0f; } float4 mainColor = tex2D(TextureSampler, texCoords); float4 outlineColor = saturate(mainColor / baseColor); float value = (outlineColor.r + outlineColor.g + outlineColor.b) / 3.0f; outlineColor.r = value; outlineColor.g = value; outlineColor.b = value; outlineColor.rgb = 1 - outlineColor.rgb; outlineColor.a *= outlineColor.r; float4 finalColor = baseColor - (outlineColor * 2.0f); float3 luminanceWeights = float3(0.299f, 0.587f, 0.114f); float luminance = dot(finalColor, luminanceWeights); finalColor.rgb = lerp(luminance, finalColor.rgb, saturation); finalColor.a = finalColor.a; finalColor.rgb = ((finalColor.rgb - 0.5f) * max(contrast, 0.0f)) + 0.5f; finalColor.rgb *= brightness; return finalColor; } technique Cartoon_01 { pass Pass1 { PixelShader = compile ps_2_0 PixelShaderFunction(); } } // Fallback technique Fallback { pass P0 { // Just draw normally } }
  3. the hero´s dff looks promising, i teste and like resunts thank you men
  4. hello; i´m convert character parts from gta, to work in gta sa i use 3ds max for process, the problem is weld, i apply weld in model and export model, in model import weld is losted !!! note: i used all versions 3ds max, from 2010 to 2021; afeter weld later weld later weld and import model welded
  5. You need to create multiple lines connected to each other to form a curve!! how are they made as a pixel in an image
  6. obviamente vc ja deve ter resolvido mais pra deixar claro se o script esta subscrevendo o seu toggle ou ele ta em um timer ou em um evento provavel de render vc pode obter todos os eventos sendo excetuados e suas funções .... eu n tenho certeza por que eu usei isso para crair um painel de log para beta teste mais provavelmente vc pode desvincular através de outro script e tem como fazer isso com timer tb vc obtem os timers em execução se n me engano timers são um elemento do mta ou seja vc pode obter todos com getElementsByType em fim use sua mente a criação de script é bem simples quando vc conhece bem as ferramentas(funções/comandos) da wiki e um problema n passa de uma pequena pedra no seu caminho
  7. eu não acho que esteja bugado e eu n posso testart agr mais vc pode contornar isso usando onClientKey ou um evento semelhante mais estou quase certo que é esse para quando uma variavel for true ele ser cancelado assim cancelando qualquer ação que esse botão faria existe uma função que vc pode pegar os botões configurados para os controles fire n me recordo o nome agora vc pode usala para que o sistema n seja burlado por jogadores trocando o botão e é isso basicamente obvio que tudo tem que ser feito do lado do client pois o evento é dele mais nada muito trabalhoso, mais eu aconselho vc realizar alguns testes ou aguardar outra pessoa responder sobre o "bug" no toggleControl que eu n creio haver bug algum
  8. walking animations use last frame true and -1 in time dont work my exemple is unic mode to walk in animation .. I'm working on changing walking style animations this way it works, besides having a limit I have to study which styles use the altered animations
  9. Hi I would like to understand the problem we have the original animation "misc", "plyr_shkhead" if i use setPedAnimation(localPlayer, "misc", "plyr_shkhead", 200, true, true, false, true) I can walk doing the animation however if I use the same animation with a new ifp using engineLoadIFP even though it's the original game block that I extracted I can't walk using engineLoadIFP("misc.ifp", "custom") setPedAnimation(localPlayer, "custom", "plyr_shkhead", 200, true, true, false, true) both are the same original animations but one is originally original, while the other is accessible via loadifp my doubt is this is a limitation of the mta or am i doing something wrong? even because I've seen other servers use custom animations that is allowed to walk (I say this because I've already looked at all the game's animations and none is identical to what I saw on the server)
  10. oh ok is local mx, my = screenx/2, screeny/2 bx = bx + mx by = my - by bx = bx - (blipsize/2) by = by - (blipsize/2) if use other screen dimension to create imagem, you will need a number that divides the dimension of the world from 6000x6000 to the resolution you want for example screenx, screeny = 768, 768 -- 6000 / 7.81 = 768 Divided = 768/2 bx, by = -27, 165 -- is world position bx = math.floor (bx / 7.81) -- convert position world 6000x6000 to 768x768 by = math.floor (by / 7.81) bx = bx + Divided by = Divided - by bx = bx - (32/2) by = by - (32/2)
  11. i´m create minimap using mask shader the wiki to add blips i´m use dxTarget i´m create dx image in dxTarget and set Target in shader, i´m necessary convert the blip world position to compatible image position -- -- c_hud_mask.lua -- ---------------------------------------------------------------- -- onClientResourceStart ---------------------------------------------------------------- addEventHandler( "onClientResourceStart", resourceRoot, function() -- Create things screenx, screeny = 6000, 6000 -- the image dimension hudMaskShader = dxCreateShader("hud_mask.fx") radarTexture = dxCreateTexture("images/radar.jpg") maskTexture1 = dxCreateTexture("images/circle_mask.png") renderMap = dxCreateRenderTarget(screenx, screeny) -- Check everything is ok bAllValid = hudMaskShader and radarTexture and maskTexture1 if not bAllValid then outputChatBox( "Could not create some things. Please use debugscript 3" ) else dxSetShaderValue( hudMaskShader, "sPicTexture", radarTexture ) dxSetShaderValue( hudMaskShader, "sMaskTexture", maskTexture1 ) end end ) ----------------------------------------------------------------------------------- -- onClientRender ----------------------------------------------------------------------------------- addEventHandler( "onClientRender", root, function() if not bAllValid then return end -- -- Transform world x,y into -0.5 to 0.5 -- local x,y = getElementPosition(localPlayer) x = ( x ) / 6000 y = ( y ) / -6000 dxSetShaderValue( hudMaskShader, "gUVPosition", x,y ) -- -- test blip -- local bx, by = 1081, 270 -- bx math ??? -- by math ??? -- -- Zoom -- local zoom = 8 zoom = zoom + math.sin( getTickCount() / 500 ) * 3 -- Zoom animation for DEMO dxSetShaderValue( hudMaskShader, "gUVScale", 1/zoom, 1/zoom ) -- -- Rotate to camera direction - OPTIONAL -- local _,_,camrot = getElementRotation( getCamera() ) dxSetShaderValue( hudMaskShader, "gUVRotAngle", math.rad(-camrot) ) -- -- Draw -- dxSetShaderValue( hudMaskShader2, "sPicTexture", renderMap ) dxSetRenderTarget(renderMap) dxDrawImage( 0, 0, screenx, screeny, "images/radar.jpg", 0,0,0, tocolor(255,255,255,200) ) dxDrawImage( bx, by, 16, 16, blipicon, 0,0,0, tocolor(255,255,255,255) ) dxSetRenderTarget() -- set render target in shader dxSetShaderValue( hudMaskShader, "sPicTexture", renderMap ) dxDrawImage( 100, 200, 400, 400, hudMaskShader, 0,0,0, tocolor(255,255,255,100) ) end )
  12. this is of no use to me if it were I wouldn't be here as far as i know i have 2 ways to do this using dximages and fixing them at the shooting sites or some way of adding a texture on top of the other via a shader without replacing, but rather adding some new texture without modifying the txd
  13. Hello I am wanting to create a shader so that when the player is shot he creates marks of shots on the player's body but I don't know what the name of texture should be used in engineApplyShaderToWorldTexture (myShader, "I don't know the name")
  14. Hello friends, i know the basics about shader so i need your help! I would like to replace textures and define the color for them in addition to just sub-replacing it saves me the trouble of having repeated textures of different colors just add a single white! but I don't know how to write this in the .fx file, I know that I should create variables like float red; and use dxSetShaderValue (theShader, 'red', 1.0) but I don't know how to do it in the file.fx my fx texture tex; technique TexReplace { pass P0 { Texture[0] = tex; } } my lua myShader = dxCreateShader('shader.fx', 0, 0, false, 'object') terrain = dxCreateTexture("Cut_1.png") dxSetShaderValue(myShader, "tex", terrain) object = createObject(3355, 0, 0, 3) teste = engineApplyShaderToWorldTexture(myShader, 'Cut_Color', ped) outputChatBox(tostring(teste)) everything works perfectly but i would like to add white .png and set the color via shader it's possible ? I saw some similar things on the forum but none of them worked with replace so I don't know how to do it !!!
  15. rs eu odeio usar essa função ela é muito complexa em minha mente eu também tenho problemas em fazer esses cálculos felizmente outro membro já te ajudou eu me dou bem com todos os outros elementos dx menos ImageSection rs
×
×
  • Create New...