Jump to content

Shader reset original texture ?


Recommended Posts

Hello!

Is there any way to reset a shader texture to a original one without stopping a resource ?

I wan't do to that if i enter to a specific area, then i have a custom texture, if i leave from that area, the custom texture will be removed and the original one will be back ?

code

addEventHandler("onClientRender", root, 
    function() 
    local zone = getZoneName (getElementPosition(getLocalPlayer()))  
        if zone == "Santa Maria Beach" then     
            dxSetShaderValue(textBeachsandShad,"gTexture",beachSand) 
            engineApplyShaderToWorldTexture(textBeachsandShad,"grass_128hv") 
        else 
                --How to reset original texture?? 
        end 
    end) 

Link to comment

Yes you can.

engineRemoveShaderFromWorldTexture () 

Your code

addEventHandler("onClientRender", root, 
    function() 
    local zone = getZoneName (getElementPosition(getLocalPlayer()))  
        if zone == "Santa Maria Beach" then     
            dxSetShaderValue(textBeachsandShad,"gTexture",beachSand) 
            engineApplyShaderToWorldTexture(textBeachsandShad,"grass_128hv") 
        else 
            engineRemoveShaderFromWorldTexture(textBeachsandShad,"grass_128hv") 
        end 
    end) 

Link to comment

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