Jump to content

Help!


frosbite

Recommended Posts

Hi!

my question is: how to get pink color of smokes?

i have this http://prntscr.com/32q59j

smoke.lua

local disablingSmokeKey = "F10" 
local smoke, tec = dxCreateShader("smoke.fx") 
function enablesmoke() engineApplyShaderToWorldTexture(smoke, "*smoke*") end 
function disablesmoke() engineRemoveShaderFromWorldTexture(smoke, "*smoke*") end 
addEventHandler("onClientResourceStart", resourceRoot, function() 
    outputChatBox("#FFFFFFResource #FF0000'" .. getResourceName(getThisResource()) .. "'#FFFFFF To Disable Smoke press (F10)#FFFFFF!", 255, 255, 255, true ) 
    enablesmoke() 
    enabledSmoke = true 
end) 
bindKey(disablingSmokeKey, "down", function() 
  if enabledSmoke then 
    disablesmoke() 
    outputChatBox("#666666The smoke was turned #FF0000off#666666!", 255, 255, 255, true) 
    enabledSmoke = false 
  else 
    enablesmoke() 
    outputChatBox("#666666The smoke was turned #00FF00on#666666!", 255, 255, 255, true) 
    enabledSmoke = true 
  end 
end) 
-- The Body. Author: FornetGear© 

smoke.fx

#include "mta-helper.fx" 
sampler Sampler0 = sampler_state 
{ 
    Texture         = (gTexture0); 
    MinFilter       = Linear; 
    MagFilter       = Linear; 
    MipFilter       = Linear; 
}; 
struct VSInput 
{ 
    float3 Position : POSITION0; 
    float3 Normal : NORMAL0; 
    float4 Diffuse : COLOR5; 
    float2 TexCoord : TEXCOORD0; 
}; 
struct PSInput 
{ 
    float4 Position : POSITION0; 
    float4 Diffuse : COLOR5; 
    float2 TexCoord : TEXCOORD0; 
}; 
PSInput VertexShaderFunction(VSInput VS) 
{ 
    PSInput PS = (PSInput)0; 
    PS.Position = mul(float4(VS.Position, 1), gWorldViewProjection); 
    PS.TexCoord = VS.TexCoord; 
    PS.Diffuse = MTACalcGTABuildingDiffuse( VS.Diffuse ); 
    return PS; 
} 
float4 PixelShaderFunction(PSInput PS) : COLOR0 
{ 
    float4 texel = tex2D(Sampler0, PS.TexCoord); 
    float3 pixel = texel.rgb; 
    float4 diffuse = PS.Diffuse; 
    float intensity = diffuse.r * 0.2126 + diffuse.g * 0.7152 + diffuse.b * 0.0722; 
    if ( intensity <= 0.05 ) 
        pixel *= 0.1; 
    else if ( intensity <= 0.5 ) 
        pixel *= 0.35; 
    else if ( intensity <= 0.95 ) 
        pixel *= 0.7; 
    return float4(pixel.rgb, texel.a); 
} 
technique smoke 
{ 
    pass P0 
    { 
        VertexShader = compile vs_3_0 VertexShaderFunction(); 
        PixelShader = compile ps_3_0 PixelShaderFunction(); 
    } 
} 

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...