Code Monkey home page Code Monkey logo

vulkansponza's Introduction

💬 About me

I've been an active Open Source developer for more than 25 years now (even before that term was actually coined). At ☀️ day I'm a software development team lead in the automotive area, and at 🌑 night (and during 🏖️ weekends) I contribute to Open Source projects related to 3D realtime graphics using open standards from Khronos.

 GitHub stats for Sascha Willems

vulkansponza's People

Contributors

gwizdz avatar saschawillems avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

vulkansponza's Issues

Some functions are missing

Hi,

as I am trying to setup your program I keep running into the same issues.
It seems like some functions and variables are not configured.
Could you help me with that?
Feel free to message me for more info.
vulkansponza_error

incorrect normal mapping

Hi,

screenshot from 2018-11-11 20-51-25

I noticed the same thing happening in my sponza application. The same texture is used on both halves of the mesh and texture coordinates (which are used to calculate tangents and bitangents) are mirrored horizontally. If you calculate bitangents in a vertex / fragment shader (cross(normal, tangent)) then half of them are flipped (they shouldn't).
The solution is simple - pass bitangents produced by assimp to the vertex shader as attributes (same as tangents).

Not only arches are mirrored (look at walls for example)! Your scene is quite dark and it is not as noticeable but with strong directional light it shows.

I hope it makes sense.
Mateusz

Wrong texture paths, Ubuntu 20.04

Compiles well, but I get the run time error on Ubuntu 20.04+GTX760:

tokyo@tokyo-Z87-DS3H:~/VulkanSponza/bin$ ./vulkanSponza
Material "terial__25"
  Diffuse: "nza/lion.dds"
vulkanSponza: /home/tokyo/VulkanSponza/base/vulkanTextureLoader.hpp:121: void vkTools::VulkanTextureLoader::loadTexture(std::string, VkFormat, vkTools::VulkanTexture*, bool, VkImageUsageFlags): Assertion `!tex2D.empty()' failed.
Aborted (core dumped)

I have tried to debug this, but could not get it quite right. I have added the following line right before the assertion error assert(!tex2D.empty()); on the line 120 of /base/vulkanTextureLoader.hpp (with "#include <iostream>")

std::cout << filename.c_str() << std::endl;

And after executing this again I get some more information:

tokyo@tokyo-Z87-DS3H:~/VulkanSponza/bin$ ./vulkanSponza
./../data/textures/particle_smoke.ktx
./../data/textures/skysphere_night.ktx
./../data/sponza/dummy.dds
./../data/sponza/dummy_specular.dds
./../data/sponza/dummy_ddn.dds
Material "terial__25"
  Diffuse: "nza/lion.dds"
./../data/nza/lion.dds
vulkanSponza: /home/tokyo/VulkanSponza/base/vulkanTextureLoader.hpp:121: void vkTools::VulkanTextureLoader::loadTexture(std::string, VkFormat, vkTools::VulkanTexture*, bool, VkImageUsageFlags): Assertion `!tex2D.empty()' failed.
Aborted (core dumped)

So you can see it loads some data alright, but then cuts "spo" from "sponza" when loading lion.dds, but I cannot see what exactly cuts it. This has something to do with Windows backslashes most likely, perhaps the replacement

std::replace(fileName.begin(), fileName.end(), '\', '/');

in src/vulkansponza.cpp is the culprit here, but I cannot see what this needs to be. In my previous experiences .mtl files often have Windows backslashes and these get mingled with Linux path slashes pretty badly, so I would often just replace them in the editor, but here I only see some big data .dds files. Please help me out.

The other repo, https://github.com/SaschaWillems/Vulkan, works fine and produces no such run time errors on Ubuntu 20.04 and Sponza runs fine there as gltfscenerendering example, but this one has more advanced experiments to study so it's also relevant to get it right.

Segfault on Linux

$ gcc --version
gcc (GCC) 10.0.1 20200328

$ make
Scanning dependencies of target vulkanSponza
[ 16%] Building CXX object CMakeFiles/vulkanSponza.dir/src/vulkansponza.cpp.o
/home/tle/src/VulkanSponza/src/vulkansponza.cpp: In member function ‘void Scene::loadMeshes(VkCommandBuffer)’:
/home/tle/src/VulkanSponza/src/vulkansponza.cpp:411:38: warning: taking address of packed member of ‘aiVector3t<float>’ may result in an unaligned pointer value [-Waddress-of-packed-member]
  411 |     vertices[i].pos = glm::make_vec3(&aMesh->mVertices[i].x);// *0.5f;
      |                                      ^~~~~~~~~~~~~~~~~~~~~~
/home/tle/src/VulkanSponza/src/vulkansponza.cpp:413:47: warning: taking address of packed member of ‘aiVector3t<float>’ may result in an unaligned pointer value [-Waddress-of-packed-member]
  413 |     vertices[i].uv = (hasUV) ? glm::make_vec2(&aMesh->mTextureCoords[0][i].x) : glm::vec3(0.0f);
      |                                               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/tle/src/VulkanSponza/src/vulkansponza.cpp:414:41: warning: taking address of packed member of ‘aiVector3t<float>’ may result in an unaligned pointer value [-Waddress-of-packed-member]
  414 |     vertices[i].normal = glm::make_vec3(&aMesh->mNormals[i].x);
      |                                         ^~~~~~~~~~~~~~~~~~~~~
/home/tle/src/VulkanSponza/src/vulkansponza.cpp:417:57: warning: taking address of packed member of ‘aiVector3t<float>’ may result in an unaligned pointer value [-Waddress-of-packed-member]
  417 |     vertices[i].tangent = (hasTangent) ? glm::make_vec3(&aMesh->mTangents[i].x) : glm::vec3(0.0f, 1.0f, 0.0f);
      |                                                         ^~~~~~~~~~~~~~~~~~~~~~
/home/tle/src/VulkanSponza/src/vulkansponza.cpp:418:59: warning: taking address of packed member of ‘aiVector3t<float>’ may result in an unaligned pointer value [-Waddress-of-packed-member]
  418 |     vertices[i].bitangent = (hasTangent) ? glm::make_vec3(&aMesh->mBitangents[i].x) : glm::vec3(0.0f, 1.0f, 0.0f);
      |                                                           ^~~~~~~~~~~~~~~~~~~~~~~~
[ 33%] Building CXX object CMakeFiles/vulkanSponza.dir/base/vulkanandroid.cpp.o
[ 50%] Building CXX object CMakeFiles/vulkanSponza.dir/base/vulkandebug.cpp.o
[ 66%] Building CXX object CMakeFiles/vulkanSponza.dir/base/vulkanexamplebase.cpp.o
[ 83%] Building CXX object CMakeFiles/vulkanSponza.dir/base/vulkantools.cpp.o
[100%] Linking CXX executable ../bin/vulkanSponza
[100%] Built target vulkanSponza

$ ./bin/vulkanSponza 
vulkanSponza: /home/tle/src/VulkanSponza/base/vulkantools.cpp:313: VkShaderModule_T* vkTools::loadShader(const char*, VkDevice, VkShaderStageFlagBits): Assertion `fp' failed.
Aborted (core dumped)

$ coredumpctl info 431392
           PID: 431392 (vulkanSponza)
           UID: 1000 (tle)
           GID: 1000 (tle)
        Signal: 6 (ABRT)
     Timestamp: Fri 2020-04-10 01:46:15 AEST (11s ago)
  Command Line: ./bin/vulkanSponza
    Executable: /home/tle/src/VulkanSponza/bin/vulkanSponza
 Control Group: /user.slice/user-1000.slice/[email protected]/apps.slice/apps-org.gnome.Terminal.slice/vte-spawn-bfd191dd-1d38-4579-a45b-dd822fd2dee6.scope
          Unit: [email protected]
     User Unit: vte-spawn-bfd191dd-1d38-4579-a45b-dd822fd2dee6.scope
         Slice: user-1000.slice
     Owner UID: 1000 (tle)
       Boot ID: f7ed72365f974518aeaedbe4bbca5b7d
    Machine ID: 5632f07729a648c49d05933910ac9490
      Hostname: orion.dev
       Storage: /var/lib/systemd/coredump/core.vulkanSponza.1000.f7ed72365f974518aeaedbe4bbca5b7d.431392.1586447175000000000000.lz4
       Message: Process 431392 (vulkanSponza) of user 1000 dumped core.
                
                Stack trace of thread 431392:
                #0  0x00007fffb2f29238 raise (libc.so.6 + 0x49238)
                #1  0x00007fffb2f07c68 abort (libc.so.6 + 0x27c68)
                #2  0x00007fffb2f1dbb0 __assert_fail_base (libc.so.6 + 0x3dbb0)
                #3  0x00007fffb2f1dc54 __assert_fail (libc.so.6 + 0x3dc54)
                #4  0x0000000010137158 n/a (/home/tle/src/VulkanSponza/bin/vulkanSponza + 0x137158)
                #5  0x0000000010137158 n/a (/home/tle/src/VulkanSponza/bin/vulkanSponza + 0x137158)
                #6  0x0000000010102858 n/a (/home/tle/src/VulkanSponza/bin/vulkanSponza + 0x102858)
                #7  0x0000000010102534 n/a (/home/tle/src/VulkanSponza/bin/vulkanSponza + 0x102534)
                #8  0x00000000100bbdfc n/a (/home/tle/src/VulkanSponza/bin/vulkanSponza + 0xbbdfc)
                #9  0x00000000100900b0 n/a (/home/tle/src/VulkanSponza/bin/vulkanSponza + 0x900b0)
                #10 0x00007fffb2f080cc generic_start_main.constprop.0.isra.0 (libc.so.6 + 0x280cc)
                #11 0x00007fffd600f994 n/a (n/a + 0x0)
                #12 0x00007fffd600f994 n/a (n/a + 0x0)
                #13 0x4644534100726f6c n/a (n/a + 0x0)

Please let me know if you need more details for this segmentation fault. Cheers

Image layout specified at vkUpdateDescriptorSets() time doesn't match actual image layout at time descriptor is used.

Hello,

It seems there is a mismatch between image layout in descriptor set and the actual image layout. The validation layers complain:

DS(ERROR): object: 0xaf50a78 type: 6 location: 583 msgCode: 6: vkCmdDraw(): Cannot use image 0xaf2ad88 with specific layout VK_IMAGE_LAYOUT_GENERAL that doesn't match the actual current layout VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL.
DS(ERROR): object: 0xaf14d58 type: 23 location: 1187 msgCode: 61: Descriptor set 0xaf14d58 encountered the following validation error at vkCmdDraw() time: Image layout specified at vkUpdateDescriptorSets() time doesn't match actual image layout at time descriptor is used. See previous error callback for specific details. 

It seems the image subresource is sampled(?) as if GENERAL layout, while it was transitioned previously to VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL. This is undefined, causes corruptions for me.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.