a7zan Posted July 17, 2017 Share 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; } } Link to comment
Administrators Lpsd Posted July 17, 2017 Administrators Share 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_ Link to comment
a7zan Posted July 17, 2017 Author Share 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 Link to comment
!#NssoR_) Posted July 17, 2017 Share Posted July 17, 2017 Change line number 4 to <file src="Shader.fx" type="client"/> And try again. Link to comment
!#NssoR_) Posted July 17, 2017 Share Posted July 17, 2017 (edited) Everything works well with me !! Edited July 17, 2017 by !#NssoR_) 1 Link to comment
a7zan Posted July 17, 2017 Author Share 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 Link to comment
a7zan Posted July 18, 2017 Author Share Posted July 18, 2017 i re-install mta:sa but something problem Link to comment
pa3ck Posted July 18, 2017 Share 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? Link to comment
a7zan Posted July 18, 2017 Author Share 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 Link to comment
MTA Team ccw Posted July 20, 2017 MTA Team Share Posted July 20, 2017 It looks like dxCreateTexture("Head.jpg") is failing Is the actual file called Head.jpg or head.jpg ? Link to comment
MTA Team ccw Posted July 20, 2017 MTA Team Share 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 Link to comment
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