Einheit-101

Members
  • Content Count

    489
  • Joined

  • Last visited

Community Reputation

33 Good

About Einheit-101

  • Rank
    Hustler

Details

  • Gang
    Ice Cold Killahs

Recent Profile Visitors

2,679 profile views
  1. Yes of course, however i shut down the "real" public map editor, so anyone who wants to map has to get the password for the other map editor. I can PM the password to anyone, if he wants.
  2. Join the public map editor server, it has all map objects included. Or convert some yourself, map your own map and send me the resources when finished.
  3. Mechanics on a spawn point are not a big problem, but imagine a cap defender. He needs to be a real danger but at the same time not OP. And they could fire through collisionless objects (bushes) and what-not... Really never going to happen. Also how should active medics work? I would need to create an AI that actively finds routes on maps to get to players, thats literally impossible. Its really not like "create Ped, set ped walking, done"
  4. Adding bots causes new problems because every ped causes a Performance impact, players included. Since i already run into performance issues when having more than 30 players in one place i think its a bad idea to add bots. Firing bot defenders also require a script that controls them. I have other plans regarding bots but i doubt i can realize them at the moment because of the bad Performance.
  5. The problem is -much work for next update -no time to do it
  6. Merry Christmas everyone. I got a report of a teamkiller. Someone please take actions against him. https://imgur.com/a/K1knF52
  7. I dont know what it was, i can tell you it is a boat, most likely a bugged merchant. I could know it if i was online.
  8. Einheit-101

    Applying a dynamic depth bias to a shader possible?

    I "solved" the problem by using no depth bias at all (lol) and i simply applied shader_soft_particles to all other effects that interfere with water (boatwake1, coronaringa). This solution isnt really perfect but it seems okay.... Ren712 seems to disable depthBias entirely and it looks like he uses a code that manipulates pixel depth in the pixel shader function, fading out the color output depending on his custom calculated depth values: By looking at his soft_particles resource he has this as input: texture gDepthBuffer : DEPTHBUFFER; And this sampler where he "samples" the depth buffer (i still dont know what a sampler really is and what this does) sampler SamplerDepth = sampler_state { Texture = (gDepthBuffer); AddressU = Clamp; AddressV = Clamp; }; He then has this pixel shader function where he calls the function "FetchDepthBufferValue" and he fades the output depending on his own depth: float4 PixelShaderFunctionDB(PSInput PS) : COLOR0 { float2 TexCoordProj = PS.TexCoordProj.xy / PS.TexCoordProj.z; TexCoordProj += float2( 0.0006, 0.0009 ); float BufferValue = FetchDepthBufferValue( TexCoordProj ); float depth = Linearize( BufferValue ); float fade = saturate( ( depth - ( PS.DistFromCam + fDistAdd ) * fDistMult ) * fDepthSpread); float4 color = tex2D( Sampler0 ,PS.TexCoord); color *= PS.Diffuse; color.a *= fade; return color; } This is the FetchDepthBufferValue function, i have not even remotely a clue how this thing works but i guess it "returns" the depth of a given depth buffer coordinate, i guess this "tex2D" thing "converts" the depth buffer into a "picture" that can be used to do some fancy math with it: float FetchDepthBufferValue( float2 uv ) { float4 texel = tex2D(SamplerDepth, uv); #if IS_DEPTHBUFFER_RAWZ float3 rawval = floor(255.0 * texel.arg + 0.5); float3 valueScaler = float3(0.996093809371817670572857294849, 0.0038909914428586627756752238080039, 1.5199185323666651467481343000015e-5); return dot(rawval, valueScaler / 255.0); #else return texel.r; #endif } Enabling zWrite in a water shader does actually solve many GTA issues, for example effects (bubbles...) are no longer drawn in front of the water and the game recognizes the water surface as something physical. But given all these zfighting issues, now i know why they decided to do so....
  9. Hello Community! I have literally zero hope of someone helping me since no one has a clue about how shaders work (including me), but i am using the open-source cswp water shader from Sam@ke and i want to enable zWriting in this shader to make it work together with dynamic lighting + SSAO. Now i get some issues with zFighting and because i am not fully stupid i added depthBias 0.0002 to the shader. This fixes the zFighting but it also causes extreme visual artifacts if the camera is further away from the water pixels. The solution would be to calculate a dynamic depthBias value that has a high value (0.0002 or something like that) if the pixel is close to the camera and a very low value (0.0000001 or something like that) if the pixel is far away from the camera. Since @Sam@ke and @Ren_712 seem to have abandoned MTA for now, i couldnt get help from them. The following stuff are screenshots and the full cswp water shader with my modifications. I would be glad if someone came up with an idea. No depth bias = zFighting: https://i.imgur.com/BoAmqaB.png High depth bias value = zFighting fixed https://i.imgur.com/IQYtl7S.png But issues start happening with distance to the water pixels: https://i.imgur.com/sbBr1Zn.png At even more distance issues are completely obvious: https://i.imgur.com/AkT337k.png //--CSWP water shader by Sam@ke, its free to use but keep his name in mind //-- Include some common stuff #include "mta-helper.fx" float Time : Time; texture skyBoxTexture1; texture skyBoxTexture2; float3 skyRotate = float3(0, 0, 0); float fadeValue = 0; texture causticTexture; texture reflectionTexture; texture refractionTexture; texture normalTexture; float flowSpeed = 0.0; float reflectScale = 0.0; float refractScale = 0.0; float reflectionStrength = 0.0; float refractionStrength = 0.0; float causticStrength = 0.0; float4 waterColor = float4(0.0, 0.0, 0.0, 0.0); float waterAlpha = 0.0; float waterBrightness = 1.0; float3 sunPos = float3(0, 0, 0); float4 sunColor = float4(0.0, 0.0, 0.0, 0.0); float specularSize = 4; float waterShiningPower = 1; float fogStart = 50; float fogEnd = 550; /////////////////// // SAMPLE STATES // /////////////////// sampler CausticSampler = sampler_state { Texture = <causticTexture>; MinFilter = Linear; MagFilter = Linear; MipFilter = Linear; AddressU = Wrap; AddressV = Wrap; }; sampler ReflectionSampler = sampler_state { Texture = <reflectionTexture>; MinFilter = Linear; MagFilter = Linear; MipFilter = Linear; AddressU = Mirror; AddressV = Mirror; }; sampler RefractionSampler = sampler_state { Texture = <refractionTexture>; MinFilter = Linear; MagFilter = Linear; MipFilter = Linear; AddressU = Mirror; AddressV = Mirror; }; sampler NormalSampler = sampler_state { Texture = <normalTexture>; MinFilter = Linear; MagFilter = Linear; MipFilter = Linear; AddressU = Wrap; AddressV = Wrap; }; samplerCUBE SkyCubeSampler1 = sampler_state { Texture = <skyBoxTexture1>; MinFilter = Linear; MagFilter = Linear; MipFilter = Linear; AddressU = Clamp; AddressV = Clamp; }; samplerCUBE SkyCubeSampler2 = sampler_state { Texture = <skyBoxTexture2>; MinFilter = Linear; MagFilter = Linear; MipFilter = Linear; AddressU = Clamp; AddressV = Clamp; }; float3x3 eulRotate(float3 Rotate) { float cosX,sinX; float cosY,sinY; float cosZ,sinZ; sincos(Rotate.x,sinX,cosX); sincos(-Rotate.y,sinY,cosY); sincos(Rotate.z,sinZ,cosZ); //Euler extrinsic rotations //http://www.vectoralgebra.info/eulermatrix.html float3x3 rot = float3x3( cosY * cosZ + sinX * sinY * sinZ, -cosX * sinZ, sinX * cosY * sinZ - sinY * cosZ, cosY * sinZ - sinX * sinY * cosZ, cosX * cosZ, -sinY * sinZ - sinX * cosY * cosZ, cosX * sinY, sinX, cosX * cosY ); return rot; } struct VertexInputType { float3 position : POSITION; float3 normal : NORMAL0; float2 textureCoords : TEXCOORD0; }; struct PixelInputType { float4 position : POSITION; float2 textureCoords : TEXCOORD0; float4 reflectionPosition : TEXCOORD1; float4 refractionPosition : TEXCOORD2; float3 skyTextureCoordinate : TEXCOORD3; float Depth : TEXCOORD4; float3 worldPosition : TEXCOORD5; float3 lightDirection : TEXCOORD6; float3 worldNormal : TEXCOORD7; }; //////////////////////////////////////////////////////////////////////////////// // Vertex Shader //////////////////////////////////////////////////////////////////////////////// PixelInputType WaterVertexShader(VertexInputType input) { PixelInputType output; matrix reflectProjection; matrix refractProjection; // Calculate the position of the vertex against the world, view, and projection matrices. output.position = MTACalcScreenPosition(input.position); output.worldPosition = MTACalcWorldPosition(input.position); output.lightDirection = normalize(gCameraPosition - sunPos); output.worldNormal = MTACalcWorldNormal(input.normal); // Store the texture coordinates for the pixel shader. output.textureCoords = input.textureCoords; // Create the view projection world matrix for reflection. reflectProjection = mul(gWorldViewProjection, gWorld); reflectProjection = mul(gWorld, reflectProjection); // Calculate the input position against the refractProjection matrix. output.reflectionPosition = mul(float4(input.position, 1), reflectProjection); // Create the view projection world matrix for refraction. refractProjection = mul(gWorldViewProjection, gWorld); refractProjection = mul(gWorld, refractProjection); // Calculate the input position against the refractProjection matrix. output.refractionPosition = mul(float4(input.position, 1), refractProjection); float4 vertexPosition = mul(float4(input.position, 1), gWorld); // compute the eye vector float4 eyeVector = vertexPosition - gViewInverse[3]; output.skyTextureCoordinate = mul(eulRotate(skyRotate), eyeVector.xyz); output.Depth = output.position.z; return output; } //////////////////////////////////////////////////////////////////////////////// // Pixel Shader //////////////////////////////////////////////////////////////////////////////// float4 WaterPixelShader(PixelInputType input) : COLOR0 { float2 refractTexCoord; float2 reflectTexCoord; float3 skyBoxReflectTexCoord; float3 skyBoxTexCoord; float4 normalMap; float3 normal; float4 reflectionColor; float4 refractionColor; float4 causticColor; float4 skyColor; float4 color; float timer = (Time/12) * flowSpeed; // Move the position the water normal is sampled from to simulate moving water. // Calculate the projected refraction texture coordinates. reflectTexCoord.x = input.reflectionPosition.x / input.reflectionPosition.w / 2.0f + 0.5f; reflectTexCoord.y = -input.reflectionPosition.y / input.reflectionPosition.w / 2.0f + 0.5f; refractTexCoord.x = input.refractionPosition.x / input.refractionPosition.w / 2.0f + 0.5f; refractTexCoord.y = -input.refractionPosition.y / input.refractionPosition.w / 2.0f + 0.5f; skyBoxReflectTexCoord.x = -input.skyTextureCoordinate.x / 1 / 2.0f + 0.5f; skyBoxReflectTexCoord.y = -input.skyTextureCoordinate.y / 1 / 2.0f + 0.5f; skyBoxReflectTexCoord.z = input.skyTextureCoordinate.z / 1 / 2.0f + 0.5f; // Sample the normal from the normal map texture. float2 NormalTex = input.textureCoords; NormalTex.y = NormalTex.y + timer; normalMap = tex2D(NormalSampler, NormalTex); // Expand the range of the normal from (0,1) to (-1,+1). normal = (normalMap.xyz * 2.0f) - 1.0f; // Re-position the texture coordinate sampling position by the normal map value to simulate the rippling wave effect. reflectTexCoord = reflectTexCoord + (normal.xy * reflectScale); refractTexCoord = refractTexCoord + (normal.xy * refractScale); skyBoxReflectTexCoord = skyBoxReflectTexCoord + (normal * reflectScale); // Sample the texture pixels from the textures using the updated texture coordinates. float2 CausticTex = input.textureCoords; CausticTex.y = CausticTex.y + (sin(CausticTex.y * 10) * 0.01) + timer; causticColor = tex2D(CausticSampler, CausticTex); float4 skyColor1 = texCUBE(SkyCubeSampler1, 1 - skyBoxReflectTexCoord.yzx); float4 skyColor2 = texCUBE(SkyCubeSampler2, 1 - skyBoxReflectTexCoord.yzx); float4 finalSkyColor = (skyColor2 * fadeValue) + (skyColor1 * (1 - fadeValue)); reflectionColor = tex2D(ReflectionSampler, reflectTexCoord) * reflectionStrength; refractionColor = tex2D(RefractionSampler, refractTexCoord) * refractionStrength; // Using Blinn half angle modification for performance over correctness float3 lightRange = normalize(normalize(gCameraPosition - input.worldPosition) - input.lightDirection); float specularLight = pow(saturate(dot(lightRange, normal)), specularSize * 2); float4 specularColor = float4(sunColor.rgb * specularLight, 1); specularColor += pow(saturate(dot(lightRange, input.worldNormal)), specularSize / 2) / 2; specularColor *= normalMap.g * normalMap.g; // Combine the reflection and refraction results for the final color. color = lerp(reflectionColor * reflectionStrength, refractionColor * refractionStrength, 2.0f); color *= causticColor * causticStrength; color += finalSkyColor * waterColor * reflectionStrength; float distanceFog = saturate((input.Depth - fogStart)/(fogEnd - fogStart)); float4 finalColor = lerp(float4(color.rgb, 1), float4(reflectionColor.rgb/2, 1), distanceFog); finalColor.rgb += specularColor.rgb * normalMap * waterShiningPower; finalColor.rgb *= waterBrightness; finalColor.a *= waterAlpha; return finalColor; } //////////////////////////////////////////////////////////////////////////////// // Technique //////////////////////////////////////////////////////////////////////////////// technique WaterTechnique { pass pass0 { ZEnable = true; ZWriteEnable = true; ZFunc = 4; DepthBias = 0.0002; SlopeScaleDepthBias = 5; VertexShader = compile vs_3_0 WaterVertexShader(); PixelShader = compile ps_3_0 WaterPixelShader(); } } // Fallback technique fallback { pass P0 { // Just draw normally } }
  10. I have no report about this. So, most likely, that bug still exists.
  11. We now have a discord channel that has been started by JN. https://discordapp.com/invite/V5u5JTb UPDATE: -New maps: [TANK WAR] Haselnuss (made by JN), [TDM] Hurtgen Forest (made by RUSAA and JN) -Updated maps: [TDM] Italy, [TDM] Snow valley, [TDM] Vacant, [WAR] KDB, [WAR] Berlin-Mitte -Fixed shader_soft_particles not working at all -Fixed a bug that played the hitmarker sound when using flamethrower -Editor server does now support placing of particle effects -Reduced rifle grenade explosion splash radius + reduced grenade velocity + reduced price -Fixed flamethrower looking strange -Engineers do no longer take any damage from gas -Implemented new HUD made by JN -Added our discord channel discord.gg/V5u5JTb to the advertisements -Players can now see a preview of the flight path of thrown grenades -Added a new pumping sound for M37 Ithaca and Grabengewehr -Added new speedboat sound -Updated many 3D models -Added anti-tank grenades -Added smoke grenades -Added a minimum throw force for molotovs and anti-tank grenades (helps to prevent accident suicide) -Added c-element (belgian gate) object -Improved collision model of ships and submarines (and reduced file size) --> The new collisions give me another performance boost of ~10% (35fps -> 39fps on Arctic) -Many objects are no longer double-sided and nearClipDistance is now dynamic to reduce z-fighting artifacts -Increased blast radius of small HE shells (tanks etc) and regular (small) bombs -Tab key now shows your current real-time aswell -Fixed negative oxygen levels -Fixed a bug that prevented the piers from being drawn on the HUD -Fixed wrong team detection when firing virtual projectiles to submarines -Fixed Wehrmacht pier on "Islands" being too close to the base -Fixed a bug that did not enable shops for the new team when being auto-balanced -Fixed a bug that let the player reload while jumping / flying -Fixed a graphical issue with Type 1934 destroyer (missing part) -Completely re-worked dynamic sky shader -Added a new water shader made by Sam@ke for his CSWP resource, heavily modified by me (its still far from perfect but the best we have for MTA) -Further improved sun + water drops shader -dynamic sky sun is now correctly disabled as soon as godray shader starts running -Temporarily (maybe forever) removed all bubble effects (Bubbles are visible through GTA water, rendering bug of GTA engine)
  12. I pay 30$ for the first developer who gives me a code snippet that adds depth fading to a water shader like SA_directX 2.0 does. Something like this doesnt exist in MTA yet, MMGE 3.0 and SA_directX 2.0 water shaders are very far ahead of the simple MTA water shaders. Objects in water get blended invisible after a few meters like in real life. MTA water is completely transparent or completely opaque... I know no single way of achieving something similar without killing the performance by using a layer of 20 transparent material3DLines. Of course the shader effect has to be compatible with any rendering entity in GTA, so it should be applied to the water texture itself - if possible.
  13. Ofc we are still alive, new update coming soon.
  14. I will look at that stuff