Jump to content

HELP | Shaders


Tekken

Recommended Posts

Posted (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:

eTX0KF4quKmLDBIEILHTatZetDfUTMamizfqFL37Yew=w1280-h720-no

Do you know how to fix that?

Edited by Guest
Posted

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.

Posted

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.

Posted
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 :D It worked.

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