Hallo ich habe mir dieses Shader Script Gedownloadet:
http://www.youtube.com/watch?v=XjxZW-…TKRj9C_tqC5euk=
Jetzt hab ich ein Problem ich habe dann das gestartet aber es erstellt das nicht?!
Es kommen bei mir auch keine Errors?!
Hier das Script Client:
Lua
local SCREEN_WIDTH, SCREEN_HEIGHT = guiGetScreenSize ()
local shader, screen, texture
local SPEED = 1
addEventHandler("onClientResourceStart", resourceRoot,
function ()
-- Create shader
shader, tec = dxCreateShader ("texturereplace_clamp.fx")
if not shader then
outputChatBox ("Could not create shader. Please use debugscript 3")
else
-- Create texture and screen source
texture = dxCreateRenderTarget (400, 400, true)
-- Set the shader's replacement texture to our newly created one
dxSetShaderValue (shader, "gTexture", texture)
dxSetShaderValue (shader, "gHScale", 1)
dxSetShaderValue (shader, "gVScale", 1)
-- Apply shader to all vehicles using vehicle colors
engineApplyShaderToWorldTexture (shader, "heat_02")
loadburnTextures ()
addEventHandler ("onClientHUDRender", getRootElement(), renderScreen)
end
end
)
local burnTex = {}
local burnId = 1
local startTick = 0
function loadburnTextures ()
for i = 1, 24 do
table.insert (burnTex, dxCreateTexture ("burn/burn"..i..".png"))
end
end
function renderScreen ()
local frame = math.floor (((getTickCount () * SPEED) / 150) % 24)
dxSetRenderTarget (texture, true)
dxDrawImage (0, 0, 400, 400, burnTex [ frame + 1 ], 0, 0, 0)
dxSetRenderTarget ()
end
Alles anzeigen
Hier das andere Client:
Lua
//////////////////////////////////////////////////////////////////////////
// MTA-Defined variables
//////////////////////////////////////////////////////////////////////////
float4x4 gWorld : WORLD;
float4x4 gView : VIEW;
float4x4 gProj : PROJECTION;
//////////////////////////////////////////////////////////////////////////
// Variables
//////////////////////////////////////////////////////////////////////////
texture gTexture;
float gHScale = 1.0;
float gVScale = 1.0;
float gHOffset = 0.0;
float gVOffset = 0.0;
//////////////////////////////////////////////////////////////////////////
// Texture sampler
//////////////////////////////////////////////////////////////////////////
sampler2D gTextureSampler = sampler_state
{
Texture = ( gTexture );
MinFilter = Linear;
MagFilter = Linear;
AddressU = Clamp;
AddressV = Clamp;
};
//////////////////////////////////////////////////////////////////////////
// Structs
//////////////////////////////////////////////////////////////////////////
struct VertexShaderInput
{
float4 Position : POSITION0;
float2 TextureCoordinate : TEXCOORD0;
};
struct PixelShaderInput
{
float4 Position : POSITION0;
float2 TextureCoordinate : TEXCOORD0;
};
//////////////////////////////////////////////////////////////////////////
// Vertex shader
//////////////////////////////////////////////////////////////////////////
PixelShaderInput VertexShaderFunction ( VertexShaderInput input )
{
PixelShaderInput output;
float4 worldPosition = mul ( input.Position, gWorld );
float4 viewPosition = mul ( worldPosition, gView );
output.Position = mul ( viewPosition, gProj );
output.TextureCoordinate = input.TextureCoordinate;
return output;
}
//////////////////////////////////////////////////////////////////////////
// Pixel shader
//////////////////////////////////////////////////////////////////////////
float4 PixelShaderFunction ( PixelShaderInput input ) : COLOR0
{
float2 textureCoordinate = input.TextureCoordinate;
textureCoordinate[0] *= gHScale;
textureCoordinate[1] *= gVScale;
textureCoordinate[0] += gHOffset;
textureCoordinate[1] += gVOffset;
float4 textureColor = tex2D ( gTextureSampler, textureCoordinate );
return textureColor;
}
//////////////////////////////////////////////////////////////////////////
// Techniques
//////////////////////////////////////////////////////////////////////////
technique TextureReplace
{
pass P0
{
// Enable Alpha Blending
AlphaBlendEnable = TRUE;
DestBlend = INVSRCALPHA;
SrcBlend = SRCALPHA;
// Compile vertex- and pixel shaders
VertexShader = compile vs_1_1 VertexShaderFunction ( );
PixelShader = compile ps_2_0 PixelShaderFunction ( );
}
}
Alles anzeigen
Was muss ich ändern dass es erstellt wird und klappt?!