ARTICLE AD BOX
I made a terrain model, put a texture on it, and exported it to glb. I loaded it into Filament, but when I ran it, the texture turned into a terrible mess. After some research, I realized that I needed to create a TextureSampler and set the anisotropic filtering value. I was able to declare and configure the sampler, but I couldn't apply its settings to the texture for one reason:
The application goes through the application of parameters to the material, i.e. materialInstance->setParameter("nazvanie", texture, sampler);. But I just don't have access to the texture. If I load models through gltfio, they automatically load the texture without giving me access to it.
If anyone knows, please tell me how to set up filtering, and if so, how to use the sampler.
It's model load code:
AssetLoader* assetLoader = AssetLoader::create({ engine, materialProvider }); std::vector<uint8_t> glbData = readFile("C:/Users/DimoNULL/Desktop/terra.glb"); FilamentAsset* asset = assetLoader->createAsset(glbData.data(), glbData.size()); ResourceLoader resourceLoader({ engine }); resourceLoader.addTextureProvider("image/png", createStbProvider(engine)); resourceLoader.loadResources(asset); scene->addEntities(asset->getEntities(), asset->getEntityCount());