FreeTexture!

Blitz3D Forums/Blitz3D Programming/FreeTexture!

Yue(Posted 2012) [#1]
Hello, I have a little problem: Load a model and texture and is assigned to the model, however is that I need to remove the texture of the model, use FreeTexture, but this is still displayed in the model sige ... Any chance to remove the texture of the model or make it invisible.


Yasha(Posted 2012) [#2]
Any chance to remove the texture of the model or make it invisible.


No. There is no way to "un-texture" a model once it has had a texture applied.

(FreeTexture does not delete a texture: it just decrements the built-in reference count to no longer include the handle for manipulating the texture in your code. The texture is not deleted until the reference count hits zero, which requires it to also not be in use on any meshes or entities.)

You have two options:

1) Delete the model and rebuild it. This is overkill, but it should work if you keep an untextured original and just make new ones with CopyEntity.

2) Have a "blank" texture on standby (e.g. 1x1 white pixel) to replace the texture you want to remove. While the entity will technically still be textured, in practice you won't see the difference, and it'll get rid of the one you want to free.


Adam Novagen(Posted 2012) [#3]
This is a pretty minour thing, but isn't 2x2 the smallest possible texture size?


Ross C(Posted 2012) [#4]
You could do:

model_temp = copymesh(model)
freeentity model
model = model_temp
model_temp = 0


This would create an untexture copy. Or, you could paint it with an untextured brush. Not ideal, but better than nothing. Though, I reckon the 1x1 texture idea is better.


Yue(Posted 2012) [#5]
Well, I can not understand it very well established, the Google translator does not help much.

The problem I have is this:
Noise OFF

Noise ON


Layer 1: Normal texture.
Layer 2: difuse texture.
Layer3: Texture Noise for shadows.
Layer4: Texture shadow.

I have a few options for the shade to change the quality of the shadows, and noise can be set in the shade. The change comes as the shadow it tends not noise, but the rest to the choice of noise for this constant shadow.

My question is, I can replace this texture Noise, the other with Alpha channel, with the idea that it is invisible.

Last edited 2012

Last edited 2012


Leon Drake(Posted 2012) [#6]
can't you just paintentity with a blank brush?


Yue(Posted 2012) [#7]
Ok!!, i use copyentity, Thanks!!


Ross C(Posted 2012) [#8]
CopyMesh is best, as it creates a blank copy :)


Yue(Posted 2012) [#9]
Hey, sorry my English is very bad, do you mean by a blank space to usaro copymesh


Ross C(Posted 2012) [#10]
temp_model = CopyMesh(model)
FreeEntity model
model = temp_model
temp_model = 0


It's ok. The above is what I mean. CopyMesh() will produce an untexture copy of the mesh.