Jump to content

Gordon_G

Members
  • Posts

    282
  • Joined

  • Last visited

Posts posted by Gordon_G

  1. Hi,

    I have a shader (here) that replace an object's texture and here is my code : (red.png ; blue.png)

    local o = createObject( 2121, 1418.1678466797,-1595.0837402344,13.366353988647 )  
    dxSetShaderValue( shaderForImageLoading, "gTexture", dxCreateTexture( "red.png" ) )  
    engineApplyShaderToWorldTexture( shaderForImageLoading, "cj_red_leather", o )
    
    local o1 = createObject( 2121, 1411.8753662109,-1591.5054931641,13.360206604004 ) 
    dxSetShaderValue( shaderForImageLoading, "gTexture", dxCreateTexture( "blue.png" ) )  
    engineApplyShaderToWorldTexture( shaderForImageLoading, "cj_red_leather", o1 )

    So, the prob is that I'd like that the first object to have the texture red.png but it gets the blue.png one

    Is it possible to "freeze" the shader for a worldTexture ?

    Or... Am I supposed to create a shader for each object I want to replace the texture of ? It will take a lot of the client vram if I have a lot of objects isn't it ?

×
×
  • Create New...