Jump to content

Shader in flames


manawydan

Recommended Posts

thanks. But i am try use the shader and no work, first i try shader the flame, but no work, after to all and no work.

script

shar.lua

  
  
addEventHandler( "onClientResourceStart", resourceRoot, 
    function() 
local texture = dxCreateTexture ("fire.png") 
 shaderL = dxCreateShader ( "Amaterasu.fx" ) 
dxSetShaderValue ( shaderL, "gTexture", texture ) 
engineApplyShaderToWorldTexture ( shaderL, "all") 
    end) 
     

shader

Amaterasu.fx

texture gTexture; 
technique TexReplace 
{ 
    pass P0 
    { 
        Texture[0] = gTexture;  
    } 
} 

my meta.xml is fine and no errors in debug.

Link to comment

You're applying the shader to texture "all" but you have to apply it to the fire texture. Use shader_texture_names resource to find names of the fire textures and then apply your shader to the fire texture. Since fire particles are animated (multiple textures get changed to create animation) you will have to do the same thing to all other fire textures as well.

Link to comment

so before i post i try:

engineApplyShaderToWorldTexture ( shaderL, "flame1") 
engineApplyShaderToWorldTexture ( shaderL, "flame2") 
engineApplyShaderToWorldTexture ( shaderL, "flame3") 
engineApplyShaderToWorldTexture ( shaderL, "blaze1") 
engineApplyShaderToWorldTexture ( shaderL, "blaze2") 
engineApplyShaderToWorldTexture ( shaderL, "blaze3") 

but no work to

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...