Since I need to scale my b3d model textures according to detail level I choose when starting the game, I use a simple scaletexture function. I create then a brush with that scaled texture and paint my model.
This function needs to know the textureflag to apply to the new scaled texture.
How could I get texture flags from my b3d model or from a brush?
I could use texturefilename strings, like "_alpha" , "_mip" etc..but it's a bit unhandy.
Do you think there's a better way to scale the textures of b3d models?
thanx
This function needs to know the textureflag to apply to the new scaled texture.
How could I get texture flags from my b3d model or from a brush?
I could use texturefilename strings, like "_alpha" , "_mip" etc..but it's a bit unhandy.
Do you think there's a better way to scale the textures of b3d models?
thanx
Function Scltexture(texhandle,xys#,tflags) txwidth=TextureWidth(texhandle) txheight=TextureHeight(texhandle) id=CreateTexture(txwidth/xys,txheight/xys,tflags) LockBuffer(TextureBuffer(texhandle)) LockBuffer(TextureBuffer(id)) While j<= TextureHeight(id)-1 i=0 While i<= TextureWidth(id)-1 argb=ReadPixelFast(i*xys,j*xys,TextureBuffer(texhandle)) WritePixelFast (i,j,argb,TextureBuffer(id)) i=i+1 Wend j=j+1 Wend UnlockBuffer(TextureBuffer(texhandle)) UnlockBuffer(TextureBuffer(id)) FreeTexture texhandle Return id End Function