Skip to content

Instantly share code, notes, and snippets.

View JuanDiegoMontoya's full-sized avatar
🧊

Jake Ryan JuanDiegoMontoya

🧊
View GitHub Profile
@Darianopolis
Darianopolis / vktinyhellotriangle.cpp
Last active December 11, 2023 07:13
vktinyhellotriangle
int main(){glfwInit();
glfwWindowHint(GLFW_CLIENT_API,GLFW_NO_API);
void*window=glfwCreateWindow(800,600,"Hello Triangle",nullptr,nullptr),*glfwExtensions,*extensionCount=new uint32_t,*queueFamily=new uint32_t,*imageIndex=new uint32_t,*count=new uint32_t,*queueFamilies,*formats,*images,*instance,*surface,*physicalDevice,*device,*queue,*swapchain,*vertexShader,*fragmentShader,*renderPass,*pipelineLayout,*pipeline,*fence,*imageView,*framebuffer,*cmdPool,*cmd;
glfwExtensions=glfwGetRequiredInstanceExtensions((uint32_t*)extensionCount);
vkCreateInstance([](auto&&v){return&v;}(VkInstanceCreateInfo{.sType=VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO,.pApplicationInfo=[](auto&&v){return&v;}(VkApplicationInfo{.sType=VK_STRUCTURE_TYPE_APPLICATION_INFO,.apiVersion=VK_API_VERSION_1_0,}),.enabledExtensionCount=*(uint32_t*)extensionCount,.ppEnabledExtensionNames=(const char**)glfwExtensions,}),nullptr,(VkInstance*)&instance);
glfwCreateWindowSurface((VkInstance)instance,(GLFWwindow*)window,nullptr,(VkSurfaceKHR*)&surface);
==========
VULKANINFO
==========
Vulkan Instance Version: 1.3.211
Instance Extensions: count = 12
===============================
VK_EXT_debug_report : extension revision 10

A good way to think about a buffer or an image descriptor is to imagine it as a very fat pointer. This is, in fact, not too far removed from reality, as we shall see.

Taking a peek at radv, we find the uniform buffer and storage buffer descriptors to be a 4-word tuple, where the first two words make up the address, followed by length in bytes for bounds checking and an extra word, which holds format information and bounds checking behavior [^1].

Similarly, the sampled image descriptor is a 16-word tuple containing an

@Jgb14002
Jgb14002 / Event.h
Created December 14, 2020 21:12
Simple C++ EventBus Implementation
#pragma once
#include <unordered_map>
#include <vector>
#include <memory>
#include <typeindex>
struct Event { bool handled = false; };
class EventDispatcher
@pixelsnafu
pixelsnafu / CloudsResources.md
Last active June 26, 2024 21:29
Useful Resources for Rendering Volumetric Clouds

Volumetric Clouds Resources List

  1. A. Schneider, "Real-Time Volumetric Cloudscapes," in GPU Pro 7: Advanced Rendering Techniques, 2016, pp. 97-127. (Follow up presentations here, and here.)

  2. S. Hillaire, "Physically Based Sky, Atmosphere and Cloud Rendering in Frostbite" in Physically Based Shading in Theory and Practice course, SIGGRAPH 2016. [video] [course notes] [scatter integral shadertoy]

  3. [R. Högfeldt, "Convincing Cloud Rendering – An Implementation of Real-Time Dynamic Volumetric Clouds in Frostbite"](https://odr.chalmers.se/hand

@patriciogonzalezvivo
patriciogonzalezvivo / GLSL-Noise.md
Last active June 26, 2024 17:39
GLSL Noise Algorithms

Please consider using http://lygia.xyz instead of copy/pasting this functions. It expand suport for voronoi, voronoise, fbm, noise, worley, noise, derivatives and much more, through simple file dependencies. Take a look to https://github.com/patriciogonzalezvivo/lygia/tree/main/generative

Generic 1,2,3 Noise

float rand(float n){return fract(sin(n) * 43758.5453123);}

float noise(float p){
	float fl = floor(p);
  float fc = fract(p);