How to load a 3ds and mask it?

Blitz3D Forums/Blitz3D Programming/How to load a 3ds and mask it?

Boiled Sweets(Posted 2006) [#1]
I have a 3ds model that has black areas on it. How can I make these masked?


Genexi2(Posted 2006) [#2]
Use Flag4 on LoadTexture? (defaults to masking RGB 0,0,0)

Unsure how to mask it if the texture is loaded with the model itself though.

[EDIT] Ah yes, I believe you use TextureFilter command before loading the model if model contains the textures. Hope that works, havent dabbled in B3d for ages now.


jfk EO-11110(Posted 2006) [#3]
yes, TextureFIlter is your friend here. Do something like this:
Cleartexturefilters()
texturefilter "",4 or 9
mesh=loadmesh("whatever.3ds")
texturefilter "",9

9 (1+8) is default and should be reset after using other filters.


Boiled Sweets(Posted 2006) [#4]
Thanks JFK - perfect.


Dreamora(Posted 2006) [#5]
Its simpler if you define a beginning sequence like m_ on which you set 4 + 9 as default filter. then you can simply name all textures m_something.bmp /png /tga and it will work without reseting the texture filter.


jfk EO-11110(Posted 2006) [#6]
problems may arise when the meshes are arleady textured with certain files and you don't want/can alter the texture paths in the mesh file.

At the other hand, using a prefix like Dreamore said is useful since it allows to use various flags on the surfaces of a mesh. Tho it requires to follow a naming convention already in the creation process of the meshes.