Moved heightmap to vks namespace (Refs #260)
This commit is contained in:
parent
c1575e4fe5
commit
7f1c376550
2 changed files with 184 additions and 181 deletions
|
|
@ -14,8 +14,10 @@
|
||||||
#include "VulkanDevice.hpp"
|
#include "VulkanDevice.hpp"
|
||||||
#include "VulkanBuffer.hpp"
|
#include "VulkanBuffer.hpp"
|
||||||
|
|
||||||
namespace vkTools
|
namespace vks
|
||||||
{
|
{
|
||||||
|
namespace utils
|
||||||
|
{
|
||||||
class HeightMap
|
class HeightMap
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
|
|
@ -251,4 +253,5 @@ namespace vkTools
|
||||||
vkFreeMemory(device->logicalDevice, indexStaging.memory, nullptr);
|
vkFreeMemory(device->logicalDevice, indexStaging.memory, nullptr);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -197,7 +197,7 @@ public:
|
||||||
vks::Texture2D source;
|
vks::Texture2D source;
|
||||||
} textures;
|
} textures;
|
||||||
|
|
||||||
vkTools::HeightMap *heightMap = nullptr;
|
vks::utils::HeightMap *heightMap = nullptr;
|
||||||
|
|
||||||
struct {
|
struct {
|
||||||
VkPipelineVertexInputStateCreateInfo inputState;
|
VkPipelineVertexInputStateCreateInfo inputState;
|
||||||
|
|
@ -660,11 +660,11 @@ public:
|
||||||
// Generate a terrain quad patch for feeding to the tessellation control shader
|
// Generate a terrain quad patch for feeding to the tessellation control shader
|
||||||
void generateTerrain()
|
void generateTerrain()
|
||||||
{
|
{
|
||||||
heightMap = new vkTools::HeightMap(vulkanDevice, queue);
|
heightMap = new vks::utils::HeightMap(vulkanDevice, queue);
|
||||||
#if defined(__ANDROID__)
|
#if defined(__ANDROID__)
|
||||||
heightMap->loadFromFile(getAssetPath() + "textures/terrain_heightmap_r16.ktx", 128, glm::vec3(2.0f, 48.0f, 2.0f), vkTools::HeightMap::topologyTriangles, androidApp->activity->assetManager);
|
heightMap->loadFromFile(getAssetPath() + "textures/terrain_heightmap_r16.ktx", 128, glm::vec3(2.0f, 48.0f, 2.0f), vks::utils::HeightMap::topologyTriangles, androidApp->activity->assetManager);
|
||||||
#else
|
#else
|
||||||
heightMap->loadFromFile(getAssetPath() + "textures/terrain_heightmap_r16.ktx", 128, glm::vec3(2.0f, 48.0f, 2.0f), vkTools::HeightMap::topologyTriangles);
|
heightMap->loadFromFile(getAssetPath() + "textures/terrain_heightmap_r16.ktx", 128, glm::vec3(2.0f, 48.0f, 2.0f), vks::utils::HeightMap::topologyTriangles);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue