Tekken Posted July 20, 2015 Share Posted July 20, 2015 (edited) Hi, Today I created a shader using engineApplyShaderToWorldTexture. Sript: addEventHandler('onClientResourceStart', resourceRoot, function() shader = dxCreateShader('shader.fx') terrain = dxCreateTexture('img/1.jpg') dxSetShaderValue(shader, 'gTexture', terrain) engineApplyShaderToWorldTexture(shader, 'des_ripplsand') end) Shader.fx: texture gTexture; technique TexReplace { pass P0 { Texture[0] = gTexture; } } But I have a problem the draw distance is too low as you can see here: Do you know how to fix that? Edited July 21, 2015 by Guest Link to comment
Tekken Posted July 21, 2015 Author Share Posted July 21, 2015 This? engineSetModelLODDistance Still the same..., maybe i did it wrong.Can you give me an example ? Link to comment
GTX Posted July 21, 2015 Share Posted July 21, 2015 You need to know ID of an object. engineSetModelLODDistance(YOUR_ID, 300) If that function doesn't work, then I'm afraid there's no solution to your problem. Link to comment
Ren_712 Posted July 22, 2015 Share Posted July 22, 2015 With the code provided i'm quite surprised that you have shader max render distance defined. How about setting that yourself: shader = dxCreateShader('shader.fx',0,0,false,"world") - this changes the distance to infinite. Link to comment
DakiLLa Posted July 22, 2015 Share Posted July 22, 2015 I guess you have to replace the LOD object texture as well. Link to comment
Ren_712 Posted July 22, 2015 Share Posted July 22, 2015 try engineApplyShaderToWorldTexture(myShader,"*") -- which will apply to all the textures. DakiLLa might have a point on this. Link to comment
Tekken Posted July 22, 2015 Author Share Posted July 22, 2015 try engineApplyShaderToWorldTexture(myShader,"*") -- which will apply to all the textures. DakiLLa might have a point on this. What do you mean by "*" ? EDIT: Thank you so much It worked. 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