Search the Community

Showing results for tags 'shader'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Multi Theft Auto: San Andreas 1.x
    • Support for MTA:SA 1.x
    • User Guides
    • Open Source Contributors
    • Suggestions
    • Ban appeals
  • General MTA
    • News
    • Media
    • Site/Forum/Discord/Mantis/Wiki related
    • MTA Chat
    • Other languages
  • MTA Community
    • Scripting
    • Maps
    • Resources
    • Other Creations & GTA modding
    • Competitive gameplay
    • Servers
  • Other
  • Archive
  • Private Bugtracker

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


About Me


Gang


Location


Occupation


Interests

Found 33 results

  1. hey guys, I wanna help on shader Im trying to put antialias with borderWidth circle.fx float sCircleHeightInPixel = 100; float sCircleWidthInPixel = 100; float sBorderWidthInPixel = 10; float4x4 gWorldViewProjection : WORLDVIEWPROJECTION; struct VSInput { float3 Position : POSITION0; float4 Diffuse : COLOR0; float2 TexCoord : TEXCOORD0; }; struct PSInput { float4 Position : POSITION0; float4 Diffuse : COLOR0; float4 Diffuse2 : COLOR1; float2 TexCoord : TEXCOORD0; float2 Settings : TEXCOORD1; }; PSInput VertexShaderFunction(VSInput VS) float4 PixelShaderFunction(float4 Diffuse : COLOR0, float2 TexCoord : TEXCOORD0) : COLOR0 { float2 uv = float2( TexCoord.x, TexCoord.y ) - float2( 0.5, 0.5 ); PSInput PS = (PSInput)0; PS.Position = mul(float4(VS.Position, 1), gWorldViewProjection); int bAntialias = floor(VS.Diffuse.a*255+0.5)%2; int bTwoColors = floor(VS.Diffuse.a*127+0.5)%2; [branch] if(bTwoColors == 1){ float aComp = floor(VS.Diffuse.a*63+0.5)%64;; PS.Diffuse = float4((floor(VS.Diffuse.rgb*15+0.5)%16)/15, (aComp%8)/7); PS.Diffuse2 = float4(floor((VS.Diffuse.rgb*255+0.5)%16)/15, ((aComp/8)%8)/7); } else { PS.Diffuse = float4(VS.Diffuse.rgb, floor(VS.Diffuse.a*63+0.5)%64/63); PS.Diffuse2 = PS.Diffuse; } PS.TexCoord = VS.TexCoord; PS.Settings = float2(bTwoColors,bAntialias); return PS; } float2 vec = normalize( uv ); float CircleRadiusInPixel = lerp( sCircleWidthInPixel, sCircleHeightInPixel, vec.y * vec.y ); float borderWidth = sBorderWidthInPixel / CircleRadiusInPixel; if ( ( dist > 0.5 ) || ( dist < 0.5 - borderWidth ) ) return 0; else return Diffuse; } float4 PixelShaderFunction(PSInput PS) : COLOR0 { const float dist = length(PS.TexCoord*2-1); float4 color = PS.Settings.x > 0.5 ? lerp(PS.Diffuse, PS.Diffuse2, dist) : PS.Diffuse; if (PS.Settings.y < 0.5){ return dist <= 1 ? color : float4(0,0,0,0); } return float4(color.rgb, smoothstep(1, 1 - fwidth(dist) * 2, dist)*color.a); } technique Technique1 { pass Pass1 { SrcBlend = SrcAlpha; DestBlend = InvSrcAlpha; VertexShader = compile vs_3_0 VertexShaderFunction(); PixelShader = compile ps_3_0 PixelShaderFunction(); } } client.Lua local floor = math.floor function fromColor(col) local r,g,b,a b = col%256 g = floor(col/0x100)%256 r = floor(col/0x10000)%256 a = floor(col/0x1000000)%256 return r,g,b,a end local shader = dxCreateShader( "circle.fx" ) local shaderColCache = {} function dxDrawCircleShader(posX,posY,radius,color1,color2,antialias,borderWidth) assert(type(color1) == "number", "Expected number as color argument to dxDrawCircleShader") if (not color2) or (color2 == color1) then color2 = "def" end borderWidth = borderWidth or 1e9 local finColor local col1 = shaderColCache[color1] if col1 then local col2 = col1[color2] if col2 then finColor = col2 end end if not finColor then shaderColCache[color1] = shaderColCache[color1] or {} local twoColors = (color2 ~= "def") if twoColors then local r1,g1,b1,a1 = fromColor(color1) local r2,g2,b2,a2 = fromColor(color2) local finR = floor((r1/256)*16)*16 + floor((r2/256)*16) local finG = floor((g1/256)*16)*16 + floor((g2/256)*16) local finB = floor((b1/256)*16)*16 + floor((b2/256)*16) local finA = floor((a1/256)*8)*32 + floor((a2/256)*8)*4 + 2 dxSetShaderValue ( shader, "sCircleWidthInPixel", width ); dxSetShaderValue ( shader, "sCircleHeightInPixel", height ); dxSetShaderValue ( shader, "sBorderWidthInPixel", borderWidth ); finColor = tocolor( finR, finG, finB, finA ) else local r,g,b,a = fromColor(color1) local finA = (floor((a/256)*64)*4)%256 finColor = tocolor( r,g,b, finA ) end shaderColCache[color1][color2] = finColor end local antialiasComp = 16777216 if not antialias then antialiasComp = 0 end finColor = finColor + antialiasComp dxDrawImage( posX-radius, posY-radius, radius*2, radius*2, shader, nil, nil, finColor ) end addEventHandler("onClientRender",root, function() dxDrawCircleShader(500,200,60,tocolor(255,255,255),tocolor(255,255,255),1,1) end ) im not good in shader and i don't know shader. anyone help me please? actually i wanna do like this but with antialas :
  2. Hi, I want just to change the value of DepthBias by Lua So here, I have defined a parameter which I named parameter1, and the rest is just for replace.fx texture gTexture; float parameter1; technique TexReplace { pass P0 { DepthBias = parameter1; Texture[0] = gTexture; } } And now, we gonna go to Lua File : (the shader is working etc...) dxSetShaderValue(shader, "parameter1", -0.0006) So here, it doesn't work, DepthBias doesn't take the value of parameter1 as I wrote in the .fx file ! Any help please?
  3. First thing first: I'm not sure if I've chosen proper sub-forum for this, so if it isn't right place then please move it. I'm writing this because we have pretty game-breaking problem on our server that we can't find a way to fix on our side. The shaders randomly fail to create with warning specified in the title, it's happening more and more as our server gets bigger. We do track how often this error/warning happens for our players, and it's in thousands per day. It doesn't happen to all players, but when it happens we can't find any correlation to PC hardware. It happened on new high end pc's and on older hardware. The amount of memory used by MTA as shown in /showmemstat varies too, it's usually not even close to 3.5 gb limit, pretty often around 2gb. We did track, used/available VRAM by collecting data from dxGetStatus when the error happens, and usual there's lots of VRAM left too. Some example numbers here (free video memory for MTA / Total VRAM): 602/1024 2968/4084 It shows that there's enough RAM/VRAM available for MTA that it shouldn't be problem. The full error message also includes the path to shader and file/line. I looked over MTA sourcecode, and found that it fails at call to winapi, the returned HRESULT (8007000e) is E_OUTOFMEMORY which may happen if the memory couldn't be allocated, based on that we think it may be problem with MTA memory management. Some more thoughts: Once a single shader fails to create, all shaders fail to create after that (from what we observed) Our server is pretty big, the issue affects a lot of players but happens seemingly randomly. Some players aren't affected by this at all. I can't reproduce this on local server, neither by playing nor by forcing MTA to create a hundreds of thousands of shaders/textures and deleting them. We're also getting errors with HRESULT code 80070008, but it happens way less than the title error, it looks like that (happens with other shaders too): "[D3DXCreateEffectFromFile failed (80070008)[Loaded 'ngui-r\r.fx' (6737 bytes)]] @ 'dxCreateShader' [r.fx]" In last 16 hours this error happened more than 5300 times on our server, we limit the number of reported errors to 15 per player per session, based on that we can see it happened to a lot of players. Only way to fix this issue is to RESTART MTA, reconnect may help for few minutes but it fails quickly afterwards again. We would love any help with handling this issue, it's limiting our ability to work on server updates as our server relies heavily on shaders.
  4. A simple script of dressable characters and deformable faces. You can move every vertex of the head with a simple displacement shader. The script is in test state right now, I'll create a new editor later. Hope you like it.
  5. Доброго времени суток! После просмотра видео возник вопрос про вершинный шейдер... Кто-нибудь знает каким образом шейдер определяет точки, которые нужно передвигать и в каком направлении? Само видео:
  6. Hello, everyone! After watching the video i got a question about vertex shader... Someone know how shader defines coordinates and direction, which we change? Video:
  7. Hello guys, I need a shader that would follow the cursor. Where to find ? or how to create?
  8. Hello guys! I started with shaders today, I made a script to apply a texture to the weapons fire, but it is not working, nor does it give any error in the debug. Client-side shader = dxCreateShader("shader/shader.fx") fire_fx = dxCreateTexture("files/fire.png") function replaceFireFX() engineApplyShaderToWorldTexture(shader, "muzzle_texture4") dxSetShaderValue(shader, "gTexture", fire_fx) end addEventHandler("onClientResourceStart", resourceRoot, replaceFireFX) addEventHandler("onClientPlayerJoin", root, replaceFireFX) FX-Code texture gTexture; technique TexReplace { pass P0 { Texture[0] = gTexture; } } fire.png
  9. I want to create a lua for an infernus shader / FX, can someone help me or guide me to do it?, It is usually called "Dynamic Vehicle Overlay". i have the FX, just need to add the commands. I know it adds: dxSetShaderValue (Shader, tex, Texture) But i don't understand.
  10. So, I have a shader: float4 PixelShader3Function(float2 UVCoords : TEXCOORD0) : COLOR0 { return float4(0, 0, 0, 1); } technique Normal { pass P0 { PixelShader = compile ps_3_0 PixelShader3Function(); } } Which should make the texture black, but instead it makes it transparent. But, if I use compile ps_2_0 instead it works just fine, and turns my texture into black. Anyone any idea?
  11. Hello everyone. About 3 years ago I have worked on some project and got experiments on skin morphing. The video below shows some results in that: MTA gives all opportunities for creating a morphing for a face, body or something else. I hope in the future someone makes a full-customizable character.
  12. There's a shader and a simple float4x4 array in it. I just want to set the array's values with dxSetShaderValue. How should I do this? float4x4 thisBoneMatrix[6] = { float4x4( 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ), float4x4( 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ), float4x4( 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ), float4x4( 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ), float4x4( 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ), float4x4( 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ) };
  13. I need a function that calculates ped's bone matrices. (bone_attach functions doesn't work) I'm working on a shader that actually can move a ped's bone.
  14. After I finished the first version of my character customization system i just realized its such a piece of crap, so i started writing a new version with a whole new concept. The first version worked with CJ skin and i just attached some custom head models to it. Conversely the new version is running with shaders and the skin is a custom dff. Here is a video of the head customization. The clothing is in progress yet, it takes a lot of time because i have to make custom cloth models. Hope you like it. Please don't ask for the source code, this script will never be released. Sorry.
  15. Hello guys, i've seen in some servers that you can change the texture of the same vehicle many times, So you can seen other players having the same vehicle but another texture, I know that i have to use Shader functions but how to do it, And how to make all players able to see other player's vehicle texture ?
  16. --Client local shader = dxCreateShader("tex.fx",0, 0, true, 'ped') addEvent("broadcastEnableShader", true) -- allow remotely triggered (from server) addEventHandler("broadcastEnableShader", root, function(some_data) -- receive broadcast from the server local img = dxCreateTexture(""..math.random(1,3)..".png") dxSetShaderValue(shader, "tex", img) engineApplyShaderToWorldTexture(shader, "Hoodie_green_co",some_data) end ) addEventHandler( 'onClientResourceStart', resourceRoot, function() for _, p in ipairs(getElementsByType('ped')) do if isElementStreamedIn(p) then local clothing = getElementData(p, 'blood') if clothing then triggerServerEvent("announceEnableShader", localPlayer, p) end end end for _, p in ipairs(getElementsByType('player')) do if isElementStreamedIn(p) then local clothing = getElementData(p, 'blood') if clothing then triggerServerEvent("announceEnableShader", localPlayer, p) end end end end) addEventHandler( 'onClientElementStreamIn', root, function() if getElementType(source) == 'player' or getElementType(source) == 'ped' then local clothing = getElementData(source, 'blood') if clothing then triggerServerEvent("announceEnableShader", localPlayer, source) end end end) addEventHandler( 'onClientElementDataChange', root, function(name) if (getElementType(source) == 'player' or getElementType(source) == 'ped') and isElementStreamedIn(source) and name == 'blood' then if getElementData(source, 'blood') then triggerServerEvent("announceEnableShader", localPlayer, source) end end end) --SERVER addEvent("announceEnableShader", true) addEventHandler("announceEnableShader", root, function (some_data) -- triggerClientEvent(root, "broadcastEnableShader", source, some_data) end ) Ita not Synchronization((
  17. Подскажите пожалуйста из-за чего така ошибка со шейдерами
  18. Hello! I have small script that replaces texture with image using shader and scrolls it from left to right. But i would like that there would be more images scrolling, example: coca cola ad, mcdonalds ad, etc... Would it be possible? I'm quite bad with shaders.. Shader: // // Example shader - uv_scroll.fx // /////////////////////////////////////////////////////////////////////////////// //Global variables /////////////////////////////////////////////////////////////////////////////// float gTime : TIME; /////////////////////////////////////////////////////////////////////////////// // Functions /////////////////////////////////////////////////////////////////////////////// //------------------------------------------- // Returns UV anim transform //------------------------------------------- float3x3 getTextureTransform () { float posU = -fmod( gTime/8 ,1 ); // Scroll Right float posV = 0; return float3x3( 1, 0, 0, 0, 1, 0, posU, posV, 1 ); } /////////////////////////////////////////////////////////////////////////////// // Techniques /////////////////////////////////////////////////////////////////////////////// texture Tex0; technique simple { pass P0 { Texture[0] = Tex0; // Set the UV thingy TextureTransform[0] = getTextureTransform (); // Enable UV thingy TextureTransformFlags[0] = Count2; } } Client-sided script: shader = dxCreateShader("shader.fx") coce = dxCreateTexture("bobo_3.png") dxSetShaderValue(shader, "Tex0", coce) engineApplyShaderToWorldTexture( shader, "buymorejeans")
  19. Hello everyone, nothing to say so. LUA: function dxDrawCircle( x, y, width, height, color, angleStart, angleSweep, borderWidth ) height = height or width color = color or tocolor(255,255,255) borderWidth = borderWidth or 1e9 angleStart = angleStart or 0 angleSweep = angleSweep or 360 - angleStart if ( angleSweep < 360 ) then angleEnd = math.fmod( angleStart + angleSweep, 360 ) + 0 else angleStart = 0 angleEnd = 360 end x = x - width / 2 y = y - height / 2 if not circleShader then circleShader = dxCreateShader ( "circle.fx" ) end dxSetShaderValue ( circleShader, "sCircleWidthInPixel", width ); dxSetShaderValue ( circleShader, "sCircleHeightInPixel", height ); dxSetShaderValue ( circleShader, "sBorderWidthInPixel", borderWidth ); dxSetShaderValue ( circleShader, "sAngleStart", math.rad( angleStart ) - math.pi ); dxSetShaderValue ( circleShader, "sAngleEnd", math.rad( angleEnd ) - math.pi ); dxDrawImage( x, y, width, height, circleShader, 0, 0, 0, color, true ) end function dxDrawRoundedRectangle( x, y, width, height, radius, color ) if ( radius >= width ) or ( radius >= height ) then dxDrawCircle( x - ( radius / 2 ), y - ( radius / 2 ) ) end -- The radius is relative to the height and width of the rectangle, so to avoid rectangles if the radius is bigger than the width or height then a complete circle is being drawn. dxDrawCircle( x + ( radius / 2 ), y + ( radius / 2 ), radius, radius, color, 270, 90 ) dxDrawCircle( x + ( radius / 2 ), ( y + height ) - ( radius / 2 ), radius, radius, color, 180, 90 ) dxDrawCircle( ( x + width ) - ( radius / 2 ), y + ( radius / 2 ), radius, radius, color, 0, 90 ) dxDrawCircle( ( x + width ) - ( radius / 2 ), ( y + height ) - ( radius / 2 ), radius, radius, color, 90, 90 ) dxDrawRectangle( x, y + ( radius / 2 ), width, ( height ) - ( radius ), color, true ) dxDrawRectangle( x + ( radius / 2 ), y , ( width ) - ( radius ), ( radius / 2 ), color, true ) dxDrawRectangle( x + ( radius / 2 ), ( y + height ) - ( radius / 2 ), ( width ) - ( radius ), ( radius / 2 ), color, true ) end CIRCLE.FX ( The one from the MTA Wiki ) float sCircleHeightInPixel = 100; float sCircleWidthInPixel = 100; float sBorderWidthInPixel = 10; float sAngleStart = -3.14; float sAngleEnd = 3.14; //------------------------------------------------------------------------------------------ // PixelShaderFunction // 1. Read from PS structure // 2. Process // 3. Return pixel color //------------------------------------------------------------------------------------------ float4 PixelShaderFunction(float4 Diffuse : COLOR0, float2 TexCoord : TEXCOORD0) : COLOR0 { float2 uv = float2( TexCoord.x, TexCoord.y ) - float2( 0.5, 0.5 ); // Clip unwanted pixels from partial pie float angle = atan2( -uv.x, uv.y ); // -PI to +PI if ( sAngleStart > sAngleEnd ) { if ( angle < sAngleStart && angle > sAngleEnd ) return 0; } else { if ( angle < sAngleStart || angle > sAngleEnd ) return 0; } // Calc border width to use float2 vec = normalize( uv ); float CircleRadiusInPixel = lerp( sCircleWidthInPixel, sCircleHeightInPixel, vec.y * vec.y ); float borderWidth = sBorderWidthInPixel / CircleRadiusInPixel; // Check if pixel is inside circle float dist = sqrt( dot( uv, uv ) ); if ( ( dist > 0.5 ) || ( dist < 0.5 - borderWidth ) ) return 0; else return Diffuse; } //------------------------------------------------------------------------------------------ // Techniques //------------------------------------------------------------------------------------------ technique tec0 { pass P0 { PixelShader = compile ps_2_0 PixelShaderFunction(); } }
  20. Добрый день, использую шейдер color.fx & mta-helper.fx для смены цвета текстуры, одежды персонажа. В шейдерах полный нуль, использовал урок от Kernel. Так вот, какая проблема. Мне необходимо помимо перекраски, накладывать ещё одну текстуру сверху (картинку), если я её накладываю, то в определённых местах мира (в интерьерах с заменами текстур) появляется мерцание этой самой картинки. Если я отключаю mta-helper - мерцания нет, однако тогда текстура слишком яркая, что мне тоже не подходит. Нужна помощь, как исправить мерцание? #include "mta-helper.fx" float4 color = 1; sampler Sampler0 : register( s0 ); struct VSInput { float4 Position : POSITION0; float3 Normal : NORMAL0; float4 Diffuse : COLOR0; float2 TexCoord : TEXCOORD0; }; struct PSInput { float4 Position : POSITION0; float2 TexCoord : TEXCOORD0; float4 Diffuse : COLOR0; }; PSInput VertexShaderFunction( VSInput VS ) { PSInput PS = (PSInput)0; float4 worldPosition = mul( VS.Position, gWorld ); float4 viewPosition = mul( worldPosition, gView ); float4 position = mul( viewPosition, gProjection ); PS.Position = position; PS.TexCoord = VS.TexCoord; PS.Diffuse = MTACalcGTAVehicleDiffuse( VS.Normal, VS.Diffuse ); return PS; } float4 PixelShaderFunction( PSInput PS ) : COLOR0 { float4 texColor = tex2D( Sampler0, PS.TexCoord ); texColor *= PS.Diffuse * color; return texColor; } technique { pass P0 { VertexShader = compile vs_2_0 VertexShaderFunction(); PixelShader = compile ps_2_0 PixelShaderFunction(); } }
  21. Buenas a todos, nada que decir así que dejo esto por aquí. LUA: function dxDrawCircle( x, y, width, height, color, angleStart, angleSweep, borderWidth ) height = height or width color = color or tocolor(255,255,255) borderWidth = borderWidth or 1e9 angleStart = angleStart or 0 angleSweep = angleSweep or 360 - angleStart if ( angleSweep < 360 ) then angleEnd = math.fmod( angleStart + angleSweep, 360 ) + 0 else angleStart = 0 angleEnd = 360 end x = x - width / 2 y = y - height / 2 if not circleShader then circleShader = dxCreateShader ( "circle.fx" ) end dxSetShaderValue ( circleShader, "sCircleWidthInPixel", width ); dxSetShaderValue ( circleShader, "sCircleHeightInPixel", height ); dxSetShaderValue ( circleShader, "sBorderWidthInPixel", borderWidth ); dxSetShaderValue ( circleShader, "sAngleStart", math.rad( angleStart ) - math.pi ); dxSetShaderValue ( circleShader, "sAngleEnd", math.rad( angleEnd ) - math.pi ); dxDrawImage( x, y, width, height, circleShader, 0, 0, 0, color, true ) end function dxDrawRoundedRectangle( x, y, width, height, radius, color ) if ( radius >= width ) or ( radius >= height ) then dxDrawCircle( x - ( radius / 2 ), y - ( radius / 2 ) ) end -- El radius es relativo al tamaño del rectángulo, para evitar 'bugs' se dibuja el circulo completo. dxDrawCircle( x + ( radius / 2 ), y + ( radius / 2 ), radius, radius, color, 270, 90 ) dxDrawCircle( x + ( radius / 2 ), ( y + height ) - ( radius / 2 ), radius, radius, color, 180, 90 ) dxDrawCircle( ( x + width ) - ( radius / 2 ), y + ( radius / 2 ), radius, radius, color, 0, 90 ) dxDrawCircle( ( x + width ) - ( radius / 2 ), ( y + height ) - ( radius / 2 ), radius, radius, color, 90, 90 ) dxDrawRectangle( x, y + ( radius / 2 ), width, ( height ) - ( radius ), color, true ) dxDrawRectangle( x + ( radius / 2 ), y , ( width ) - ( radius ), ( radius / 2 ), color, true ) dxDrawRectangle( x + ( radius / 2 ), ( y + height ) - ( radius / 2 ), ( width ) - ( radius ), ( radius / 2 ), color, true ) end CIRCLE.FX: float sCircleHeightInPixel = 100; float sCircleWidthInPixel = 100; float sBorderWidthInPixel = 10; float sAngleStart = -3.14; float sAngleEnd = 3.14; float4 PixelShaderFunction(float4 Diffuse : COLOR0, float2 TexCoord : TEXCOORD0) : COLOR0 { float2 uv = float2( TexCoord.x, TexCoord.y ) - float2( 0.5, 0.5 ); float angle = atan2( -uv.x, uv.y ); // -PI to +PI if ( sAngleStart > sAngleEnd ) { if ( angle < sAngleStart && angle > sAngleEnd ) return 0; } else { if ( angle < sAngleStart || angle > sAngleEnd ) return 0; } // Calc border width to use float2 vec = normalize( uv ); float CircleRadiusInPixel = lerp( sCircleWidthInPixel, sCircleHeightInPixel, vec.y * vec.y ); float borderWidth = sBorderWidthInPixel / CircleRadiusInPixel; // Check if pixel is inside circle float dist = sqrt( dot( uv, uv ) ); if ( ( dist > 0.5 ) || ( dist < 0.5 - borderWidth ) ) return 0; else return Diffuse; } technique tec0 { pass P0 { PixelShader = compile ps_2_0 PixelShaderFunction(); } } ( El shader publicado es uno de los shaders de ejemplo que hay en la wiki de MTA )
  22. so there is this server called Grafuroam and it has a specific hydra skin for specific clan and not the same one for all clans and also everyone can SEE the texture i just want to know how to do this
  23. Всем привет, мб кто нибудь шарит в шейдерах. Вопрос следующего характера, необходимо покрасить наложенные на автомобиль четыре обьекта (колёса кастомные). Название текстуры у меня "body_k", написал саму систему, шейдер и при этом шейдер не очень хорошо понимает RGBA палитру. Только радикальные цвета будь то: 0,255,255,255; 255,0,0,255; 255,0,255 и т.д. При цвете например 75,0,255,255 выдает оттенок максимальный по заданым критериям, т.е. 255,0,255,255... Вот скриншот того, что пытаюсь реализовать:http://www.fotolink.su/pic_b/c03627c7d8665128f9c5ec7ecaf65c60.png (Не могу прикрепить почему-то изображение) Код шейдера: float4 gColor = float4(1,1,1,1); bool bIsGTADiffuse = true; //--------------------------------------------------------------------- // Include some common stuff //--------------------------------------------------------------------- #include "mta-helper.fx" //--------------------------------------------------------------------- // Sampler for the main texture //--------------------------------------------------------------------- sampler Sampler0 = sampler_state { Texture = (gTexture0); }; //--------------------------------------------------------------------- // Structure of data sent to the vertex shader //--------------------------------------------------------------------- struct VSInput { float3 Position : POSITION0; float4 Diffuse : COLOR0; float2 TexCoord : TEXCOORD0; }; //--------------------------------------------------------------------- // Structure of data sent to the pixel shader ( from the vertex shader ) //--------------------------------------------------------------------- struct PSInput { float4 Position : POSITION0; float4 Diffuse : COLOR0; float2 TexCoord : TEXCOORD0; }; //------------------------------------------------------------------------------------------ // VertexShaderFunction // 1. Read from VS structure // 2. Process // 3. Write to PS structure //------------------------------------------------------------------------------------------ PSInput VertexShaderFunction(VSInput VS) { PSInput PS = (PSInput)0; // Calculate screen pos of vertex PS.Position = MTACalcScreenPosition ( VS.Position ); // Pass through tex coord PS.TexCoord = VS.TexCoord; // Calculate GTA lighting for buildings float4 Diffuse = MTACalcGTABuildingDiffuse( VS.Diffuse ); PS.Diffuse = 0; if (bIsGTADiffuse) PS.Diffuse = Diffuse; else PS.Diffuse = float4(1,1,1,Diffuse.a); PS.Diffuse *= gColor; return PS; } //------------------------------------------------------------------------------------------ // PixelShaderFunction // 1. Read from PS structure // 2. Process // 3. Return pixel color //------------------------------------------------------------------------------------------ float4 PixelShaderFunction(PSInput PS) : COLOR0 { // Get texture pixel float4 texel = tex2D(Sampler0, PS.TexCoord); // Apply diffuse lighting float4 finalColor = texel * PS.Diffuse; return finalColor; } //------------------------------------------------------------------------------------------ // Techniques //------------------------------------------------------------------------------------------ technique colorize { pass P0 { VertexShader = compile vs_2_0 VertexShaderFunction(); PixelShader = compile ps_2_0 PixelShaderFunction(); } } // Fallback technique fallback { pass P0 { // Just draw normally } } Код наложение цвета, через шейдерную обработку на одно из колёс транспортного средства: local colorShader = dxCreateShader("shader.fx") local _, _, _, wheelsColorR, wheelsColorG, wheelsColorB = getVehicleColor(source, true) outputChatBox("#FFFFFFColor: R"..wheelsColorR.." G"..wheelsColorG.." B"..wheelsColorB, 0, 0, 0, true) local wheelsColor = {wheelsColorR, wheelsColorG, wheelsColorB, 255} dxSetShaderValue(colorShader, "gColor", wheelsColor) engineApplyShaderToWorldTexture(colorShader, "body_k", car_wheels[carID][1]) Need help!
  24. Im trying to use ultra thing mod, but it doesn't work anymore, i think it worked before, but now it only works with normal GTA SA.exe i have the mod files in the GTA directory, and mta warns me about d3d9.dll file, but i press continue and no mod works... what could be the problem?
  25. Hi, MTA Community I searched for a few days a shader to make shadows in MTA but i didnt found it and now i want to pay for it (if someone have another graphics shader i can buy it too) just leave pictures and send me a pm Payment method: -Paypal -Bitcoin Thanks and have a good day