Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Community Reputation

0 Neutral

About mefesto

  • Rank

Personal Information

  • Interests
  1. There are only a handful of Vulkan functions you need to be aware of with SDL: http://wiki.libsdl.org/CategoryVulkan Assuming you are already familiar with SDL here are some code snippets that may help... // be sure to initialize your SDL window with the vulkan flag window = SDL_CreateWindow("My App", SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, 1280, 720, SDL_WINDOW_VULKAN); // initialize the vulkan instance #include <SDL.h> #include <SDL_vulkan.h> #include <vector> // in some init function... uint32_t extensionCount; SDL_Vulkan_GetInstanceExtensions(window, &extensionCount, nullptr); std::vector<const char *> extensionNames(extensionCount); SDL_Vulkan_GetInstanceExtensions(window, &extensionCount, extensionNames.data()); VkApplicationInfo appInfo {}; // TODO: fill this out std::vector<const char *> layerNames {}; // uncomment below if you want to use validation layers // layerNames.push_back("VK_LAYER_LUNARG_standard_validation"); VkInstanceCreateInfo info {}; info.sType = VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO; info.pApplicationInfo = &appInfo; info.enabledLayerCount = layerNames.size(); info.ppEnabledLayerNames = layerNames.data(); info.enabledExtensionCount = extensionNames.size(); info.ppEnabledExtensionNames = extensionNames.data(); VkResult res; VkInstance instance; res = vkCreateInstance(&info, nullptr, &instance); if (res != VK_SUCCESS) { // do some error checking } // now that you have a window and a vulkan instance you need a surface VkSurfaceKHR surface; if (!SDL_Vulkan_CreateSurface(window, instance, &surface)) { // failed to create a surface! } // at this point you have a window, vulkan instance and a vulkan surface // SDL is out of your way and you can use the vulkan api to enumerate the // physical devices, create a logical device plus queues, and create your // swapchain. Hope that helps.
  2. If I understand correctly, you want fully lit pixels to have zero ambient color and fully unlit pixels to use the ambient color. This way the fully lit pixels should match that first screenshot. If this is true, then making this happen isn't a "hack" but simply your particular requirement. However, I agree with Aceticon that your PBR is already hacked so it doesn't really matter. Something like the following could work: float factor = max(dot(normal,sunNormal), 0.0); color = vec4(mix(ambientLight, directionalLightColor, factor), 1.0);
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!