Skip to content

Instantly share code, notes, and snippets.

View bynmz's full-sized avatar
🤖

bynmz bynmz

🤖
View GitHub Profile
App3D::App3D() {
globalPool =
DescriptorPool::Builder(nileDevice)
.setMaxSets(SwapChain::MAX_FRAMES_IN_FLIGHT)
.addPoolSize(VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER, SwapChain::MAX_FRAMES_IN_FLIGHT)
.build();
// build frame descriptor pools
framePools.resize(SwapChain::MAX_FRAMES_IN_FLIGHT);
auto framePoolBuilder = DescriptorPool::Builder(nileDevice)
#version 450
layout (location = 0) in vec4 inPos;
layout (location = 0) out vec4 outColor;
layout (set = 1, binding = 1) uniform sampler2D diffuseMap;
void main() {
vec4 tmp = vec4(1.0 / inPos.w);
#version 450
layout(location = 0) in vec3 position;
layout(location = 0) out vec4 outPos;
struct PointLight {
vec4 position; // ignore w
vec4 color; // w is intensity
};