a7zan Posted July 17, 2017 Posted July 17, 2017 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 Lpsd Posted July 17, 2017 MTA Team Posted July 17, 2017 (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 July 17, 2017 by LopSided_
a7zan Posted July 17, 2017 Author Posted July 17, 2017 (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 July 17, 2017 by a7zan
!#NssoR_) Posted July 17, 2017 Posted July 17, 2017 Change line number 4 to <file src="Shader.fx" type="client"/> And try again.
!#NssoR_) Posted July 17, 2017 Posted July 17, 2017 (edited) Everything works well with me !! Edited July 17, 2017 by !#NssoR_) 1
a7zan Posted July 17, 2017 Author Posted July 17, 2017 (edited) LOL why its not work with me ? i will try re-install Edited July 18, 2017 by Dutchman101 removed useless mention
pa3ck Posted July 18, 2017 Posted July 18, 2017 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?
a7zan Posted July 18, 2017 Author Posted July 18, 2017 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 ccw Posted July 20, 2017 MTA Team Posted July 20, 2017 It looks like dxCreateTexture("Head.jpg") is failing Is the actual file called Head.jpg or head.jpg ?
MTA Team ccw Posted July 20, 2017 MTA Team Posted July 20, 2017 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 2
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now