Add GenModelMipmaps() for generating mipmaps (and setting texture
filter) for all textures used by a Model
This commit is contained in:
parent
7c8f515108
commit
75790be2d5
|
|
@ -4029,6 +4029,20 @@ void GenTextureMipmaps(Texture2D *texture)
|
||||||
rlGenTextureMipmaps(texture->id, texture->width, texture->height, texture->format, &texture->mipmaps);
|
rlGenTextureMipmaps(texture->id, texture->width, texture->height, texture->format, &texture->mipmaps);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Generate GPU mipmaps for all textures used in a model
|
||||||
|
void GenModelMipmaps(Model model)
|
||||||
|
{
|
||||||
|
for (int i = 0; i < model.materialCount; i++)
|
||||||
|
{
|
||||||
|
Material *material = &(model.materials[i]);
|
||||||
|
for (int m = 0; m < MAX_MATERIAL_MAPS; m++)
|
||||||
|
{
|
||||||
|
GenTextureMipmaps(&(material->maps[m].texture));
|
||||||
|
SetTextureFilter(material->maps[m].texture, TEXTURE_FILTER_TRILINEAR);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Set texture scaling filter mode
|
// Set texture scaling filter mode
|
||||||
void SetTextureFilter(Texture2D texture, int filter)
|
void SetTextureFilter(Texture2D texture, int filter)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user