Jump to content

unknow problem with shader


a7zan

Recommended Posts

hello everyone,

i get problem when i'm make shader for cj 

the debugscript : http://imgur.com/Jhh5CXL

 

Code : 

addEventHandler("onClientResourceStart", resourceRoot, function()
shader = dxCreateShader("Shader.fx", 0, 0, false, "ped") 
texture = dxCreateTexture("Head.jpg") 
dxSetShaderValue( shader, "Ped", texture )

ped = createPed(0,2343.26978 ,-1711.83752, 13.35361)
  engineApplyShaderToWorldTexture(shader, "cj_ped_head",ped)
end)

  

 

Shader.fx

texture Ped; 
technique simple { 
    pass P0 { 
        Texture[0] = Ped; 
    } 
} 

 

Link to comment
  • Administrators

I've no clue about shaders, but this is what I normally use

texture Ped;

technique J
{
    pass P0
    {
        Texture[0] = Ped;
	DepthBias=-0.0002;
    }
}

If that fails, can we see your meta.xml?

Edited by LopSided_
Link to comment

some problem

maybe problem from meta ?

<meta>
<script src="Server.lua" type="server" />
<script src="Client.lua" type="client" />
<file src="Shader.fx" type="client"/>
<file src="Head.jpg"  />




</meta>

 

Edited by a7zan
Link to comment
  • MTA Team

I was wrong about Head.jpg.

The problem is Shader.fx is encoded as UTF-8-BOM, and needs to have the BOM removed. To do this with notepad++:
1) Open Shader.fx in notepad++
2) Select Encoding->UTF-8
3) Save

  • Like 2
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...