Jump to content

XaskeL

Members
  • Posts

    246
  • Joined

  • Last visited

  • Days Won

    5

Everything posted by XaskeL

  1. If I had a resource, then it would be possible to test. And so, most likely, you will have to create weapon objects separately and synchronize the paintjob for each player to an individual weapon object.
  2. This is a simple dxGUI library. With the ability to describe your interface in a table. The library has just begun its development and, I would like you to participate in its development too. The idea behind this is that the library can be easily exported via loadstring and used in your code. Also, have a minimum set of functions and a minimum of code to implement a simple interface. Plans for further changes: 1. Come up with local and global functions as well as rename old functions. (for the entire style sheet or for an object in the interface table). 2. Change synchronization in style sheets, object table and interface table with sorted table. 3. Simplify the code. e.g styles. 4. Add simple animations like fade window and so on. Link: https://github.com/XaskeL/SimpleUI/ #Wiki: 1. return index = baseUI.Construction(index, dx, dy, position, gui) — index: Name of The name of your interface table (must be unique). — dx,dy: Developer screen resolution. (the one who constructs the interface). — position: Position in the table. This type: { x = 0; y = 0; w = 0; h = 0; } — gui: Here you describe your objects. Also in the table with records. { p = LAYER_NUMBER (1..N), type = 'OBJECT TYPE', x = 0, y = 0, w = 0, h = 0, color = tocolor(255, 255, 255, 255) }; Example: background = { p = 1, type = 'image', x = 0, y = 0, w = 740, h = 638, image = 'assets/images/background.png', color = WHITE }; { p = 2, type = 'image', x = 20+(160-82)/2, y = 60+15, w = 82, h = 70, image = 'assets/images/icons/1.png', color = WHITE }; 2. return table = baseUI.GetScale(index); — Returns a size table with a resolution difference. local scale = baseUI.GetScale(UI); 3. baseUI.SetScale(index, scale.x, scale.y); — sets the size of items relative to the screen. 4. baseUI.SetAlign(index, 'center', 'center'); — sets the position of the interface relative to the position on the screen: left, top, bottom, right
  3. От начала движения получить время getTickCount() в миллисекундах. Потом при наборе скорости в км/ч от 0-100, до 100-200 получать так же время как в начале пути а после элементарно высчитать вычитанием. Скорость можно высчитать так: local speed = getDistanceBetweenPoints3D ( 0, 0, 0, getElementVelocity ( vehicle ) ) * 180 -- либо так local speed = localPlayer.vehicle.velocity.length * 180; А 1/4 мили (402 метра) все тоже самое но уже посредством получения точки старта и getDistanceBetweenPoints2D получить расстояние. Думаю внятно объяснил.
  4. XaskeL

    Custom radar

    Example "hud mask": https://wiki.multitheftauto.com/wiki/Shader_examples
  5. because it’s convenient, you can use one texture for what you need. You can use shader specifically on some object. all this will weigh significantly less and less need to understand how the RenderWare engine works when processing textures. For example, I did not check whether it would occupy one large TXD with all the textures that need to be replaced with more RAM, if it is replaced with 50 objects. (one mta-element txd) and so on.
  6. Just make it possible to generate stickers in RenderTarget and apply it to the machine with this shader. When the player will make individual vinyls for their cars (regardless of UV using perspective or orthographic projection). Then everything will be fine.
  7. -- SERVER local query = dbQuery(connection 'SELECT `id`, `x`, `y`, `z`, `rotation`, `dimension`, `interior` FROM `table` WHERE `ID` = ?', ID); local result = dbPoll(query, -1); triggerClientEvent(source, 'mysqlResultsData', result); dbFree(query); -- CLIENT addEvent('mysqlResultsData', true) addEventHandler('mysqlResultsData', resourceRoot, function() -- etc end )
  8. Send mysql request on server and send result from dbPoll to client.
  9. Not sure if I ported it correctly. But I will understand a little later. Thanks @Kenix
  10. Thanks for the MMD. I have so far migrated SMAA Edge Detection. It is much easier to understand. I think it will be ready soon! SMAA Edge Detection:
  11. Делать Атласы или использовать .DDS заранее/грузить в R8G8B8A8 (ARGB). Этого не исправить, использовать только DxTexture. Текстурный атлас - это большое изображение или "атлас", который содержит много изображений меньшего размера, каждое из которых является текстурой для какой-то части объекта. Подтекстуры можно накладывать путём указания текстурных координат на атласе, то есть выбирая только определённую часть изображения. В приложениях, в которых часто используются мелкие текстуры, более эффективно хранить текстуры в текстурном атласе, так как: Позволяет сократить количество смен состояний до одного для всего атласа. Уменьшает количество занятых текстурных слотов до одного для всего атласа. Минимизируется фрагментация видеопамяти. Появляется возможность использования NPOT "текстур" (Т.е. атлас будет соблюдать Power of Two, а его элементы можно делать произвольного размера). Однако, использование атласов может приводить к возникновению новых проблем: Cовмещение краёв подтекстур становится нетривиальной задачей. Становится сложно или невозможно использовать мипмаппинг При использовании фильтрации текстуры необходимо добавлять отступы, чтобы соседние подтекстуры не смешивалась с нужной. Создание атласов вручную может быть трудоёмко, поэтому потребуется использовать специальные программы для генерирования атласов. Возникают небольшие потери памяти, так как часть атласа может быть не занята текстурами.
  12. Has anyone ported anti-aliasing in mta SMAA? I integrated FXAA a few minutes ago and set it to a high preset, but I’m not very happy with the result. For example, you cannot integrate GBAA, because it uses special semantics for DX10 which can hardly be replaced with something like a VERTEX ID. Why am I interested in porting SMAA? because for now I myself have no idea how to port it, because it is not clear how to generate the necessary input parameters. Smoothing is important for some shaders.
  13. http://fizmat.by/kursy/kinematika/parabolicheskoe sorry, only in Russian
  14. You do not need to use its shader. There is a calculation of Screen Space Reflection for flat surfaces (in fact, the code from that article is not very good and, not from a good life, people write their algorithms for their goals and objectives. In the end, you will always come across Information Lost, because SSR is not a replacement, it is an addition.Even the author of the article has problems with the reflection itself, although I liked the result of the work of reflections on the water in your video (this is used on some meta projects and just the image is cropped a little when the player starts to raise the camera). although I myself have the problem of implementing the correct SSR on machines and I have ideas for calculations, but have not tried it yet.
  15. Into the SSLR account in Ren712 shaders (just from this Russian article). I myself am interested in the study of shaders, but I do not know much about mathematics. Look on file: image4D_mir.fx https://community.multitheftauto.com/index.php?p=resources&s=details&id=12052
  16. Why then the license for this gamemode appeared much later? https://github.com/NullSystemWorks/mtadayz/commit/2cf21db59c289071a102137975eccda1b1bd0efb
  17. local sX,sY = guiGetScreenSize() local gradientShader = dxCreateShader("files/shader/gradient.fx") local rt1 = dxCreateRenderTarget(sX*0.3, sY*0.05, true) local rt2 = dxCreateRenderTarget(sX*0.3, sY*0.05, true) function drawThings() -- ##RENDER TARGET #1 dxSetRenderTarget(rt1) dxDrawRectangle(0,0,sX*0.3, sY*0.05) -- Box dxDrawImage(0,15,sY*0.02,sY*0.02, imagePath) -- Star? -- dxDrawImage(0,0,sX*0.3, sY*0.05, gradientShader) -- what for? dxSetRenderTarget() -- first shader dxSetShaderValue(gradientShader, "startColor", 207/255, 22/255, 124/255,1) dxSetShaderValue(gradientShader, "endColor", 239/255, 56/255, 48/255,1) dxSetShaderValue(gradientShader, "tex", rt1) dxSetRenderTarget(rt1, true) dxDrawImage(0, 0, sX*0.3, sY*0.05, gradientShader) -- return to render target results from shader dxSetRenderTarget() -- ##RENDER TARGET #2 dxSetRenderTarget(rt2) dxDrawRectangle(0,0,sX*0.3, sY*0.05) -- Box dxDrawImage(0,15,sY*0.02,sY*0.02, imagePath) -- Star -- dxDrawImage(0,0, sX*0.3, sY*0.05, gradientShader) -- are you sure? dxSetRenderTarget() -- second shader dxSetShaderValue(gradientShader, "startColor", 207/255, 22/255, 124/255,1) dxSetShaderValue(gradientShader, "endColor", 239/255, 56/255, 48/255,1) dxSetShaderValue(gradientShader, "tex", rt2) dxSetRenderTarget(rt2, true) dxDrawImage(0, 0, sY*0.02, sY*0.02, gradientShader) -- return to render target results from shader dxSetRenderTarget() addEventHandler("onClientRender",root,renderThings) end function renderThings() dxDrawImage(sX*0.05,sY*0.1,sX*0.3, sY*0.05, rt1) dxDrawImage(sX*0.05,sY*0.4,sX*0.3, sY*0.05, rt2) end drawThings()
  18. Now I'm completely confused about what you want to do
  19. refleTexCoord.y = 1 - refleTexCoord.y; refleTexCoord.y += gCameraDirection.z; ?
  20. You can create several RTs and write the result of the shader into them. And already display RT themselves.
  21. You need output results from shader. local rt = dxCreateRendertTarget(600, 600, true) dxSetRenderTarget(rt) dxDrawImage(0, 0, 600, 600, shader) dxSetRenderTarget() Test it code: local sX,sY = guiGetScreenSize() local gradientShader = dxCreateShader("files/shader/gradient.fx") local rt = dxCreateRenderTarget(sX*0.3, sY*0.05, true) function drawThings() dxSetRenderTarget(rt) dxDrawRectangle(0,0,sX*0.3, sY*0.05) dxSetRenderTarget() --texture = dxCreateTexture(dxGetTexturePixels(rt)) -- useless (RENDERTARGET = TEXTURE!) dxSetShaderValue(gradientShader, "tex", rt) dxSetShaderValue(gradientShader, "startColor", 207/255, 22/255, 124/255,1) dxSetShaderValue(gradientShader, "endColor", 239/255, 56/255, 48/255,1) addEventHandler("onClientRender",root,renderThings) end function renderThings() dxDrawImage(sX*0.05,sY*0.1,sX*0.3, sY*0.05, gradientShader) end drawThings() Or what do you want to do?
  22. float4 color = tex2D(Sampler0,TexCoord); return startColor* (1.0f - TexCoord.x)+endColor * TexCoord.x; ??? float4 color = tex2D(Sampler0,TexCoord); return color*(startColor*(1.0f-TexCoord.x)+endColor*TexCoord.x); // ?
  23. If you are not using scene reader in the Render Target from the shader, then in the “dxUpdateScreenSource” there is a resampleNow parameter. Which captures an image from a previous frame or current. P.S. I would like to see the code in the future
×
×
  • Create New...