Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local shaders={
- ["images/barsign.png"]={"des_probesign",},
- ["images/wall.png"]={"stoneclad1",},
- }
- function setupShaders()
- for fileName,textures in pairs(shaders) do
- local shader = dxCreateShader ("shader.fx",1,100)
- local texture = dxCreateTexture (fileName)
- dxSetShaderValue (shader,"CUSTOMTEX0", texture )
- shaders[fileName].shader==shader
- end
- end
- setupShaders()
- -- code for object creation loop (assuming object is identified as "object"
- for _,data in pairs(shaders) do
- local shader=data.shader
- for _,texure in pairs(data.textures) do
- engineApplyShaderToWorldTexture(shader,texture,object)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement