#DARE (Danny's Awesome Rendering Engine)

1 messages · Page 5 of 1

dawn wave
#
 ERROR phobos::core::debug             > [VALIDATION]: VUID-VkRayTracingPipelineCreateInfoKHR-layout-07987 (1242222997): Validation Error: [ VUID-VkRayTracingPipelineCreateInfoKHR-layout-07987 ] Object 0: handle = 0x72303f0000000052, type = VK_OBJECT_TYPE_SHADER_MODULE; Object 1: handle = 0x7ddd740000000051, type = VK_OBJECT_TYPE_PIPELINE_LAYOUT; | MessageID = 0x4a0ad195 | vkCreateRayTracingPipelinesKHR(): pCreateInfos[0] VK_SHADER_STAGE_RAYGEN_BIT_KHR has a push constant buffer Block with range [0, 136] which outside the pipeline layout range of [0, 128]. The Vulkan spec states: If a push constant block is declared in a shader, a push constant range in layout must match both the shader stage and range (https://vulkan.lunarg.com/doc/view/1.3.250.1/windows/1.3-extensions/vkspec.html#VUID-VkRayTracingPipelineCreateInfoKHR-layout-07987)
 ERROR phobos::core::debug             > [VALIDATION]: VUID-vkCmdPushConstants-offset-01795 (666667206): Validation Error: [ VUID-vkCmdPushConstants-offset-01795 ] Object 0: handle = 0x250c95a24a0, type = VK_OBJECT_TYPE_COMMAND_BUFFER; | MessageID = 0x27bc88c6 | vkCmdPushConstants(): VK_SHADER_STAGE_RAYGEN_BIT_KHR, VkPushConstantRange in VkPipelineLayout 0x7ddd740000000051[] overlapping offset = 128 and size = 8, do not contain VK_SHADER_STAGE_RAYGEN_BIT_KHR. The Vulkan spec states: For each byte in the range specified by offset and size and for each shader stage in stageFlags, there must be a push constant range in layout that includes that byte and that stage (https://vulkan.lunarg.com/doc/view/1.3.250.1/windows/1.3-extensions/vkspec.html#VUID-vkCmdPushConstants-offset-01795)
#

don't tell me this is phobos

tropic vigil
#

Hmm

#

Ill take a look

tropic vigil
#

are these used in the shader

#

shader reflection is running for rt pipelines too yeah

#

and theres no special handling for them there

dawn wave
#

Ahhh that might br why

#

Let me try using it in the shader

#
 ERROR phobos::core::debug             > [VALIDATION]: VUID-vkCmdPushConstants-offset-01795 (666667206): Validation Error: [ VUID-vkCmdPushConstants-offset-01795 ] Object 0: handle = 0x201b6126490, type = VK_OBJECT_TYPE_COMMAND_BUFFER; | MessageID = 0x27bc88c6 | vkCmdPushConstants(): VK_SHADER_STAGE_RAYGEN_BIT_KHR, VkPushConstantRange in VkPipelineLayout 0x7ddd740000000051[] overlapping offset = 128 and size = 8, do not contain VK_SHADER_STAGE_RAYGEN_BIT_KHR. The Vulkan spec states: For each byte in the range specified by offset and size and for each shader stage in stageFlags, there must be a push constant range in layout that includes that byte and that stage (https://vulkan.lunarg.com/doc/view/1.3.250.1/windows/1.3-extensions/vkspec.html#VUID-vkCmdPushConstants-offset-01795)
#

hnnn

#

i have no clue why this bug is happening

#

hm
Mat4
Mat4
u32

#

that shouldn't be an issue...?

#

I think phobos borked

#
layout(push_constant) uniform PushConstants {
    mat4 view;
    mat4 projection;
    uint frame_id;
} pc;
if (pc.frame_id > 1) {
        vec3 old_color = imageLoad(old_image, ivec2(gl_LaunchIDEXT.xy)).rgb;
        // Caulcate contribution
        float a = 1.0f / float(pc.frame_id);
        // Mix the old and new colors together
        vec3 final_color = mix(old_color, payload.incoming_light, a);

        imageStore(rt_out, ivec2(gl_LaunchIDEXT.xy), vec4(final_color, 1.0));
        imageStore(old_image, ivec2(gl_LaunchIDEXT.xy), vec4(final_color, 1.0));
    } else {
        // First frame, do not worry about accumulation
        imageStore(old_image, ivec2(gl_LaunchIDEXT.xy), vec4(payload.incoming_light, 1.0));
        imageStore(rt_out, ivec2(gl_LaunchIDEXT.xy), vec4(payload.incoming_light, 1.0));
    }
#

I mean it should be fine?

#

yet why

#

it seems like it can't detect the uint push constant and keeps spamming out that one message over and over

tropic vigil
#

does it still work even with that message

dawn wave
#

no it seems like the shader defaults frame_id to zero. It does run but frame_id is set to zero

tropic vigil
#

ive gotten that message before too and i dont really know where it comes from but it always worked fine for me

#

hmm

#

ill have to look into it then

#

make sure each shader stage declares the same push constant block

#

even if some variables are unused in that stage

dawn wave
#

oh each shader stage

#

wait really?

#

so like my rchit, rmiss

#

also should declare the same block?

tropic vigil
#

Ye

dawn wave
devout mesa
#

wat why

dawn wave
#

iirc your examples don't do that

#

and it runs fine

tropic vigil
#

do they not

#

weird

#

i think that could fix this error though

dawn wave
#

pls fix the error message

#

i could look into as well

#

it shouldn't be that bad

#

seems like you might be forgetting to change the layout size

#

it's weird though

#

as keeping two mat4s runs perfectly fine

tropic vigil
#

its in the shader reflection find_push_constants i assume

#

something is going wrong there

dawn wave
#

iirc this wouldn't be a shader problem however

#

ah fuck

#

hmmm

#

setting the push constant in each shader

#

does not remove the error

#

some good news however

tropic vigil
#

check if the pipeline layout is what you expect it to be

dawn wave
#

it seems like frame_id is working and it's incrementing up

tropic vigil
#

in the debugger

dawn wave
#

but the error message is still being thrown

#

okok will do

#
OpMemberDecorate %100 0 ColMajor
OpMemberDecorate %100 0 Offset 0
OpMemberDecorate %100 0 MatrixStride 16
OpMemberDecorate %100 1 ColMajor
OpMemberDecorate %100 1 Offset 64
OpMemberDecorate %100 1 MatrixStride 16
OpMemberDecorate %100 2 Offset 128
#

This seems fine?

#

uhh

#

i can't seem to find the pipeline layout

#

@tropic vigil It says 3 push constants were made

tropic vigil
#

can you show the struct with pipeline layout info

#

uh hold on

#
#[derive(Debug, Clone, Default)]
pub struct PipelineLayoutCreateInfo {
    /// Pipeline layout flags
    pub flags: vk::PipelineLayoutCreateFlags,
    /// Descriptor set layouts for this pipeline layout.
    pub set_layouts: Vec<DescriptorSetLayoutCreateInfo>,
    /// Push constant ranges used in this pipeline
    pub push_constants: Vec<PushConstantRange>,
    /// Whether this pipeline layout is persistent, e.g. whether it should be kept alive forever
    /// by the cache. Use this with caution, as it can cause large memory spikes for frequently changing
    /// pipeline layouts.
    pub persistent: bool,
}
#

This one

#

The push_constants field

dawn wave
#

ohh okok

tropic vigil
#

You can set a breakpoint on line 349 in shader_reflection.rs

dawn wave
#

how tf do i access it bleakekw

#

i can't find this file

#

uhh

tropic vigil
#

pipeline/shader_reflection.rs

#

All the way at the bottom it returns the completed layout

dawn wave
#
self = {*mut phobos::pipeline::pipeline_layout::PushConstantRange} 0x000002317ec47bf0 {stage_flags={__0=256}, offset=0, size=132}
 stage_flags = {ash::vk::bitflags::ShaderStageFlags} {__0=256}
 offset = {u32} 0
 size = {u32} 132
#

bleakekw isn't that the correct size?

tropic vigil
#

hmmm

tropic vigil
dawn wave
#

yeah

tropic vigil
#

looks about right then

dawn wave
#

then ig my validation layer is simply built different bleakekw

tropic vigil
#

what type is frame_id

dawn wave
#

u32

tropic vigil
#

thonk

dawn wave
#

🤔

tropic vigil
#

then what is it saying about offset 128 size 8

#

how size 8

#

that makes no sense

dawn wave
#

oh yeah

#

uint is 4

#

tf

#

🤔

tropic vigil
#

do you have push constants in any other shader

dawn wave
#

no i don't

tropic vigil
#

hmm

dawn wave
#

let me try to update vulkan

tropic vigil
#

so the pipeline layout looks correct

dawn wave
#

brb

#

will update vulkan

#

maybe that fixes it

tropic vigil
#

One more thing you can try is lookign at command_buffer/incomplete.rs line 568 and check if the byte buffer data has 4 elements

dawn wave
#

so uh

#

news

#

the issue dissapeared

#

huh

#

less noise

#

@tropic vigil Idfk what happened but the problem went away bleakekw

#

maybe my shader weren't updating?

tropic vigil
#

maybe you didnt recompile it yea

dawn wave
#

okok now we can make progress

#

what to do next

#

i should probably jitter the pixel

devout mesa
#

contact hardening

dawn wave
#

wtf

devout mesa
#

and jitter yes

dawn wave
#

what is contact hardening

devout mesa
#

go outside

#

see some shadows

#

that's contact hardening

dawn wave
#

oh soft shadows?

devout mesa
#

aka real, true shadows

#

hard shadows at the base, soft shadows far

dawn wave
#

OH

#

okok

devout mesa
#

#general message

#

it shall look beautiful like this

dawn wave
#

hmmm how to contact harden

#

oh i probably should add area lights to do that

#

oh no light sampling

#

oh no

devout mesa
#

it's very ez

dawn wave
#

thonk

#

i'm too dumb

devout mesa
#

randomize ray target towards the sun by a small amount

dawn wave
#

o

#

OH

#

contacts: harden

#

pixels: jittered

#

rt: on

devout mesa
#

good

dawn wave
#

impl rendering equation time

devout mesa
#

I will now crush your dreams

dawn wave
#

o :(

devout mesa
#

any of this isn't physically correct

#

go study light transport theory

dawn wave
#

yeah it isn't bleakekw

#

oh no

#

it's time

#

where tf do i start

#

gpu gems

#

or like

#

ahhh

dawn wave
#

i should probably rework asset loading however

#

it's really slow

dawn wave
#

god it looks beautiful

#

I CANT STOP STARING AT IT

dawn wave
#

note to self:

#

use image crate to handle images KEKW

#

it's so much easier + faster

tropic vigil
#

yes except its performance in debug is really bad

dawn wave
#

It’s way faster than my original method bleakekw

#

I was iterating over the entire image with a par_iter to add the alpha channel

tropic vigil
#

Bruh lmao

dawn wave
#

I have no clue where to start when learning light transport theory bleakekw

#

I have to also learn some more probability mainly monte carlo stuff (i don't understand why pdfs exist)

#

man raw vulkan is hard :(

#

i forgor most things already from learnopengl bleakekw

dawn wave
#

this is big
(i should be learning light transport theory lmaooo instead of learning raw vulkan)

tropic vigil
dawn wave
#

Also maybe defect

dawn wave
#

LVSTRI you got a version of bistro with the exterior + interior?

devout mesa
#

yes but I think my drive space is over

dawn wave
#

aw bleakekw I need the scene

#

I can't find an online one which has lights + emissives

#

uhh

#

isn't there any alternatives to bistro?

devout mesa
#

just diy in blender

dawn wave
#

also it's time to bikeshed how should i store my lights in my scene

#

we got the obvious solution:
Buffer containing vec4 -> r,g,b,intensity

dawn wave
#

bro this monte carlo stuff

#

is hurting my head

dawn wave
#

forget monte carlo

#

probability density functions

#

so confusing

dawn wave
#

i'm gonna dissapoint lvstri

#

instead of studying

#

ill just implement rt in one weekend KEKW

#

i need to see pretty pictures

devout mesa
#

they do explain the math

#

so it's fine

dawn wave
#

yeahh but it isn't pbrt level

devout mesa
#

as long as you read properly frog_police

dawn wave
#

heh

#

bold assumption

#

tbfh rt in one weekend is not scary

#

it's the stats i fear

tropic vigil
#

did you never take a stats course

dawn wave
#

i only got grade 12 stats

tropic vigil
#

pdf's arent too complicated conceptually

dawn wave
#

so cdfs

#

pdfs i think i got?

tropic vigil
#

if you understand what a normal distribution is and how to interpret a bell curve you understand pdfs

dawn wave
#

but the wording is confuzzling

#

i'm too used to having it be explained to me nicely by a hs teacher

tropic vigil
#

lmao

dawn wave
#

like i search what a pdf is and 3 different definitions come back

#

idk i'm following the pbrt one iirc it was something like a pdf describes the relative probability of given variable(s) x occuring

tropic vigil
#

thats not really accurate since your variable is not discrete typically

dawn wave
#

yeah if it's continious then iirc it describes a domain within the function

#

can't be a single value well it can I think? but it'll be zero

#

I still don't get the difference between it and a probability distribution function is however as iirc in my stats class P(2<=x<=4) would cover the same thing unless I'm stupid (i am)

dawn wave
#

oh i forgot to show this off

#

god dammit i can't find a good scene

dawn wave
#

bro

#

infinity mirrors

#

are wack

#

stare into the cube long enough and the cube stares back at you

#

suzanne

feral trellis
dawn wave
#

me neither

#

:D

#

i vaguely understand what a domain is

#

but i cannot describe it to you

#

but uhh

#

I can give you a reasonable example

#

f(x) => x in real numbers

#

essentially that means [0.0, 5.3] would be in the domain of x

feral trellis
#

Oh okok so like the same domain/ranges shit as in gr 11 functions

dawn wave
#

sorta?

#

idfk man KEKW

#

domains contain a lot of things

#

all i know is it's usage within vulkan and co. in terms of algos.

feral trellis
#

Yea welp I guess I'll have to look more into that before calc and vectors

dawn wave
#

it's not covered in grade 12 KEKW

feral trellis
#

Oh ok well... before Uni at least!

dawn wave
#

just understand what the terminology means in your case the grade 11 definition is probably good

dawn wave
#

dude this iamge

#

is just so

#

fuckingcool

#

holy shit

dawn wave
#

GOOD MORNING (i have yet to sleep)

dawn wave
#

Guys

#

I think I understand pdfs

dawn wave
#

So ih

#

How would you play a video in a scene?

dawn wave
#

So

#

today's lesson: store your acceleration structure data in gpu memory

#
buffer: 102382998272 scratch: 18281826688
#

nvm

#

stoday's lesson

#

implement LODs

devout mesa
#

you don't really LOD with RT

dawn wave
#

ah

#

well it seems like I can't import the scene because of memory limits

#

shockingly importing 100gb into video memory is a bad idea

devout mesa
#

You can actually lower that by a lot

#

just instance your shit

dawn wave
#

oh KEKW

#

ill do that

final steeple
#

what scenere are u using for 100gigs bleakekw

dawn wave
#

he imported an ue5 scene

final steeple
#

ue5 nanite gltf

dawn wave
#

bro i feel so fucking stupid

#

i was malding why my transfer buffer wasn't working

#

only to figure out it was because i forgot to include it in my submit info

dawn wave
#

Wait what

#

ash::Device is a fucking reference countedp ointer

#

what the fuck

#

BRO

#

IVE BEEN PASSING IT AROUND

#

AS AR EFERENCE

#

THIS WHOLE FUCKING TIME

#

OH MY FUCKING GOD

#

BRO

#

WHY DID NO ONE TELL ME

devout mesa
#

why would you needlessly increase the refcount

dawn wave
#

nono

#

like all my very light abstraciton layers for vulkan

#

all required me to pass in a device

#

for everything

#

i could've just cloned the device

#

and stored it onto the struct

#

huh

#

seems like phobos also stores it in their structs. they put device into their structs as well

feral trellis
#

Yep

#

Good ol Arc<T>

#

(internally that's what phobos does at least)

dawn wave
#

brain dead mode time

#

so like what does x' mean

#

the derivative of x?

#

bro im too dumb 😭

#

fuck man i need to review grade 12 calc

#

might as well to prep for uni

devout mesa
#

it's another variable

#

you could write t or something

dawn wave
#

ahhhh why tf are they using x'

#

god dammit math

devout mesa
#

it's just another way

#

leibniz tells us to be explicit and use df(x)/dx when deriving

dawn wave
#

huh alright

dawn wave
#

NO WE ARE NOT ALRIIGHT

#

PANIK

#

x' is the derivative

#

wtf

devout mesa
#

is it now

#

I don't think so

#

just substitute x' with t

#

easier to read

dawn wave
#

probably

#

will do

#

hmmmmm 🤔

#

what does x' represent?

#

oh the value of the intregral KEKW

#

i'm stupid

devout mesa
#

it's just another variable bro

#

they used x' instead of x because x is already used somewhere else (in the bounds of the integral)

#

it's just to let you know that this x and the other x are NOT the same

dawn wave
#

nono i get that i'm just trying to figure out what x' means

#

OH MY FUCKING GOD

#

i am stupid

tropic vigil
#

Bruh why didn’t they just call it y or something

dawn wave
#

classic math banger

#

they should make math 2 and let you make multi-letter variables

tropic vigil
#

We call that subscripts

dawn wave
#

yeah but integrate that natively into math 2

#

that doesn't even make sense bleakekw

tropic vigil
devout mesa
#

Math 2 biggest upgrade is "naming limit has been removed, mathematicians can now use variables of any length"

dawn wave
#

Math 2 linter when

#

me staring at the calculus i should know but i forgor

devout mesa
#

it won't be until calc 2 that it will become ingrained in your brain

dawn wave
#

highschool did calculus dirty bro 😭 I just only know how to memorize the ideas despite my teacher trying so hard for understanding

devout mesa
#

I can't ever forget how completely my pants were shitted and pissed, due to the sheer ridiculousness of triple integrals with polar coordinates

#

And the prof just goes: oh yeah, we'll have 3 of them in the finals, no biggie

dawn wave
devout mesa
#

legit scared shitless, I can never forget calc now

dawn wave
#

oh god

#

ill uh figure out a way to remember that

#

man maybe the cs + physics minor wasn't the play KEKW

devout mesa
#

physics is beta math

dawn wave
#

yeah but i got cs which is pre-release math

devout mesa
#

"it hasn't been fully tested but it somewhat works so its all good"

devout mesa
dawn wave
#

i'm doing that rn

feral trellis
#

uni is going to be so fun!!!11 (I am going to lose it)

devout mesa
#

and besides my cs course has calc 1 2 and 3, real analysis, complex analysis, algebra and abstract algebra & more

#

we have something like 10 classes that are pure math

dawn wave
#

oh mines is way less on math

devout mesa
#

uni issue smh

dawn wave
#

actually

#

oh my god

#

only 3 pure maths

#

we're dying out here bro

#

maybe i take a math minor to save it

devout mesa
#

move to a better continent

#

one where you don't pay for uni

dawn wave
#

. > be born in europe

devout mesa
#

the one I'm for the record

dawn wave
#

jealous bro

#

your unis are chill-ish in terms of prestige creep

devout mesa
#

wth is prestige creep

dawn wave
#

good schools require a 92%+ to get in

#

Canadian is universities are fucked bleakekw

devout mesa
#

I mean

feral trellis
#

I even heard some people with 99% averages don't get in waterloo bruh

dawn wave
#

yeah

feral trellis
#

(I am done for)

devout mesa
#

to get into private universities you need money + big grades

dawn wave
dawn wave
devout mesa
#

but if you go to a private uni you're dumb

devout mesa
#

so basically the ministry of education handles public unis

dawn wave
#

oh idfk then

#

yeah they don't 💀

#

yeah but grade inflation is insane

#

maybe i cope for a transfer KEKW

devout mesa
#

what is grade inflation even

dawn wave
#

essentially everyone keeps raising people's grades

#

despite people not improving

feral trellis
#

Like 5 years ago it wasn't this bad

#

It was actually possible to get into uni

dawn wave
#

main reason is high schools do it here in Ontario Canada is because they have to if they want their students to get into universities. we need standardized testing so badly

dawn wave
#

it's a vicious cycle as if one highschool increases their grades (they do) everyone else does and it keeps repeating

feral trellis
devout mesa
#

btw I never had to take an admission test in my life

#

once again, europe >>>

dawn wave
#

actually

#

it's so joever for us

devout mesa
#

I'm half joking though, for some courses you need to get tested

#

like medicine, law, etc

dawn wave
#

yeah ofc

#

like dawg i don't really like this uni as everything i've seen

#

points towards it have zero intest in cg

#

but i guess i gotta make it myself

devout mesa
#

still in time to book a flight to germany or ireland or smth

dawn wave
#

it's too late bleakekw

devout mesa
#

well, your masters then

dawn wave
#

i could transfer

devout mesa
#

I'm a europe shill, if that wasn't clear

dawn wave
#

ill probably go somewhere else for my masters

tropic vigil
dawn wave
#

man who knew learning light transport theory takes a long time

feral trellis
#

Lol

#

Who knew making a custom engine would take so much effort

dawn wave
#

cuistom engine

#

i could at least understand

#

light transport theory

feral trellis
#

Tbh that shit scares me I'm never touching it

#

I'd rather get stuck in the infinite loop of trying to micro-optimize 0.01ms than learn light transport theory

dawn wave
#

ficl this

#

im gonna wing it

#

and see how far i get

dawn wave
#

i couldn't

#

my fans borked

#

90*c

#

ooh yeah baby

dawn wave
#

i got a 32:9 monitor

#

how to fix the stretch res...

dawn wave
#

uhh

#

maybe place more cameras?

#

like have 3 cameras

#

one front

#

one left

#

one right

#

boom

#

problem solved

dawn wave
dawn wave
#

forget pipelines

#

im so lost by descriptor sets

#

also this looks very wrong

dawn wave
#

🦅 QUADS RAHHH

dawn wave
#

Guys maybe I use rust-gpu

#

It can’t be that bad guys

devout mesa
#

every time I am amazed at your will to hate yourself this much

final steeple
dawn wave
final steeple
#

ohh neat

dawn wave
#

write it all in C

final steeple
#

C78

#

you must remke this on a gameboy running vulkan

dawn wave
#

AHHH APNIC

#

ZERO PROGRESS ON VULAN

#

ZERO PROGRESS OF LIGHT TRANSPORT THEORY

#

how do I stop being burnt out

devout mesa
#

step one

#

sit in front of your pc

#

step two

#

do the goddamn work (in alternative, you can either stare at the screen or go lay down in bed)

#

step three

#

profit

dawn wave
#

I’ll trust you

devout mesa
#

do note that you have NO other alternatives

#

you sit there and do the work, or you stare at the screen doing nothing, or you go sleep

#

it works pretty good, I use this method myself sometimes KEKW

dawn wave
#

Learn game dev bleakekw

#

I got side tracked with game dev

devout mesa
#

that's not on the list of allowed activities sir

dawn wave
#

I remembered what it was like to have a decent devex

devout mesa
#

you will now be deported to the mines

dawn wave
#

NOOO

#

I’ll go back to Vulcan

devout mesa
#

I'm jk do whatever you want

dawn wave
near fern
#

lmao

#

you sure?

dawn wave
#

LVSTRI has been holding me hostage until I show him a physically based pathtracer

#

I am now forbidden from touching any asset system

dawn wave
dawn wave
#

LVSTRI uh do you know of any good streaming + LODing techniques

#

Tried running this on a 6gb rtx 4050

#

vram bleakekw

devout mesa
#

completion time should be between 2026 and the heat death of the universe

dawn wave
#

ill simply wait for the heat death

#

oh shoot

#

wasn't there one that used meshlets

dawn wave
#

o-week bleakekw

dawn wave
#

I hate it bro. My math class is the prof teaching us about grade 10 algebra and graphing 😭

near fern
#

he needs to repeat that at some point

#

as an introduction

dawn wave
#

Yeah esp with Covid many people are all over the place

dawn wave
#

Nvm

#

My combined math + physics course

#

Is all gas no breaks

dawn wave
#

They speedrun review and hop straight new content

tropic vigil
#

thats good

#

review would be boring

dawn wave
#

i lied

#

my ib math teacher overpreped me

#

the first 4 units

#

is review

dawn wave
#

Man is first year this easy?

feral trellis
#

You gotta tell me more fam I'm in 12th I have no idea what to do next year

dawn wave
#

They’re literally reviewing all the way back to 10th grade 💀

#

Prof really pulled out a parabola and started teaching use the quadratic equation

dawn wave
#

Discrete math is easy 🗣️
Thank you

dawn wave
#

Nvm

#

It’s dogshit

#

Why the hell do I need to write a fucking paragraph

#

To just solve 2x-1=1

#

“It’s correct math” 🤓
There is a fucking reason no one follows it you dipshit

#

I hate it

tropic vigil
#

Lol

dawn wave
#

Man all that graphics programming is really useful in discrete. 😅

#

“Zamn that’s the formal notation huh”

#

AHHH I REALIZED

#

I NEED TO DO RAY TRACING

dawn wave
#

Fellas

#

I am proud to announce I am presenting my side project at my uni

feral trellis
#

LES GOOO

#

(guelph?)

dawn wave
#

yeah

#

side project pitch

#

im gonna get someone smarter than me to actually help me figure out how tf to light transport

#

im too stupid pbrt.org went over my head 😭

feral trellis
#

Absolutely real

#

That way if I get accepted you'll have to pass down the knowledge lol

dawn wave
#

i will

#

no man should go through this much confusion

feral trellis
#

Who wouldn't want to learn light transport theory all on their own?!?!

dawn wave
feral trellis
#

Is it the one that utilizes phobos or raw VK

dawn wave
#

Phobos ofc

#

Raw vk kinda died 💀

near fern
#

raw vk is horrible to use

feral trellis
#

Yea that's what I imagined lol

#

Phobos is such a nice abstraction imo because it allows me to shoot myself in the foot with vk validation errors which is nice :3

#

(nah jk I just really like the task graph system. Totally new to me compared to wgpu / opengl)

dawn wave
#

Wanna do phobos 2: electric boogaloo

#

Except i just only use it myself

tropic vigil
#

thats how phobos started lol

near fern
#

i would strongly suggest to use phobos instead

dawn wave
#

Oh ok

#

Why?

dawn wave
#

You guys think

#

This can also just be applied in Vulkan?

#

I just need to keep in mind glsl is column major vs hlsl which is row major

#

You know maybe I should just switch over to hlsl KEKW

dawn wave
#

Oh nvm wtf

#
// WorldNormal is the vector towards which the ray position will be offseted.
void ApplyPositionBias(inout float3 RayOrigin, float3 RayDirection, const float3 WorldNormal, const float MaxNormalBias)
{
    // Apply normal perturbation when defining ray to:
    // * avoid self intersection with current underlying triangle
    // * hide mismatch between shading surface & geometric surface
    //
    // While using shading normal is not correct (we should use the 
    // geometry normal, but it is not available atm/too costly to compute), 
    // it is good enough for a cheap solution
    const float MinBias = 5e-6f;
    const float MaxBias = max(MinBias, MaxNormalBias);
    const float NormalBias = lerp(MaxBias, MinBias, saturate(dot(WorldNormal, RayDirection)));

    RayOrigin += RayDirection * NormalBias;
}

This is so much better

final steeple
#

Cleaner, better, simpler, more like c++, PascalCase

dawn wave
#

nah cringw

#

snake_case

#

PascalCase is nice if you only have 2< capitals

#

Then it becomes a pain after

#

I also dfigoured out why my random point algos were f’d

I was using rng(0,1) and not rng(-1,1)
🥶🥶🥶

final steeple
dawn wave
#

bro PascalCaseObject seems way more legacy

#

But true it does seem legacy

dawn wave
#

it's so over

#

how the fuck

#

what?

#

these geometry normals are 100% wrong

#

i tried to convert them to world space

#

wtf

devout mesa
#

they are just not interpolated

#

and uh

#

inverted

#

ground should be green

dawn wave
#

kekw

#

i solved it

#

v0 - v1, v2 - v0 which is wrong

#

v1 - v0, v2 - v0

#

now its time for: normal mapping

#

oh no :(

devout mesa
#

did you figure out light transport theory btw

dawn wave
#

i was close

#

then university

#

going back to my renderer is like getting a whiplash of flashbacks

dawn wave
devout mesa
#

I mean

#

if you like flat shading

#

then sure don't interpolate them

dawn wave
#

iirc interpolated should be used if you got a texture, no?

devout mesa
#

no

dawn wave
#

oh no

devout mesa
#

you can see tringles

#

if you want smooth shading, you don't want to see tringles

#

therefore you interpolate

dawn wave
#

oh yeah getting the 3 normals

#

i was just calculating the normal of the triangle then literally applying that

#

spoonza

#

now its time for mission impossible 2: normal mapping

dawn wave
#

we did it baby

#

normal mapping

#

should i uh

#

i should probably calculate the tangent coordinate prior shouldn't i

#

then cross product T x N to be the Bitangent

dawn wave
#

Hmm how should I handle transparencies?

#

When colliding with a transparent object, should I just send another ray into the object + apply snell's law?

final steeple
#

anyhit shader?

#

Oh, if refractive transparent object then yeah snells law

#

anyhit shaders for alpha transparencies

dawn wave
#

no shot i am not adding mf alpha transparencies

#

wait no i should

#

but only for completely transparent

dawn wave
#

should I: learnt light transport theory

#

or procrastinate and try to get culling working

#

so i can load massive scenes on my laptop

#

and maybe lods??? but no clue how to achieve that on rt

devout mesa
#

the best you can do is world partition

#

but why

#

what's the massive scene you can't load right now

dawn wave
#

my laptop gpu has very little vram

#

but bistro

#

any large-ish scene, my laptop's gpu says goodbye

#

and im back onto my 12gb desktop gpu

#

also i wanna render out that 2 trillion polygon nanite scene you had

#

kekw

#

LETS GOOOO BABY

#

DECCER CUBES BROKE IT AGAIN

devout mesa
#

it's all instances anyways

#

so your TLAS is gonna be massive

dawn wave
#

i tried last time

#

it didn't have enough space on gpu

devout mesa
#

buy a 4090 then

dawn wave
#

vertically scaling strategy

#

2500 CAD bleakekw

devout mesa
#

chump change, go for it

dawn wave
#

HE'S BACKK

#

i have a shit ton of empty descriptors error though

dawn wave
#

the urge

#

to stop doing work and stare at this picture

#

i literally just need to implement transmission

#

but fuck

#

i actually need to learn light transport theory

#

or else this is gonna be very fucking bad for me

dawn wave
#

yoo preview works

dawn wave
#

How the hell do you make time for personal projects

#

I haven’t done any serious GP in a while. I forgotten so much 😭

dawn wave
#

FUCK IT

#

ill learn vulkan from scratch again

#

also

#

oh my god

#

i forgot this website existed

#

i wanna kms

#

i don't need to trudge through pbrt.org and have no clue what half of it is yapping about

final steeple
#

lmao

#

c++ cmon

dawn wave
#

nono its not the c++

#

its the i dont know math

final steeple
#

its all calc

#

im also lost cause the school hasnt taught it yet

dawn wave
#

see i got a 94 in calc

#

i still don't get it

final steeple
#

its just magic

dawn wave
#

probably is

dawn wave
#

HOW

#

im so lost how tf do get rust_window

#

to actually enumerate over my required extensions

#

no examples at all

#

wtf

devout mesa
#

what are you doing

dawn wave
#

shush

#

i figured it out

devout mesa
#

btw

dawn wave
#

i tried getting egui (imgui) working on phobos but kinda borked seems like integration is borked

devout mesa
#

have you ever actually done a Vulkan app

#

on your own

#

I feel like in your case it could be beneficial

dawn wave
#

no it's why im doing it rn

devout mesa
#

without phobos I mean

dawn wave
#

yeah

#

well no

#

i havent

#

i need to

#

which is why im trying rn

#

💀

devout mesa
#

epic

dawn wave
#

i was on a roll a while ago then i got caught up with uni

devout mesa
#

same

#

except I use advanced time management techniques to work on my shit anyways

dawn wave
#

uni literally killed off so many projects that were so active

dawn wave
#

i wish i had those skills (first year LETS GOOOO)

devout mesa
#

the advanced time management techniques are as follows

#

no sleep
use boring lectures to work on your shit
use boring work hours to work on your shit
do the assignments later deep in the night

#

by no sleep I mean you should average 3 hours per night

#

but if you do less that's great

dawn wave
#

uh huh

#

my advanced time management technique is as followed

#
  • can i do what i said on my todo list?
  • no?
  • panik
#

but true i should probably be doing my pesonal projects in my intro to c courses

#

KEKW someone was caught using chatgpt during our midterm

dawn wave
#

very bad news

#

Extension: VK_KHR_surface
Extension: VK_KHR_win32_surface

#

Failed to create instance: ERROR_EXTENSION_NOT_PRESENT

#

WHAT

#

????/

#
// Extensions
        let mut extensions_names = ash_window::enumerate_required_extensions(window.raw_display_handle()).unwrap().to_vec();
        extensions_names.push(ash::extensions::ext::DebugUtils::name().as_ptr());

        let create_info = vk::InstanceCreateInfo {
            s_type: vk::StructureType::INSTANCE_CREATE_INFO,
            p_next: ptr::null(),
            flags: vk::InstanceCreateFlags::empty(),
            p_application_info: &app_info,
            pp_enabled_extension_names: ptr::null(),
            enabled_layer_count: 0,
            pp_enabled_layer_names: extensions_names.as_ptr(),
            enabled_extension_count: extensions_names.len() as u32,
        };
#

thonk

devout mesa
#

reading rust code always makes me sad

#

idk why

dawn wave
#

snake_case and its affects on lvstri's emotional state

devout mesa
#

nah that's not it

#

or maybe it is idk, my code is always snake_case

#

even my types are snake_case

dawn wave
#

hold on

#

wait i give up KEKW

devout mesa
#

wat

dawn wave
#

okay i should finish my intro to c quiz

#

and assignments

devout mesa
#

c quiz?

dawn wave
#

because my intro to c course is braindead

devout mesa
#

epic

dawn wave
#

discrete math on the other hand bleakekw

devout mesa
#

disc is easy

#

just do it

#

believe in the numbers

dawn wave
#

that's what i thought

#

until my prof showed me proofs

#

and now im scared

#

but proof by contradiction is the most real one

devout mesa
#

proofs can either be your worst enemy or your best friend

#

be someone who thinks of proofs as an ally

dawn wave
#

i mean some proofs i get like proof by contradiction as it's how ive kinda been proving my code works

#

but other stuff is just ah

devout mesa
#

proof by induction and contradiction are the easiest to reason with yeah

dawn wave
#

contraposition and others are uh

#

idfk how i survived that assignment question

devout mesa
#

luckily, that's 80% of proofs KEKW

dawn wave
#

thank god 🙏

dawn wave
#

okay

#

i geniunely have no clue

#

what the fuck is causing it to detect zero extensions

#
fn create_instance(entry: &ash::Entry, window: &winit::window::Window) -> ash::Instance {
        let app_name = CString::new(WINDOW_TITLE).unwrap();
        let engine_name = CString::new("Vulkan Engine").unwrap();
        let app_info = vk::ApplicationInfo {
            s_type: vk::StructureType::APPLICATION_INFO,
            p_next: ptr::null(),
            p_application_name: app_name.as_ptr(),
            application_version: vk::make_api_version(0, 1, 0, 0),
            p_engine_name: engine_name.as_ptr(),
            engine_version: vk::make_api_version(0, 1, 0, 0),
            api_version: vk::API_VERSION_1_3,
        };

        // Extensions
        let mut extensions_names = ash_window::enumerate_required_extensions(window.raw_display_handle()).unwrap().to_vec();
        extensions_names.push(ash::extensions::ext::DebugUtils::name().as_ptr());

        let create_info = vk::InstanceCreateInfo {
            s_type: vk::StructureType::INSTANCE_CREATE_INFO,
            p_next: ptr::null(),
            flags: vk::InstanceCreateFlags::empty(),
            p_application_info: &app_info,
            pp_enabled_extension_names: ptr::null(),
            enabled_layer_count: 0,
            pp_enabled_layer_names: extensions_names.as_ptr(),
            enabled_extension_count: extensions_names.len() as u32,
        };

        let instance: ash::Instance = unsafe {
            entry
                .create_instance(&create_info, None)
                .expect("Failed to create instance")
        };

        instance
    }
#

hmmhmmhmhmhhmm

dawn wave
#

I GET IT

#

MONTE CARLO INTEGRATIIN

#

AHAHAAHHA

#

MAYBE IM NOT THAT STUPID

#

THE PDFs

#

THEY MAKE SENSE

dawn wave
#

🤔

#

how would i implement physical device selection

#

should i just do points?

devout mesa
#

you select the first available

#

and you forget about it

winged raptor
#

Select the first dedicated GPU available*

#

Please leave my igpu to sleep in peace

dawn wave
#

okok

#

you know turns out learning vulkan by fire works

#

no more tutorial hell

near fern
#

turns out selecting the frist one makes sense

#

the os will order them for you

#

to some extent

#

thais also allows the device selection in win11 to work

dawn wave
#

to some extent* KEKW

#

okok ill just pick first one and forget about it

near fern
#

imo you should reject all gpus that do not meet your requirements

#

then select first

#

ideally you can also have a device selector witin the app

dawn wave
#

this is bikeshedding 532.0

#

when handling queues and logical devices

#

do you guys just combine them together?

#

i.e. have a queue struct, but have it all stored in the logical device

#

or do you guys just make it a seperate class

#

also we need a name for this library

#

DAVL
Danny's Awesome Vulkan Library
DAVOUR
Danny's Awesome Vulkan Objects and Utilities Resource

devout mesa
#

I have a separate class but I store the queues in the device

dawn wave
#

yo @tropic vigil sorry for pinging, if I clone a Device in rust, does it stil refer to the same device underneath the hood?

tropic vigil
#

hi

#

depends on the library youre using

#

in ash, yes

dawn wave
#

so you can just clone any vulkan object

tropic vigil
#

you can but be careful doing so

#

easy to get double frees

dawn wave
#

ohh I see

#

alright thank you penguin

dawn wave
#

oh god

#

swapchains

#

why are they so fucking

#

long

#

i mean makes sense considering the millions of monitors configurations

#

but sadge :( where is vk-bootstrap-rs when you need it

dawn wave
#

heh

#

heh

#

my ssd corrupted

#

i forgor to commit

#

all my progress

#

gone

#

poof

#

:(

dawn wave
#

NO I RECOERVED IT

#

AHAHAH

feral trellis
#

LES GOOO !!!

#

(ps: always make backups)

dawn wave
#

so like uh how would I make a rendergraph...

#

maybe wpotrick is cooking something

#

wait tf is a task graph?

tropic vigil
#

a graph of tasks

#

nodes are tasks

#

edges are dependencies between tasks

#

if node A uses the output of node B, then theres i a (directed) edge from node B to node A (or the other way around, you can choose this)

#

In a render graph, the inputs and outputs become gpu resources such as attachments and buffers

#

The nodes could be renderpasses, but they dont have to be

dawn wave
#

huh alright

#

this makes sense now

#

it can't be that hard

#

(im about to go on a 5 year journey on a scale never seen before in history)

tropic vigil
#

Conceptually it’s not, implementing it without bugs and with proper sync is a bit more work :)

dawn wave
#

huh alright

#

another question, why do you re-export all the wsi + ash types?

#

since i would assume you could just state in crates.toml a hard coded version phobos is made for (ash and wsi)

dawn wave
#

also really dumb question

#

uhh why does Device.rs in phobos but Arc<> but not Instance should they not both use it to ensure that Drop doesn't get called too early?

dawn wave
#

im kinda lost now how tf ash destroys and cleans vulkan objects? Drop I assume immedietly causes a cleanup of a vulkan object?

#

fuck it

#

what if i just wrapped it all in Arc<>

#
#[derive(Clone)]
pub struct Instance {
    pub entry: Arc<ash::Entry>,
    pub instance: Arc<ash::Instance>,
}
devout mesa
#

wrapping vulkan objects in a shared pointer sounds very wrong

dawn wave
#

yeah feels like so

#
#[derive(Clone)]
pub struct Instance {
    pub entry: ash::Entry,
    pub instance: ash::Instance,
}

impl Drop for Instance {
    fn drop(&mut self) {
        unsafe {
            self.instance.destroy_instance(None);
        }
    }
}

let instance = Arc::new(Instance { ... });
dawn wave
#

nah, i'd wrap it all in Arc<>

#

Infinite overhead

dawn wave
#

@devout mesa how do you handle managing the lifetimes of vulkan objects?

#

im 100% overthinking this problem

#

my assumption was to just throw reference counters everywhere then have the destructor that destroys the vulkan object itself

dawn wave
#

oh so i did do it correctly the first time around

#

thank you

devout mesa
#

no

#

I don't Arc<VkInstance>

devout mesa
#

then yes

dawn wave
#

then have it as a member of a struct that needs it etc.

#

i cooked

#

thank you

tropic vigil
#

💀

dawn wave
#

but literally everything else doesn't

tropic vigil
#

i think

dawn wave
#

I'm just really lost on how Phobos ensures lifetimes as I don't see phobos making use of reference counting for other stuff

tropic vigil
#

arc is refcounting

#

but uh

#

device is used kinda everywhere

#

so its easier to just refcount it

#

for most other objects i rely on the user to create them in the right order

dawn wave
#

(i don't trust myself)

tropic vigil
#

should probably document that properly

#

i havent done much programming except for school lately

dawn wave
#

I mean the overhead can't be that bad by just throwing Arc around

tropic vigil
#

its not no

tropic vigil
#

theres also nothing stopping you from doing that in user code

dawn wave
tropic vigil
#

but theres no reason the library should enforce that

dawn wave
#

well since im the only one using my library

#

ill enforce it

tropic vigil
#

fair

dawn wave
#

😎

#

problem numero two

#

how the hell do i abstract the pipeline in a nice way

#

"yeah bro it isn't that bad you just gotta make these 11 vulkan objects which only 3 you'll really only need"

#

fuck it builder pattern

devout mesa
#

with sane defaults

#

and let the user only change what they need

dawn wave
#

good idea

devout mesa
#
auto tonemapPipeline = Retina::CGraphicsPipeline::Make(*device, {
    .Name = "TonemapPipeline",
    .VertexShader = "FullscreenTriangle.vert.glsl",
    .FragmentShader = "Tonemap.frag.glsl",
    .DescriptorLayouts = { { shaderResourceTable->GetDescriptorLayout() } },
    .DynamicState = { {
        Retina::EDynamicState::E_VIEWPORT,
        Retina::EDynamicState::E_SCISSOR,
    } },
    .RenderingInfo = { {
        .ColorAttachmentFormats = {
            finalImage->GetFormat()
        }
    } },
});``` e.g
#

what actually goes on behind the scenes:

#

uhh well it's too big

dawn wave
#

hmmm but i get the idea

devout mesa
#

This goes on behind the scenes KEKW

dawn wave
#

my condolences 🙏

#

another victim of vulkan

devout mesa
#

usage is very easy though

#

and that's what matters

dawn wave
#

oh yeah odd question

#

why do you abstract literally everything in vulkan

#

wait nvm

devout mesa
#

wym

dawn wave
#

like you use a lot of SPipelineStencilState or ECompareOperator which I assume are your own abstracted types from Vulkan?

#

or like EDynamicState

devout mesa
#

yeah, I like type safety

dawn wave
#

its been too long since i did cpp

#

wait vulkan.h doesn't have that type safety?

devout mesa
#

vulkan.h is not typesafe and vulkan.hpp is a scam

dawn wave
dawn wave
#

dynamic rendering 😎

#

its time to vkguide 2.0.

dawn wave
#

nah i forgot how to even do dynamic rendering 💀

#

no i figured it out

#

so uh do you guys combine the renderpass and pipeline

#

or keep them seperated?

devout mesa
#

they have no relationship

#

besides a single handle that you need for pass compatibility

#

just do dynamic rendering

dawn wave
#

ok o7

#

i uh kinda forgot how to enable extensions again 💀

#

i just attach the features in the .pNext chain yeah of physical device features?

#

wait so can extensions be enabled from the device + instance or must they only be enabled from only one?

devout mesa
#

instance extensions are mostly deprecated

#

use device extensions only

dawn wave
#

yeah

#

uh

#

wait no im good

devout mesa
#

also you don't need an extension for dynamic rendering

#

it's core in 1.3

dawn wave
#

oh

#

eh who cares

#

good exercise

#

wait i have an issue

#

uh my device suitability checks

#

need a surface but that also enables the extensions there

#

do i just seperate it into two stages:
first one just checks extension support
the second checks for surface support?

#

i guess i have to bite the bullet

#

and accept instance extensions for just this

dawn wave
#

uh when doing dynamic rendering would I still need to make my attachments descriptions?

dawn wave
#

god dammit

#

i forgot to enable dynamic rendering

dawn wave
#

so like should i just do this in hlsl KEKW or stay in glsl

devout mesa
#

do NOT do HLSL

dawn wave
#

why :(

near fern
#

bad buffers

dawn wave
#

huh

#

okay

near fern
#

but byte address buffers are fine

#

mostlz

#

im used to them from work

#

i think its ok IF you know what to do to be fast

devout mesa
#

buffers are garbage

#

no BDA

#

tons of perf pitfalls

#

just don't

dawn wave
#

do you guys uh

#

use timeline semaphores for swapchain?

#

wait you can't