~sircmpwn/xrgears

37178af14bc459cc2d6850da71a539b6040c716a — Lubosz Sarnecki 3 years ago 1b37601
data: move assets and shaders to new structure.
56 files changed, 14 insertions(+), 23 deletions(-)

M CMakeLists.txt
R data/models/armor/armor.dae => assets/models/armor/armor.dae
R data/models/armor/color_astc_8x8_unorm.ktx => assets/models/armor/color_astc_8x8_unorm.ktx
R data/models/armor/color_bc3_unorm.ktx => assets/models/armor/color_bc3_unorm.ktx
R data/models/armor/color_etc2_unorm.ktx => assets/models/armor/color_etc2_unorm.ktx
R data/models/armor/license.txt => assets/models/armor/license.txt
R data/models/armor/normal_astc_8x8_unorm.ktx => assets/models/armor/normal_astc_8x8_unorm.ktx
R data/models/armor/normal_bc3_unorm.ktx => assets/models/armor/normal_bc3_unorm.ktx
R data/models/armor/normal_etc2_unorm.ktx => assets/models/armor/normal_etc2_unorm.ktx
R data/models/chinesedragon.dae => assets/models/chinesedragon.dae
R data/models/cube.obj => assets/models/cube.obj
R data/models/geosphere.obj => assets/models/geosphere.obj
R data/models/plane.obj => assets/models/plane.obj
R data/models/retroufo.dae => assets/models/retroufo.dae
R data/models/retroufo_glow.dae => assets/models/retroufo_glow.dae
R data/models/retroufo_license.txt => assets/models/retroufo_license.txt
R data/models/sampleroom.dae => assets/models/sampleroom.dae
R data/models/sphere.obj => assets/models/sphere.obj
R data/models/teapot.dae => assets/models/teapot.dae
R data/models/torusknot.obj => assets/models/torusknot.obj
R data/models/treasure_glow.dae => assets/models/treasure_glow.dae
R data/models/treasure_smooth.dae => assets/models/treasure_smooth.dae
R data/models/venus.fbx => assets/models/venus.fbx
A assets/textures/cube_texture.png
R data/textures/cubemap_space.ktx => assets/textures/cubemap_space.ktx
R data/textures/cubemap_vulkan.ktx => assets/textures/cubemap_vulkan.ktx
R data/textures/cubemap_yokohama_astc_8x8_unorm.ktx => assets/textures/cubemap_yokohama_astc_8x8_unorm.ktx
R data/textures/cubemap_yokohama_bc3_unorm.ktx => assets/textures/cubemap_yokohama_bc3_unorm.ktx
R data/textures/cubemap_yokohama_etc2_unorm.ktx => assets/textures/cubemap_yokohama_etc2_unorm.ktx
R data/textures/darkmetal_bc3_unorm.ktx => assets/textures/darkmetal_bc3_unorm.ktx
R data/textures/stonefloor01_color_bc3_unorm.ktx => assets/textures/stonefloor01_color_bc3_unorm.ktx
R data/textures/stonefloor01_normal_bc3_unorm.ktx => assets/textures/stonefloor01_normal_bc3_unorm.ktx
M examples/xrgears/xrgears.cpp
R data/stb_font_consolas_24_latin1.inl => fonts/stb_font_consolas_24_latin1.inl
R data/shaders/base/textoverlay.frag => shaders/base/textoverlay.frag
R data/shaders/base/textoverlay.vert => shaders/base/textoverlay.vert
R data/shaders/cubemap/reflect.frag => shaders/cubemap/reflect.frag
R data/shaders/cubemap/reflect.vert => shaders/cubemap/reflect.vert
R data/shaders/cubemap/skybox.frag => shaders/cubemap/skybox.frag
R data/shaders/cubemap/skybox.vert => shaders/cubemap/skybox.vert
R data/shaders/hmddistortion/distortion.vert => shaders/hmddistortion/distortion.vert
R data/shaders/hmddistortion/openhmd-distortion-sps.frag => shaders/hmddistortion/openhmd-distortion-sps.frag
R data/shaders/hmddistortion/ph5-distortion.frag => shaders/hmddistortion/ph5-distortion.frag
R data/shaders/triangle/triangle.frag => shaders/triangle/triangle.frag
R data/shaders/triangle/triangle.vert => shaders/triangle/triangle.vert
R data/shaders/vkcube/vkcube.frag => shaders/vkcube/vkcube.frag
R data/shaders/vkcube/vkcube.vert => shaders/vkcube/vkcube.vert
R data/shaders/xrgears/multiview.geom => shaders/xrgears/multiview.geom
R data/shaders/xrgears/scene.frag => shaders/xrgears/scene.frag
R data/shaders/xrgears/scene.vert => shaders/xrgears/scene.vert
R data/shaders/xrgears/scene_no_sky.frag => shaders/xrgears/scene_no_sky.frag
R data/shaders/xrgears/sky.frag => shaders/xrgears/sky.frag
R data/shaders/xrgears/sky.geom => shaders/xrgears/sky.geom
R data/shaders/xrgears/sky.vert => shaders/xrgears/sky.vert
M vitamin-k/render/vikTextOverlay.hpp
M vitamin-k/system/vikAssets.hpp
M CMakeLists.txt => CMakeLists.txt +7 -16
@@ 3,7 3,6 @@ project(xrgears)

set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/bin/")


function(add_cxxflag FLAG)
    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${FLAG}" PARENT_SCOPE)
endfunction(add_cxxflag)


@@ 67,23 66,23 @@ add_library(xdg-shell ${XDG_SRC})
include_directories(
    ${CMAKE_SOURCE_DIR}/vitamin-k
    ${CMAKE_SOURCE_DIR}/xdg-shell
    ${CMAKE_SOURCE_DIR}/fonts
    ${OPENHMD_INCLUDE_DIRS}
    ${DRM_INCLUDE_DIRS})

# glslc -o gears.vert.spv gears.vert
set(SHADER_DIR ${CMAKE_SOURCE_DIR}/shaders)

file(GLOB_RECURSE SHADER_GLOB
    ${CMAKE_SOURCE_DIR}/data/shaders/*.vert
    ${CMAKE_SOURCE_DIR}/data/shaders/*.frag
    ${CMAKE_SOURCE_DIR}/data/shaders/*.geom)
    ${SHADER_DIR}/*.vert
    ${SHADER_DIR}/*.frag
    ${SHADER_DIR}/*.geom)

# build shaders
foreach(SHADER ${SHADER_GLOB})
    message("Compiling SPV shader for ${SHADER}")
    execute_process(
	WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/data/shaders
	COMMAND glslc -o ${SHADER}.spv ${SHADER}
	)
	WORKING_DIRECTORY ${SHADER_DIR}
	COMMAND glslc -o ${SHADER}.spv ${SHADER})
endforeach(SHADER)

file(GLOB_RECURSE VITAMINK_SRC vitamin-k/*.hpp)


@@ 91,14 90,6 @@ add_library(vitamin-k ${VITAMINK_SRC})
SET_TARGET_PROPERTIES(vitamin-k  PROPERTIES LINKER_LANGUAGE CXX)
set(LINT_SOURCES ${VITAMINK_SRC})

pkg_search_module(VULKAN REQUIRED vulkan)
pkg_search_module(OPENHMD REQUIRED openhmd)
pkg_search_module(ASSIMP REQUIRED assimp)
pkg_search_module(XCB REQUIRED xcb-keysyms)
pkg_search_module(WAYLAND REQUIRED wayland-client)
pkg_search_module(GBM REQUIRED gbm)
pkg_search_module(DRM REQUIRED libdrm)

set(EXAMPLE_LIBS
    ${VULKAN_LIBRARIES}
    ${OPENHMD_LIBRARIES}

R data/models/armor/armor.dae => assets/models/armor/armor.dae +0 -0
R data/models/armor/color_astc_8x8_unorm.ktx => assets/models/armor/color_astc_8x8_unorm.ktx +0 -0
R data/models/armor/color_bc3_unorm.ktx => assets/models/armor/color_bc3_unorm.ktx +0 -0
R data/models/armor/color_etc2_unorm.ktx => assets/models/armor/color_etc2_unorm.ktx +0 -0
R data/models/armor/license.txt => assets/models/armor/license.txt +0 -0
R data/models/armor/normal_astc_8x8_unorm.ktx => assets/models/armor/normal_astc_8x8_unorm.ktx +0 -0
R data/models/armor/normal_bc3_unorm.ktx => assets/models/armor/normal_bc3_unorm.ktx +0 -0
R data/models/armor/normal_etc2_unorm.ktx => assets/models/armor/normal_etc2_unorm.ktx +0 -0
R data/models/chinesedragon.dae => assets/models/chinesedragon.dae +0 -0
R data/models/cube.obj => assets/models/cube.obj +0 -0
R data/models/geosphere.obj => assets/models/geosphere.obj +0 -0
R data/models/plane.obj => assets/models/plane.obj +0 -0
R data/models/retroufo.dae => assets/models/retroufo.dae +0 -0
R data/models/retroufo_glow.dae => assets/models/retroufo_glow.dae +0 -0
R data/models/retroufo_license.txt => assets/models/retroufo_license.txt +0 -0
R data/models/sampleroom.dae => assets/models/sampleroom.dae +0 -0
R data/models/sphere.obj => assets/models/sphere.obj +0 -0
R data/models/teapot.dae => assets/models/teapot.dae +0 -0
R data/models/torusknot.obj => assets/models/torusknot.obj +0 -0
R data/models/treasure_glow.dae => assets/models/treasure_glow.dae +0 -0
R data/models/treasure_smooth.dae => assets/models/treasure_smooth.dae +0 -0
R data/models/venus.fbx => assets/models/venus.fbx +0 -0
A assets/textures/cube_texture.png => assets/textures/cube_texture.png +0 -0
R data/textures/cubemap_space.ktx => assets/textures/cubemap_space.ktx +0 -0
R data/textures/cubemap_vulkan.ktx => assets/textures/cubemap_vulkan.ktx +0 -0
R data/textures/cubemap_yokohama_astc_8x8_unorm.ktx => assets/textures/cubemap_yokohama_astc_8x8_unorm.ktx +0 -0
R data/textures/cubemap_yokohama_bc3_unorm.ktx => assets/textures/cubemap_yokohama_bc3_unorm.ktx +0 -0
R data/textures/cubemap_yokohama_etc2_unorm.ktx => assets/textures/cubemap_yokohama_etc2_unorm.ktx +0 -0
R data/textures/darkmetal_bc3_unorm.ktx => assets/textures/darkmetal_bc3_unorm.ktx +0 -0
R data/textures/stonefloor01_color_bc3_unorm.ktx => assets/textures/stonefloor01_color_bc3_unorm.ktx +0 -0
R data/textures/stonefloor01_normal_bc3_unorm.ktx => assets/textures/stonefloor01_normal_bc3_unorm.ktx +0 -0
M examples/xrgears/xrgears.cpp => examples/xrgears/xrgears.cpp +4 -4
@@ 296,11 296,11 @@ class XRGears : public vik::Application {
      std::string file_name;
      VkFormat format;

      file_name = "hdr/uffizi_cube.ktx";
      format = VK_FORMAT_R16G16B16A16_SFLOAT;
      //file_name = "hdr/uffizi_cube.ktx";
      //format = VK_FORMAT_R16G16B16A16_SFLOAT;

      // file_name = "cubemap_yokohama_bc3_unorm.ktx";
      // format = VK_FORMAT_BC2_UNORM_BLOCK;
      file_name = "cubemap_yokohama_bc3_unorm.ktx";
      format = VK_FORMAT_BC2_UNORM_BLOCK;

      // file_name = "equirect/cube2/cube.ktx";
      // format = VK_FORMAT_R16G16B16A16_SFLOAT;

R data/stb_font_consolas_24_latin1.inl => fonts/stb_font_consolas_24_latin1.inl +0 -0
R data/shaders/base/textoverlay.frag => shaders/base/textoverlay.frag +0 -0
R data/shaders/base/textoverlay.vert => shaders/base/textoverlay.vert +0 -0
R data/shaders/cubemap/reflect.frag => shaders/cubemap/reflect.frag +0 -0
R data/shaders/cubemap/reflect.vert => shaders/cubemap/reflect.vert +0 -0
R data/shaders/cubemap/skybox.frag => shaders/cubemap/skybox.frag +0 -0
R data/shaders/cubemap/skybox.vert => shaders/cubemap/skybox.vert +0 -0
R data/shaders/hmddistortion/distortion.vert => shaders/hmddistortion/distortion.vert +0 -0
R data/shaders/hmddistortion/openhmd-distortion-sps.frag => shaders/hmddistortion/openhmd-distortion-sps.frag +0 -0
R data/shaders/hmddistortion/ph5-distortion.frag => shaders/hmddistortion/ph5-distortion.frag +0 -0
R data/shaders/triangle/triangle.frag => shaders/triangle/triangle.frag +0 -0
R data/shaders/triangle/triangle.vert => shaders/triangle/triangle.vert +0 -0
R data/shaders/vkcube/vkcube.frag => shaders/vkcube/vkcube.frag +0 -0
R data/shaders/vkcube/vkcube.vert => shaders/vkcube/vkcube.vert +0 -0
R data/shaders/xrgears/multiview.geom => shaders/xrgears/multiview.geom +0 -0
R data/shaders/xrgears/scene.frag => shaders/xrgears/scene.frag +0 -0
R data/shaders/xrgears/scene.vert => shaders/xrgears/scene.vert +0 -0
R data/shaders/xrgears/scene_no_sky.frag => shaders/xrgears/scene_no_sky.frag +0 -0
R data/shaders/xrgears/sky.frag => shaders/xrgears/sky.frag +0 -0
R data/shaders/xrgears/sky.geom => shaders/xrgears/sky.geom +0 -0
R data/shaders/xrgears/sky.vert => shaders/xrgears/sky.vert +0 -0
M vitamin-k/render/vikTextOverlay.hpp => vitamin-k/render/vikTextOverlay.hpp +1 -1
@@ 25,7 25,7 @@
#include "vikBuffer.hpp"
#include "vikDevice.hpp"

#include "../data/stb_font_consolas_24_latin1.inl"
#include "stb_font_consolas_24_latin1.inl"

// Defines for the STB font used
// STB font files can be found at http://nothings.org/stb/font/

M vitamin-k/system/vikAssets.hpp => vitamin-k/system/vikAssets.hpp +2 -2
@@ 15,11 15,11 @@ namespace vik {
class Assets {
 public:
  static const std::string get_asset_path() {
    return "./data/";
    return "./assets/";
  }

  static const std::string get_shader_path() {
    return get_asset_path() + "shaders/";
    return "./shaders/";
  }

  static const std::string get_texture_path() {