Grozz

Members
  • Content count

    31
  • Joined

  • Last visited

  • Days Won

    1

Grozz last won the day on January 1

Grozz had the most liked content!

Community Reputation

22 Decent

6 Followers

About Grozz

  • Rank
    Rat
  • Birthday 05/05/1998

Details

  • Location
    Hungary
  • Interests
    Scripting, Modelling.
  1. [HELP] tables as shader value

    getElementMatrix returns with a table too, and dx shaders cannot read MTA Vectors.
  2. [HELP] tables as shader value

    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 ) };
  3. 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.
  4. I don't know what is going on with the neck. I tried to fix it so many times, but i can't see that glitch in 3ds max.
  5. 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.
  6. [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!
  7. [Help] Aim and run at the same time

    Can you give an example please?
  8. I want to force the player to run and aim at the same time with machine guns. (M4, AK47)
  9. 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?
  10. [SHOW] 3D GUI Library

    all functions has a distance limit parameter.
  11. [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.
  12. [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?
  13. [SHADER] Displacement shader in MTA

    It can handle VS 3.0, Ren_712 said its an exotic issue. I have Ati Mobility Radeon X2300
  14. [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 } }