Jump to content

marcelluss

Members
  • Posts

    28
  • Joined

  • Last visited

About marcelluss

  • Birthday 06/10/2003

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

marcelluss's Achievements

Advanced Member

Advanced Member (8/54)

3

Reputation

  1. Hello, I would like to know if it is possible to somehow make a normal blur effect (glass) in mta? I know that there are shaders in the likeness of BlurBox, but they do not give enough blur and glass effect, is it possible to somehow achieve such an effect as in the screenshot below? Using a shader? I don't really know how to work with shaders if someone knows how to upgrade my shader, please help me please here is a variant of my shader code texture ScreenSource; float BlurStrength; float2 UVSize; sampler TextureSampler = sampler_state { Texture = <ScreenSource>; MinFilter = Linear; MagFilter = Linear; MipFilter = Linear; AddressU = Wrap; AddressV = Wrap; }; static const float2 poisson[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 TextureCoordinate : TEXCOORD0) : COLOR0 { float4 color = tex2D(TextureSampler, TextureCoordinate); for(int i = 0; i < 14; i++) { float2 coord= TextureCoordinate.xy + (poisson[i] / UVSize * BlurStrength); color += tex2D(TextureSampler, coord); } return(color/17); } technique BlurShader { pass Pass1 { PixelShader = compile ps_2_0 PixelShaderFunction(); } } and here are two options for the result of my blurring the picture before and after applying the shader picture before picture after
  2. I tried to use this function, but unfortunately I didn't quite understand how to use it :((( local rawSvgData = [[ <svg viewBox="0 0 600 600" xmlns="http://www.w3.org/2000/svg"> <defs> <linearGradient id="gradient"> <stop offset="5%" stop-color="#FF0000" /> <stop offset="95%" stop-color="#00FF00" /> </linearGradient> </defs> <path id="progress" fill="none" stroke="url(#gradient)" d="M300,50 A250,250,0,1,1,299.99,50" stroke-width="20" /> </svg> ]] local svgs = {} local function render(svg) if (not isElement(svg)) or (getElementType(svg) ~= "svg") then removeEventHandler("onClientRender", root, svgs[svg].handler) svgs[svg] = nil end local width, height = svgGetSize(svg) dxDrawImage(500, 500, 430, 430, svg, 0, 0, 0, tocolor(255, 255, 255), false) end local function onUpdate(svg) print("fe") if (not svgs[svg]) then svgs[svg] = { state = true, handler = function() render(svg) end } addEventHandler("onClientRender", root, svgs[svg].handler) end iprint("SVG texture updated", svg, getTickCount()) end addEventHandler("onClientResourceStart", root, function() mySvg = svgCreate(430, 430, rawSvgData, onUpdate) end) bindKey("l", "down", function() local newPath = updateState(100, 100, 300); addSVGRectNode(mySvg, path) end) function addSVGRectNode(svg, path) local svgXML = svgGetDocumentXML(svg) local rect = xmlCreateChild(svgXML, "rect") xmlNodeSetAttribute(rect, "d", path) local status = svgSetDocumentXML(svg, svgXML) print(status) end function updateState(value, total, R) local center local alpha = 360 / total * value local a = (90 - alpha) * math.pi / 180 local x = 300 + R * math.cos(a) local y = 300 - R * math.sin(a) local path if (total == value) then path = "M300,"..(300 - R).." A"..R..","..R..",0,1,1,299.99,"..(300 - R) else if (alpha > 180) then center = 1 else center = 0 end path = "M300,"..(300 - R).." A"..R..","..R..",0,"..center..",1,"..x..","..y end return path end The problem is that for some reason I can't change the source data of the svg file already (I tried to do as you said, well, for some reason it doesn't work) - besides, I didn't quite understand working with the arguments of this function, let's say I tried to manually call the function and replace the arguments the same as from the debug, but this it didn't work quite correctly, maybe I didn't quite understand the principle of these arguments of this function, what is responsible for what. Please help me
  3. hello, I really liked your idea with the work of svg, is it possible to find out how to make the progress of reducing the strip in the svg code?
  4. Hello, I ran into a problem with the dxDrawCircle function, I have a shader that allows you to apply a gradient to a texture, but the problem is that I need to make a gradient to a level system where there is a round strip with a gradient and I would like to attach a gradient there, but the problem is that dxDrawCircle does not accept a texture and I would like to somehow attach it there, or if possible, help me!
  5. Hello, I would like to know if it is possible to make a countdown timer without using the SetTimer function? I wanted to do this in a more optimized and correct way because the usual SetTimer does not work quite in time. And I would like to make a dynamic function in which I can enter, say, 60 minutes into the arguments and a countdown timer will start with the output of minutes and seconds and at the same time use getRealTime. I tried to use many ways with this function, but they were all unsuccessful + I have already tried to find solutions on the forum and on the Internet, but all used SetTimer - unfortunately, it will not work to provide a ready-made code for my solution, because not one of them was even close to the solution I was moving towards
  6. Hello, I've been trying to figure out for a very long time how to make a smooth 3d line? In terms of I know that there is a dxDrawLine3D, but this function allows you to create flat lines or to be more precise straight lines, and I need to make a smooth line in the likeness of drawing with a brush in the 3d world, but I can't figure out how to make such a smooth line, I wanted to make it for traces of players and cars
  7. I want to find out how to implement the effect of the web on the screen. I've seen this on websites, in principle I have no idea how to do this, but just how optimized will it be? And is it even possible to implement it using a shader?
  8. create a colshape and track the contact of both colshapes
  9. The speed must be constantly set for this function to work. To do this, use a timer or a render to constantly maintain the speed. I don 't know for sure if it is possible to replace the shooting effect , but I can offer an option to create an object and count the trajectory of the bullet ( and already apply your shader to the object itself )
  10. local cursorShowing = false bindKey("f2", "down", function() cursorShowing = not cursorShowing showCursor(cursorShowing) end) local nameColor = white local nameSize = 1.2 local nameFont = "pricedown" local ped = createPed(0, 0, 0, 3); addEventHandler( "onClientRender", getRootElement(), function( ) --for _, plr in ipairs( getElementsByType( "player" ) ) do -- if not (plr == localPlayer) then local x, y, z = getPedBonePosition( ped, 8 ) local sX, sY = getScreenFromWorldPosition( x, y, z ) if sX then --local id = setElementData(plr, "id") local text if id then text ="Player ["..id.."]" else text = "Player" end local leftX = sX- dxGetTextWidth(text, nameSize, nameFont )/2 local topY = sY-60 local rightX = leftX local buttonY = topY dxDrawText( text, leftX, topY, rightX, buttonY, nameColor, nameSize, nameSize, nameFont, "left", "top", false, false, false, false, false) end -- end --end local w, h = guiGetScreenSize () local tx, ty, tz = getWorldFromScreenPosition ( w/2, h/2, 50 ) local px, py, pz = getCameraMatrix(localPlayer) -- test line -- local line = dxDrawLine3D(px, py, pz, x, y, z) local hit, x, y, z, elementHit = processLineOfSight ( px, py, pz, tx, ty, tz ) if hit then if elementHit then local sX, sY = getScreenFromWorldPosition( x, y, z ) dxDrawText("G", sX, sY, sX, sY, tocolor(255, 255, 255), 1, "default") end end end ) If I understood your idea correctly, then here is the script
  11. it all depends on the animation itself, if the animation itself allows you to walk, then yes, you can walk with animation enabled, but this is not available to all animations. And also you can import your own animations into the game. The Internet is full of guides for creating animations for a character in the game.
  12. use the following functions for this: dxDrawLine, getCameraMatrix
  13. from personal experience, I do not advise you to use СEF - or to be more precise html interfaces (they are resource-intensive and very buggy since the browser version itself is also old to use). I talked to a lot of people on this topic and many of them claimed me and even gave many examples that this is really a senseless idea. + also, not everyone can load these interfaces
×
×
  • Create New...