Jump to content

unknow problem with shader


a7zan

Recommended Posts

Posted

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; 
    } 
} 

 

  • MTA Team
Posted (edited)

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_
Posted (edited)

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
Posted (edited)

LOL

why its not work with me ? 

i will try re-install

Edited by Dutchman101
removed useless mention
Posted

Something problem? Ok, try to fix something by doing something in the code.. Rather than saying there's something wrong, can you just tell us what the problem is exactly?

Posted
28 minutes ago, pa3ck said:

Something problem? Ok, try to fix something by doing something in the code.. Rather than saying there's something wrong, can you just tell us what the problem is exactly?

-___- 

it's work with @!#NssoR_) but with me no , i don't know why !

i change the shader file and some problem

look the debug http://imgur.com/Jhh5CXL

  • MTA Team
Posted

It looks like dxCreateTexture("Head.jpg") is failing

Is the actual file called Head.jpg or head.jpg ?

 

  • MTA Team
Posted

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

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