Grozz

Members
  • Content count

    25
  • Joined

  • Last visited

  • Days Won

    1

Grozz last won the day on January 1

Grozz had the most liked content!

Community Reputation

20 Decent

1 Follower

About Grozz

  • Rank
    Advanced Member
  • Birthday 05/05/98

Details

  • Location
    Hungary
  • Interests
    Scripting, Modelling.
  1. [2017] A Year in Recap and Season Greetings

    Oh my god. I didn't expect that my character customization script will reach much interest. Thank you so much!
  2. [Help] Aim and run at the same time

    Can you give an example please?
  3. I want to force the player to run and aim at the same time with machine guns. (M4, AK47)
  4. Working on a First Person Shooter gamemode, and i found a bug. The event onClientPreRender causes some delay at attachElements. Can somebody reproduce attachElements maths for me?
  5. [SHOW] 3D GUI Library

    all functions has a distance limit parameter.
  6. [SHOW] 3D GUI Library

    I made a 3D GUI System in MTA:SA. You can place 3D GUI Elements (Buttons, Textboxes, Labels, Lists, Checkboxes, Sliders, etc.) wherever you want. It's not public yet.
  7. [SHADER] Displacement shader in MTA

    I want to make face morph with this shader, but i have to figure out how can i supply tex2Dlod function. Is there a way to calculate it with tex2D function in PS, and export it to VS? Or just another solution with Shadermodel 2.0?
  8. [SHADER] Displacement shader in MTA

    It can handle VS 3.0, Ren_712 said its an exotic issue. I have Ati Mobility Radeon X2300
  9. [SHADER] Displacement shader in MTA

    So this shader works, but my Video Card just can't handle the tex2Dlod() function, so the result is crash, blue screen, or MTA just start flashing and lagging at me. // // Example shader - deform.fx // //------------------------------------------------------------------------------------------ // Variables //------------------------------------------------------------------------------------------ texture gDeformTexture; float3 sResizeAmount = float3(0,0,0); bool bIncludeNormal = false; //--------------------------------------------------------------------- // Include some common stuff //--------------------------------------------------------------------- #include "mta-helper.fx" static float PI = 3.14159265359; //--------------------------------------------------------------------- // Sampler for the main texture //--------------------------------------------------------------------- sampler Sampler0 = sampler_state { Texture = (gTexture0); }; sampler SamplerDeform = sampler_state { Texture = (gDeformTexture); MinFilter = Point; MagFilter = Point; MipFilter = None; }; //--------------------------------------------------------------------- // Structure of data sent to the vertex shader //--------------------------------------------------------------------- struct VSInput { float3 Position : POSITION0; float3 Normal : NORMAL0; float4 Diffuse : COLOR0; float3 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; float4 WorldPos : TEXCOORD1; }; //------------------------------------------------------------------------------------------ // VertexShaderFunction //------------------------------------------------------------------------------------------ PSInput VertexShaderFunction(VSInput VS) { PSInput PS = (PSInput)0; // Make sure normal is valid MTAFixUpNormal( VS.Normal ); // deform vertex position float4 defTex = tex2Dlod(SamplerDeform, float4(VS.TexCoord.xy - float2(0,1), 0, 0.0)); if (bIncludeNormal) VS.Position += defTex.xyz * sResizeAmount * VS.Normal.xyz; else VS.Position += defTex.xyz * sResizeAmount; // Calculate screen pos of vertex PS.WorldPos = mul(float4(VS.Position.xyz, 1), gWorld); float4 viewPos = mul(PS.WorldPos, gView); PS.Position = mul(viewPos, gProjection); // Calculate world normal float3 worldNormal = mul(VS.Normal, (float3x3)gWorld); // Pass through tex coord PS.TexCoord = VS.TexCoord.xyz; // Calculate GTA lighting for vehicle PS.Diffuse = MTACalcGTAVehicleDiffuse( worldNormal, VS.Diffuse ); return PS; } //------------------------------------------------------------------------------------------ // MTAApplyFog //------------------------------------------------------------------------------------------ int gFogEnable < string renderState="FOGENABLE"; >; float4 gFogColor < string renderState="FOGCOLOR"; >; float gFogStart < string renderState="FOGSTART"; >; float gFogEnd < string renderState="FOGEND"; >; float3 MTAApplyFog( float3 texel, float3 worldPos ) { if ( !gFogEnable ) return texel; float DistanceFromCamera = distance( gCameraPosition, worldPos ); float FogAmount = ( DistanceFromCamera - gFogStart )/( gFogEnd - gFogStart ); texel.rgb = lerp(texel.rgb, gFogColor.rgb, saturate( FogAmount ) ); return texel; } //------------------------------------------------------------------------------------------ // PixelShaderFunction //------------------------------------------------------------------------------------------ float4 PixelShaderFunction(PSInput PS) : COLOR0 { // sample color texture float4 finalColor = tex2D(Sampler0, PS.TexCoord.xy); // multiply by vertex color finalColor *= PS.Diffuse; // recreate fog finalColor.rgb = MTAApplyFog( finalColor.rgb, PS.WorldPos.xyz ); return saturate(finalColor); } //------------------------------------------------------------------------------------------ // Techniques //------------------------------------------------------------------------------------------ technique deform { pass P0 { VertexShader = compile vs_3_0 VertexShaderFunction(); PixelShader = compile ps_3_0 PixelShaderFunction(); } } // Fallback technique fallback { pass P0 { // Just draw normally } }
  10. [SHADER] Displacement shader in MTA

    I know pedmorph, but i don't want to morph the whole model, just a part of it.
  11. Hi! I made a simple character customization in MTA with CJ skin, bone_attach, and some custom models. I want to make a new version, like Sims or Saints Row's Character customizations. Its possible to make it, but I need a very simple displacement mapping shader to finish. (https://en.wikipedia.org/wiki/Displacement_mapping) If someone can write that shader, please notice me. Character customization video:
  12. [SHOW] Character Customization in MTA

    No, it will be used on my server. Thanks!
  13. [SHOW] Character Customization in MTA

    Those are custom models attached to the head.
  14. [SHOW] Character Customization in MTA

    Its CJ skin and custom models.