Jump to content

Krokara

Members
  • Posts

    15
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

Krokara's Achievements

Square

Square (6/54)

0

Reputation

  1. 3d round object is already done
  2. if create an object how will do those effects?
  3. Thank you the role follows the character's camera a how I can make the vertices be round? exemple: can be done using: dxDrawImage3D?
  4. how can i be implementing this function? function: get_billboard_vertices addEventHandler("onClientRender", root, function() pos = {getElementPosition(localPlayer)} primitive = { {pos[1]+5, pos[2], pos[3]+5, 2, 2}, {pos[1]-5, pos[2]-5, pos[3]+5, 2 , 3}, {pos[1]-5, pos[2], pos[3]+5, 3,4 }, {pos[1], pos[2], pos[3], 4,5} } dxDrawMaterialPrimitive3D ("trianglestrip", dxCreateTexture("images/kame-ball2.png"), false, unpack(primitive)) end )
  5. In this video the power to maintain a shape even if you change angle exemple:
  6. I managed to make a triangle with this function: DrawPrimitive 3D, using but its width is thin and it has no width the triangle is without shape
  7. I can't draw it cx, cy, cz = getPositionFromElementOffset(localPlayer,0.1, 0.5, 1) dxDrawMaterialPrimitive3D ( "trianglelist", texturas[math.ceil(img)], false, cx, cy, cz, cx+5, cy+20)
  8. how can I make these powers in the character's hand exemple: https://www.youtube.com/watch?v=X_RwBv_7IWE
  9. myShader = dxCreateShader( "models/Arashi.fx" ) -- Create shader function dxshader( ) dxDrawImage( 100, 350, 300, 350, myShader ) end addCommandHandler("ts", function(commandName) addEventHandler("onClientRender", root, dxshader) myTexture = dxCreateTexture( "models/electricity_effect.jpg" ) dxSetShaderValue( myShader, "noiseTex", myTexture ) end) mta.xml <file src="models/electricity_effect.jpg" />
  10. https://ru.wikipedia.org/wiki/HLSL that was it thank, is the code right? myShader = dxCreateShader( "models/Arashi.fx" ) -- Create shader myTexture = dxCreateTexture( "models/electricity_effect.jpg" ) dxSetShaderValue( myShader, "noiseTex", myTexture ) dxDrawImage( 100, 350, 300, 350, myShader ) not give an error but also does not display the shader
  11. That was it Presented something new is not recognizing float2 in line 37,4 float2 t = float2(speed * time_0_X * 0.5871 - vertNoise * abs(texCoord.y), speed * time_0_X);
  12. Truth seems like I hadn't updated the file, do you know what the problem is now? struct VS_OUTPUT { float4 Pos: POSITION; float2 texCoord: TEXCOORD; }; VS_OUTPUT VS_Electricity(float4 Pos: POSITION) { VS_OUTPUT Out; // Clean up inaccuracies Pos.xy = sign(Pos.xy); Out.Pos = float4(Pos.xy, 0, 1); Out.texCoord = Pos.xy; return Out; } float4 color = float4(0, 0, 0, 0); float glowStrength = 6; float height = 5; float glowFallOff = 1; float speed = 2; float sampleDist = 0; float ambientGlow = 1; float ambientGlowHeightScale = 0; float vertNoise = 6; float time_0_X = 0; sampler Noise = sampler_state { Texture = ; }; float4 PS_Electricity(float2 texCoord: TEXCOORD) : COLOR float2 t = float2(speed * time_0_X * 0.5871 - vertNoise * abs(texCoord.y), speed * time_0_X); // Sample at three positions for some horizontal blu // The shader should blur fine by itself in vertical directio float xs0 = texCoord.x - sampleDist; float xs1 = texCoord.x; float xs2 = texCoord.x + sampleDist; // Noise for the three sample float noise0 = tex3D(Noise, float3(xs0, t)); float noise1 = tex3D(Noise, float3(xs1, t)); float noise2 = tex3D(Noise, float3(xs2, t)); // The position of the flas float mid0 = height * (noise0 * 2 - 1) * (1 - xs0 * xs0); float mid1 = height * (noise1 * 2 - 1) * (1 - xs1 * xs1); float mid2 = height * (noise2 * 2 - 1) * (1 - xs2 * xs2); // Distance to flas float dist0 = abs(texCoord.y - mid0); float dist1 = abs(texCoord.y - mid1); float dist2 = abs(texCoord.y - mid2); // Glow according to distance to flas float glow = 1.0 - pow(0.25 * (dist0 + 2 * dist1 + dist2), glowFallOff); // Add some ambient glow to get some power in the air feeling float ambGlow = ambientGlow * (1 - xs1 * xs1) * (1 - abs(ambientGlowHeightScale * texCoord.y)); return (glowStrength * glow * glow + ambGlow) * color; } technique TS { pass P0 { VertexShader = compile vs_2_0 VS_Electricity(); PixelShader = compile ps_3_0 PS_Electricity(); } }
  13. Hi, thank you very much hope to get it too, I think the technique is not being loaded yet struct VS_OUTPUT { float4 Pos: POSITION; float2 texCoord: TEXCOORD; }; VS_OUTPUT VS_Electricity(float4 Pos: POSITION) { VS_OUTPUT Out; // Clean up inaccuracies Pos.xy = sign(Pos.xy); Out.Pos = float4(Pos.xy, 0, 1); Out.texCoord = Pos.xy; return Out; } float4 color = float4(0, 0, 0, 0); float glowStrength = 6; float height = 5; float glowFallOff = 1; float speed = 2; float sampleDist = 0; float ambientGlow = 1; float ambientGlowHeightScale = 0; float vertNoise = 6; float time_0_X = 0; sampler Noise = sampler_state { Texture = ; }; float4 PS_Electricity(float2 texCoord: TEXCOORD) : COLOR float2 t = float2(speed * time_0_X * 0.5871 - vertNoise * abs(texCoord.y), speed * time_0_X); // Sample at three positions for some horizontal blu // The shader should blur fine by itself in vertical directio float xs0 = texCoord.x - sampleDist float xs1 = texCoord.x float xs2 = texCoord.x + sampleDist; // Noise for the three sample float noise0 = tex3D(Noise, float3(xs0, t)) float noise1 = tex3D(Noise, float3(xs1, t)) float noise2 = tex3D(Noise, float3(xs2, t)); // The position of the flas float mid0 = height * (noise0 * 2 - 1) * (1 - xs0 * xs0) float mid1 = height * (noise1 * 2 - 1) * (1 - xs1 * xs1) float mid2 = height * (noise2 * 2 - 1) * (1 - xs2 * xs2); // Distance to flas float dist0 = abs(texCoord.y - mid0) float dist1 = abs(texCoord.y - mid1) float dist2 = abs(texCoord.y - mid2); // Glow according to distance to flas float glow = 1.0 - pow(0.25 * (dist0 + 2 * dist1 + dist2), glowFallOff); // Add some ambient glow to get some power in the air feeling float ambGlow = ambientGlow * (1 - xs1 * xs1) * (1 - abs(ambientGlowHeightScale * texCoord.y)); return (glowStrength * glow * glow + ambGlow) * color; } technique TS { pass P0 { VertexShader = compile vs_2_0 VS_Electricity(); PixelShader = compile ps_3_0 PS_Electricity(); } } Maybe it's a mistake I made converting to mta shader file in hsls xna FX struct VS_OUTPUT { float4 Pos: POSITION; float2 texCoord: TEXCOORD; }; VS_OUTPUT VS_Electricity(float4 Pos: POSITION) { VS_OUTPUT Out; // Clean up inaccuracies Pos.xy = sign(Pos.xy); Out.Pos = float4(Pos.xy, 0, 1); Out.texCoord = Pos.xy; return Out; } float4 color: register(c1); float glowStrength: register(c2); float height: register(c3); float glowFallOff: register(c4); float speed: register(c5); float sampleDist: register(c6); float ambientGlow: register(c7); float ambientGlowHeightScale: register(c8); float vertNoise: register(c9); float time_0_X: register(c0); sampler Noise: register(s0); float4 PS_Electricity(float2 texCoord: TEXCOORD) : COLOR { float2 t = float2(speed * time_0_X * 0.5871 - vertNoise * abs(texCoord.y), speed * time_0_X); // Sample at three positions for some horizontal blur // The shader should blur fine by itself in vertical direction float xs0 = texCoord.x - sampleDist; float xs1 = texCoord.x; float xs2 = texCoord.x + sampleDist; // Noise for the three samples float noise0 = tex3D(Noise, float3(xs0, t)); float noise1 = tex3D(Noise, float3(xs1, t)); float noise2 = tex3D(Noise, float3(xs2, t)); // The position of the flash float mid0 = height * (noise0 * 2 - 1) * (1 - xs0 * xs0); float mid1 = height * (noise1 * 2 - 1) * (1 - xs1 * xs1); float mid2 = height * (noise2 * 2 - 1) * (1 - xs2 * xs2); // Distance to flash float dist0 = abs(texCoord.y - mid0); float dist1 = abs(texCoord.y - mid1); float dist2 = abs(texCoord.y - mid2); // Glow according to distance to flash float glow = 1.0 - pow(0.25 * (dist0 + 2 * dist1 + dist2), glowFallOff); // Add some ambient glow to get some power in the air feeling float ambGlow = ambientGlow * (1 - xs1 * xs1) * (1 - abs(ambientGlowHeightScale * texCoord.y)); return (glowStrength * glow * glow + ambGlow) * color; } I'm learning to work with shaders now if you can help me or specify me a specific tutorial, or even defining the technique does not compile something missing? current code: struct VS_OUTPUT { float4 Pos: POSITION; float2 texCoord: TEXCOORD; }; VS_OUTPUT VS_Electricity(float4 Pos: POSITION) { VS_OUTPUT Out; // Clean up inaccuracies Pos.xy = sign(Pos.xy); Out.Pos = float4(Pos.xy, 0, 1); Out.texCoord = Pos.xy; return Out; } float4 color = float4(0, 0, 0, 0); float glowStrength = 6; float height = 5; float glowFallOff = 1; float speed = 2; float sampleDist = 0; float ambientGlow = 1; float ambientGlowHeightScale = 0; float vertNoise = 6; float time_0_X = 0; sampler Noise = sampler_state { Texture = (gTexture0); }; float4 PS_Electricity(float2 texCoord: TEXCOORD) : COLOR float2 t = float2(speed * time_0_X * 0.5871 - vertNoise * abs(texCoord.y), speed * time_0_X); // Sample at three positions for some horizontal blu // The shader should blur fine by itself in vertical directio float xs0 = texCoord.x - sampleDist float xs1 = texCoord.x float xs2 = texCoord.x + sampleDist; // Noise for the three sample float noise0 = tex3D(Noise, float3(xs0, t)) float noise1 = tex3D(Noise, float3(xs1, t)) float noise2 = tex3D(Noise, float3(xs2, t)); // The position of the flas float mid0 = height * (noise0 * 2 - 1) * (1 - xs0 * xs0) float mid1 = height * (noise1 * 2 - 1) * (1 - xs1 * xs1) float mid2 = height * (noise2 * 2 - 1) * (1 - xs2 * xs2); // Distance to flas float dist0 = abs(texCoord.y - mid0) float dist1 = abs(texCoord.y - mid1) float dist2 = abs(texCoord.y - mid2); // Glow according to distance to flas float glow = 1.0 - pow(0.25 * (dist0 + 2 * dist1 + dist2), glowFallOff); // Add some ambient glow to get some power in the air feeling float ambGlow = ambientGlow * (1 - xs1 * xs1) * (1 - abs(ambientGlowHeightScale * texCoord.y)); return (glowStrength * glow * glow + ambGlow) * color; } technique TS { pass P0 { VertexShader = compile vs_2_0 VS_Electricity(); PixelShader = compile ps_3_0 PS_Electricity(); } }
  14. struct VS_OUTPUT { float4 Pos: POSITION; float2 texCoord: TEXCOORD; }; VS_OUTPUT VS_Electricity(float4 Pos: POSITION) { VS_OUTPUT Out; // Clean up inaccuracies Pos.xy = sign(Pos.xy); Out.Pos = float4(Pos.xy, 0, 1); Out.texCoord = Pos.xy; return Out; } float4 color = float4(0, 0, 0, 0); float glowStrength = 6; float height = 5; float glowFallOff = 1; float speed = 2; float sampleDist = 0; float ambientGlow = 1; float ambientGlowHeightScale = 0; float vertNoise = 6; float time_0_X = 0; sampler Noise = sampler_state { Texture = ; }; float4 PS_Electricity(float2 texCoord: TEXCOORD) : COLOR float2 t = float2(speed * time_0_X * 0.5871 - vertNoise * abs(texCoord.y), speed * time_0_X); // Sample at three positions for some horizontal blu // The shader should blur fine by itself in vertical directio float xs0 = texCoord.x - sampleDist float xs1 = texCoord.x float xs2 = texCoord.x + sampleDist; // Noise for the three sample float noise0 = tex3D(Noise, float3(xs0, t)) float noise1 = tex3D(Noise, float3(xs1, t)) float noise2 = tex3D(Noise, float3(xs2, t)); // The position of the flas float mid0 = height * (noise0 * 2 - 1) * (1 - xs0 * xs0) float mid1 = height * (noise1 * 2 - 1) * (1 - xs1 * xs1) float mid2 = height * (noise2 * 2 - 1) * (1 - xs2 * xs2); // Distance to flas float dist0 = abs(texCoord.y - mid0) float dist1 = abs(texCoord.y - mid1) float dist2 = abs(texCoord.y - mid2); // Glow according to distance to flas float glow = 1.0 - pow(0.25 * (dist0 + 2 * dist1 + dist2), glowFallOff); // Add some ambient glow to get some power in the air feeling float ambGlow = ambientGlow * (1 - xs1 * xs1) * (1 - abs(ambientGlowHeightScale * texCoord.y)); return (glowStrength * glow * glow + ambGlow) * color; } IN LUA addEventHandler("onClientRender", root, function() if myShader then dxDrawImage( 100, 350, 300, 350, myShader ) end end ) addCommandHandler("tester", function ( commandName ) if not myShader then myShader = dxCreateShader( "models/arashi.fx" ) -- Create shader else destroyElement( myShader ) -- Destroy shader myShader = nil end end)
  15. waters have holes after i erase the map i'm making a whole new map and these holes are holding me back from what i can do?
×
×
  • Create New...