mip mapping
This commit is contained in:
parent
d1b8e45fb6
commit
15f1f77344
3 changed files with 104 additions and 41 deletions
|
|
@ -35,7 +35,7 @@ export namespace Crafter {
|
|||
public:
|
||||
VkSampler textureSampler;
|
||||
VkDescriptorImageInfo imageInfo;
|
||||
SamplerVulkan(ImageVulkan<PixelType>& texture) {
|
||||
SamplerVulkan() {
|
||||
VkSamplerCreateInfo samplerInfo{};
|
||||
samplerInfo.sType = VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO;
|
||||
samplerInfo.magFilter = VK_FILTER_LINEAR;
|
||||
|
|
@ -43,8 +43,8 @@ export namespace Crafter {
|
|||
samplerInfo.addressModeU = VK_SAMPLER_ADDRESS_MODE_REPEAT;
|
||||
samplerInfo.addressModeV = VK_SAMPLER_ADDRESS_MODE_REPEAT;
|
||||
samplerInfo.addressModeW = VK_SAMPLER_ADDRESS_MODE_REPEAT;
|
||||
samplerInfo.anisotropyEnable = VK_FALSE;
|
||||
samplerInfo.maxAnisotropy = 1;
|
||||
samplerInfo.anisotropyEnable = VK_TRUE;
|
||||
samplerInfo.maxAnisotropy = 16;
|
||||
samplerInfo.borderColor = VK_BORDER_COLOR_INT_OPAQUE_BLACK;
|
||||
samplerInfo.unnormalizedCoordinates = VK_FALSE;
|
||||
samplerInfo.compareEnable = VK_FALSE;
|
||||
|
|
@ -52,7 +52,7 @@ export namespace Crafter {
|
|||
samplerInfo.mipmapMode = VK_SAMPLER_MIPMAP_MODE_LINEAR;
|
||||
samplerInfo.mipLodBias = 0.0f;
|
||||
samplerInfo.minLod = 0.0f;
|
||||
samplerInfo.maxLod = 0.0f;
|
||||
samplerInfo.maxLod = VK_LOD_CLAMP_NONE;
|
||||
VulkanDevice::CheckVkResult(vkCreateSampler(VulkanDevice::device, &samplerInfo, nullptr, &textureSampler));
|
||||
|
||||
imageInfo = {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue