iiv03 Posted August 27, 2019 Share Posted August 27, 2019 (edited) هلآ والله شباب انا مسوي رادار بس مشكله يجني بق ومسويه ب شيدر كمان بس مدري ليش يجني بق يعني في بحر الصور ايشش سالفه ؟ كود حقي addEventHandler( "onClientResourceStart", resourceRoot, function() hudMaskShader = dxCreateShader("hud_mask.fx") -- شيدر radarTexture = dxCreateTexture("img/map.png") -- صوره ماب maskTexture1 = dxCreateTexture("img/radar-background.png") -- صوره عاديه bAllValid = hudMaskShader and radarTexture and maskTexture1 if not bAllValid then outputDebugString( "LOGS: RADAR worked",0, 255,0,123 ) -- يشيك ب ديبوق رادار شغال else dxSetShaderValue( hudMaskShader, "sPicTexture", radarTexture ) -- شيدر dxSetShaderValue( hudMaskShader, "sMaskTexture", maskTexture1 ) -- شيدر end end) function radar() -- local xDiv, yDiv = posX/6000, posY/-6000 dxSetShaderValue(hudMaskShader, "gUVPosition", xDiv, yDiv) local camX, camY, camZ, tX, tY, tZ = getCameraMatrix() local north = findRotation(camX, camY, tX, tY) local northInv = 180 - north local xDiv, yDiv = posX/6000, posY/-6000 dxSetShaderValue(hudMaskShader, "gUVPosition", xDiv, yDiv) local zoom = 20 * radar.scale * radar.zoomScale radar.range = 3000/zoom local zoom = 7 dxSetShaderValue(hudMaskShader, "gUVScale", 1/zoom, 1/zoom) dxSetShaderValue(hudMaskShader, "gUVRotAngle", math_rad(-north)) if backgroundAlpha ~= 205 then dxDrawImage(radarX, radarY, radar.size, radar.size, hudMaskShader, 0, 0, 0, tocolor(255, 255, 255, 240 * radar.alpha), false) dxDrawImage(radarX, radarY, radar.size, radar.size, maskTexture1, 0, 0, 0, tocolor(14, 19, 26, 240 * radar.alpha), false) end else dxDrawImage(radarX, radarY, radar.size, radar.size, maskTexture1, 0, 0, 0, tocolor(14, 19, 26, 240 * radar.alpha), false) dxDrawImage(radarX, radarY, radar.size, radar.size, hudMaskShader, 0, 0, 0, tocolor(255, 255, 255, 240 * radar.alpha), false) end addEventHandler("onClientRender", root, radar) Edited August 27, 2019 by xFabel 1 Link to comment
iiv03 Posted August 29, 2019 Author Share Posted August 29, 2019 ي طيب ولا واحد رد؟ وش وضع 1 Link to comment
iiv03 Posted August 29, 2019 Author Share Posted August 29, 2019 Poyraz أنت مروق؟ وش يضحك. Link to comment
nxFairlywell Posted August 29, 2019 Share Posted August 29, 2019 المشكله ان ماحد يفهم في الشادر كثير , عشان كذا ماراح تحصل حل غالباً اذا انت سويت كل ذا ومسويه بالشادر كيف ماعرفت المشكله Link to comment
iiv03 Posted August 29, 2019 Author Share Posted August 29, 2019 40 minutes ago, NX_CI said: المشكله ان ماحد يفهم في الشادر كثير , عشان كذا ماراح تحصل حل غالباً اذا انت سويت كل ذا ومسويه بالشادر كيف ماعرفت المشكله المشكله احس مب من شيدر المشكله من خريطه ليش يجي بق حاولت احله بس مقدرت وللحين ادور مساعده Link to comment
N3xT Posted August 30, 2019 Share Posted August 30, 2019 ... أكوادك ناقصة, اطرحها كاملة Link to comment
iiv03 Posted August 30, 2019 Author Share Posted August 30, 2019 55 minutes ago, #\_oskar_/# said: اطرح كود الشادر | شيدر #include "tex_matrix.fx" /////////////////////////////////////////////////////////////////////////////// // Global variables /////////////////////////////////////////////////////////////////////////////// texture sPicTexture; texture sMaskTexture; float2 gUVPrePosition = float2( 0, 0 ); float2 gUVScale = float( 1 ); // UV scale float2 gUVScaleCenter = float2( 0.5, 0.5 ); float gUVRotAngle = float( 0 ); // UV Rotation float2 gUVRotCenter = float2( 0.5, 0.5 ); float2 gUVPosition = float2( 0, 0 ); // UV position /////////////////////////////////////////////////////////////////////////////// // Functions /////////////////////////////////////////////////////////////////////////////// //------------------------------------------- // Returns UV transform using external settings //------------------------------------------- float3x3 getTextureTransform() { return makeTextureTransform( gUVPrePosition, gUVScale, gUVScaleCenter, gUVRotAngle, gUVRotCenter, gUVPosition ); } /////////////////////////////////////////////////////////////////////////////// // Techniques /////////////////////////////////////////////////////////////////////////////// technique hello { pass P0 { // Set up texture stage 0 Texture[0] = sPicTexture; TextureTransform[0] = getTextureTransform(); TextureTransformFlags[0] = Count2; AddressU[0] = Clamp; AddressV[0] = Clamp; // Color mix texture and diffuse ColorOp[0] = Modulate; ColorArg1[0] = Texture; ColorArg2[0] = Diffuse; // Alpha mix texture and diffuse AlphaOp[0] = Modulate; AlphaArg1[0] = Texture; AlphaArg2[0] = Diffuse; // Set up texture stage 1 Texture[1] = sMaskTexture; TexCoordIndex[1] = 0; AddressU[1] = Clamp; AddressV[1] = Clamp; // Color pass through from stage 0 ColorOp[1] = SelectArg1; ColorArg1[1] = Current; // Alpha modulate mask texture with stage 0 AlphaOp[1] = Modulate; AlphaArg1[1] = Current; AlphaArg2[1] = Texture; // Disable texture stage 2 ColorOp[2] = Disable; AlphaOp[2] = Disable; } } 7 minutes ago, N3xT said: ... أكوادك ناقصة, اطرحها كاملة حبيبي أكواد مو ناقصه Link to comment
iiv03 Posted August 31, 2019 Author Share Posted August 31, 2019 (edited) انحلت Edited August 31, 2019 by xFabel Link to comment
N3xT Posted August 31, 2019 Share Posted August 31, 2019 (edited) posX, posY, radarX, radarY, radar.size, radar.size, radar.scale, radar.zoomScale, math_rad اذا اكوادك مو ناقصة, ممكن تقولي وين عرّفت المتغيرات اللي فوق؟ Edited August 31, 2019 by N3xT 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