#Iris - A Journey through OpenGL and beyond to learn Graphics
1 messages Β· Page 16 of 1
(also rendering all the CSMs onto a single image is interesting, I wonder if that's better than layered)
hehe i saw that in acerola's latest video today too
perfect tringlemeshlets π
black overlay is the input mesh
tringles made of tringles made of tringles made of...
@wicked notch how do you do hierchal culling? Can you just spawn 1 thread per meshlet (for a flat list of all meshlets for all LOD levels) and then just early-out if the meshlet is the wrong LOD?
Or should I look into how nanite does persistent queue schenanigans
that's classified info
jk, I don't yet do any runtime nanite culling or lod selection
I was planning to go straight for a persistent threads approach
Mhm ok
π€
inshallah
damn
!remindme 14 hours aaa
Alright gpgpu, I'll remind you about aaa in 14 hours. ID: 64927986
Keenans videos are so cool, but i dont understand any of it
watching all of his stuff since i sent you the intrinsic tringleations thingy
mathematicans are crazy people
manifolds and whatnot : >
real
I've subscribed to that channel
wtf does unity's GetComponent even refer to
how do I draw 3 vertices
I want to draw a tringle
is it not grabbing a component from a gameobject?
I have no clue
I am inside a C# script
when I do GetComponent<Something>() where am I getting the component from
scripts are like components itself
the object the script is running on
from the object the script is attached to
scripts are components on objects too π
the script is currently nowhere
then it doesn't run
I guess I have to put it on the camera if I want it to draw a fullscreen triangle?
why
why what
it be printing (object)
Debug.Log("test");```This should be valid usage?
I looked at docs
what about the part where it says "test"
I tunnel visioned hard
I literally couldn't see it 
ok now I gotta draw the tringle
all the ECS talk in #engine-dev reminded me that I should be building an engine
and so I thought of doing a little espionage mission on Unity
ah
Unreal is too bloated and clamplicated and frankly ugly 
unreal's ECS also feels weird to me
BBK's post in wip about sharpgltf (also what i use btw) reminds me that i need to do all those things he does too, but atm im completely sucked dry when it comes to any GP, 0 motivation
man engines are conchfusing tho
wtf is this shit
do gamedevs have to go through this
"game devs"
I honestly don't know how AAA studios deal with this stuff
I should look it up one day
how do I get a specific component
Shader "Unlit/RayTraceShader"
{
Properties
{
}
SubShader
{
Cull Off ZWrite Off ZTest Off
Pass
{
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#include "UnityCG.cginc"
float2 vert(uint vertexIndex : SV_VertexID)
{
return float2();
}
fixed4 frag(float2 i_uv) : SV_Target
{
return fixed4(0.0);
}
ENDCG
}
}
}
``` How did any human on this planet think this was good
yeah
this is absolute dogshit
and I already trimmed all the useless shit that was in there
there was some kind of fog calculation in there
why would you put that in a default "unlit" shader
Cull Off ZWrite Off ZTest Off
tho such annotations for pipelines are nice
within shaders
I am on a quest
cod engine would be 100% bindless if we didnt have low spec popoo device support

im always shilling daxaisms internally
when we ditch non bindless hw i will do crazy overtime to rip out non bindless
(I hope my boss reads this so hes inclined to ditch that hw)
yea its ultra sad
this is painful
their binding model is worse then OpenGL
btw thats one of the biggest ups of custom in house engines
you can just break anything at any time, move forward
this way you dont get stuck with garbage like unity and unreal
tho unreal is better at this i guess
GetComponent<TypeOfComponent>()
we did it
creating a shader to draw UVs has never been more complicated
I could've done this 50 times over in Retina
it's cus they started off as specifying fixed function passes, then later grew cg support which then became hlsl
the slightly nicer way to do it is to make a .cginc file and write your actual shader code in there, then include that in the shader file with defines and such
that do be slightly better
Properties {} and SubShader {} piss me off so much though
lol they're quite reasonable though
properties is nice because you basically get uniforms exposed in the inspector which you can tweak and set per material along with markup to show stuff like range sliders and set default textures
subshaders are a bit less relevant now though, they used to be so you could have different shaders for different platforms/quality settings/gpu support but now that's generally just controlled with shader features and such
maybe properties could be used as a sort of push constant
I mean they kind of are
properties is basically uniforms, push constants, and descriptors rolled into one
I shall only allow push const
I mean it's also where you're going to get textures
ye it all hides stuff behind your back, so on d3d11/12 it's cbuffers, vulkan/gl it's ubos, etc
i don't think they expose push constants or anything
they don't really care about vulkan on pc
yeah this is purely what I'm gonna do in my own thing
you only get to send IDs to them shaders
too few IDs? make a buffer with more IDs (and pass it as an ID too
)
I think this can be very nicely abstracted too
in the editor you can still just drag and drop the texture on the shader
now it's an ID though and the usage is much better on the shader side
unless I'm mistaken it's pretty similar here in unity
it is but you have to declare each thing
other than the fact you can't have a buffer of IDs
maybe declaring each thing is better? idk
idk if storage buffers exist at all in unity shaders π€
yeah you have the directx storage buffer types like StructuredBuffer and ByteAddressBuffer iirc, on the c# side they're called ComputeBuffer
if you're targeting d3d12 I think you can even get it to just pass your hlsl to dxc
how can I run a script after another
actually nay, how can I run a script? 
like, without adding it to something (camera or anything)
is the screen an object
but that doesn't even make sense, I just want to run a shader on a texture
what "object" do I need here
ok I can create an empty game object I guess
I am so angry
why
if I change the material here
it doesn't apply here too
unity bad
the tonemap pass also runs before the raytracing one after I explicitly specified execution order
this is so good
I should stop
before I show up at unity's HQ
because that's a default, if your script component doesn't specify one
why not default to whatever the material component has set
you didn't show the material props in either of those, I dunno how that works
sorry I meant the script
I configured the script here first
I was then bamboozled by the fact that I have to configure the script one more time
if I understand it correctly, the configuration you do there should apply if the actual script doesn't set any of the properties
so like if this component didn't set anything
perchance
back to one of my other π ±οΈroblems tho
if I have two scripts
I want to select only one of them in C# to set some properties
how do I do that
source in OnRenderImage god only knows what it refers to
I believe you can fetch scripts by the name of the class? e.g. GetComponent<MyScriptA>()
@wicked notch does your triangle ids within the visbuffer have index meshlet draw + triangle index in 32 bits or is it 64 bit and also contains entity indey and mesh index?
Not LVSTRI, but mine has instanced meshlet ID + triangle index in 32 bits
I have meshlet instance + triangle id
the 64 bit version had depth too
your code on gh does something that appears to be wrong so I'll just assume that the code in discord is the latest
return texelFetch(image, min(position, textureSize(image, 0)), 0).x;
is this the gh code or the discord code
there should be a minus 1 innit
oh yeah it's definitely wrong on gh 
yuh clearly you knew at some point though lol
just making sure you didn't update it to the wrong thing 
Ah yes the discord versioning system
welp, frogfood is kinda broken in renderdoc but it appears that your change "works" lvstri
I say that because everything renders correctly with these
imageStore(hzb, destPosition, vec4(depth-1));
imageStore(hzb, destPosition, vec4(depth+1));
so I'm guessing culling is broken somehow
but the system for testing culling is also broken 
what does one do when the medic needs a medic
anyways I guess issues will only show up if you have pixel-sized meshlets
my scenes aren't good enough for testing
I tried going really far away from new sponza and it seemed to render fine
but all the meshlets will have been really similar in depth still
I'm gonna schlep now, gn
good
how do you size the meshlet instances buffer
uuh
isn't that too small
to clarify is it really just node count or the worst case count if you were to draw all meshlets of all entities
it's just the node count because I don't expect the scene to change right now
it's a read only buffer
but a single node can have thousands of meshlets
if you have one node with a single mesh you can only draw a single meshlet
it's a weird and experimental (offset, count) system that I sort and search through
the old system was that you have many meshlet instances, typically more than meshlet count
i dont understand
when lvstri says he needs to write exams... secretly helping opi in the shop
The popular pizzeria "Ivo a Trastevere" is located in Trastevere, Rome. Every day it is packed with locals and tourists. If you want to go there, I recommend you to go early on a weekday evening.
The pizza master there, Francesco, has been a pizzaiolo for 60 years! Enjoy watching them work energetically and happily.
π Ivo a Trastevere
π Locatio...
do you mean all meshlet counts of all nodes added up?
yeah that's how I originally did it
I also reverted the changes so pretend I never said that 
what do you do now?
i simply have a may
max
if its exceeded meshlets get dropped
I also have a max, but I think if it exceeds that things just break horribly
I don't have a max but I should add one
back to unity fun
I have just now realized that the graphics.blit is wrong
again
it first takes the camera's image (RGBA16F) and then blits to a random RGBA8_UNORM image
then in the second pass, it goes from RGBA8_UNORM to RGBA8_UNORM, so I guess that's the default?
but if I specify a render texture myself, I get "No cameras rendering"
which is all very fun and intuitive
sorry for the constant ot talk but
i also picture LVSTRI whenever he talks, with the voice of Civvie
no idea why, but its what its
me doing unity is off topic too 
im not worried, the solution will come sooner or later π usually after you schlepped
#justunitythings
it doesn't fucking work either
it's literally doing random draws
?????????????????
First it tonemaps, then it draws the main image, then it does it again to the main camera's temporary buffer then it draws nothing to the secondary camera, draws MORE nothingness to the secondary camera and copies this to the swapchain
I gotta send this capture
Why do you need to suffer with Unity ?
I'm trying to learn what a game engine actually is so that I can build my own
(I have never written a game in my life)
I see, then it's a good idea to look at Unity and then do the exact opposite
that is exactly my plan 
carry on
I mean to be fair, if you're trying to see how Unity works, this is very much not a normal situation or how the engine is meant to be used
I'm looking at their public rendering API but yeah that's fair
at this point I think it's not fruitful to look any longer and just do my own thing to be honest..
this is beyond horrible
if i had money, and this was some cock fight, and lvstri was a cock π id put my money on him, with all this
nonsense he be doing
me petting my cock
the unfortunate part about looking at the existing game engines is that they have decades of cruft and backwards compatibility
ye
you even get that cruft in any handwoven engine
there is always some static/friend which has access to everything
when it started out as "this will be all modular" or whatever π
clean code and whatnot
very useful unity, thank you
nah this is epic
me: pls don't clear it
unity: ok (he's clueless lmao)
I think I did figure out Unity's ridiculous logic when it comes to this
I am supposed to make empty objects that are children to some camera
hierarchy based association logic π
the last thing I have to figure out is how in god's name I am supposed to blit to the camera
private void OnRenderImage(RenderTexture _, RenderTexture __)
{
Graphics.Blit(SourceTexture, (RenderTexture)null);
}``` mhm
super clear
yea
this is clear abuse of function overloading
or have the camera do it directly
now I get this
which is still pure insanity
but at least there's order within chaos
- RT shader
- Tonemap
- random draw number 1 for some reason
- random draw number 2
- random draw number 3

- draw to swapchain
Are these random draws at full size?
these are all fullscreen draws yea
That's like the Unity equivalent to slowDownAndWasteMemory.
btw whatever the hell unity is doing with colorspaces, it's wrong
first is my current renderer, second is unity
but I am explicitly disabling automatic sRGB conversion
oh
maybe I need to disable it some more

hidden settings as usual
Note that the ability to turn off sRGB writes is not supported on all platforms (typically mobile "tile based" GPUs can not do it), so this is considered a "feature of last resort". Usually it is better to create RenderTextures with appropriate color space flag (linear vs sRGB) and not switch the conversions in the middle of rendering into it.
gee unity, I wonder why I'm using this "last resort" did you think about that?
who knows really
it couldn't be that your shit is completely broken
day 3 of unity, still getting unreasonably angry at this
renderdoc is just crashing now
so unity must be doing some megacursed shit
What is the quest you are pursuing with unity?
understanding how an engine works
and then doing the exact opposite of what unity does because it is truly the most unintuitive experience possible
Hmm hmm I see, it is good to know what not to do yeah
now I'm getting stuff that is wrong on my screen but correct in renderdoc 
I usually have the opposite this is very sus
Try Bevy π
Have you done this with Godot?
the espionage mission? no
does it even have an ECS based system, the espionage mission with unity was mainly about learning what the hell entities/components are
I have 3 goals:
- Learning what an ECS is and how it's used in a real engine;
- Learn what an engine actually is and how it enables devs to make games;
- lose sanity
Reminds me that I still want to read game engine architecture
I really should get back into nightly reading
ah yeah
that too
I should also look at elias' engine as well
that'll come after the unity missionβ’οΈ
What is Elias' engine?
Bevy litterly uses ECS for pretty much everything. The entire engine is ECS based xD.
That's fair. Bevy dosent require a ton of rust knowledge, but if you want to read the engine internals that might get tricky.
Lots of type magic in the ECS library itself, but using the ECS library sidesteps out the lifetime stuff that makes rust tricky to most people
Up to you, happy to help if you want to try it
I'm not interested in how to make an ECS (yet), I'll be using entt anyways
maybe I'll NIH one just because NIH is cool, but I won't use it 
ecs is really simple
you have columns which are components
you have rows which are entities
so it's just a graph?
the hard part for me was figuring what should be what component
but
in the end I use a hybrid
between ecs and something closer to what source did
so I'll not shill my solution
but consider this: the more you use unity, the more you use it
the more you use it, the more better Γ engine we get
Smiley face engine
I think I might just pivot and go read GEA
It won't teach you how to make a unity clone btw
It provides insight on how one might implement various systems within an engine, but not how to glue them together
That glue is a massive 'missing' piece if you expect it to be like a tutorial
yeah I didn't expect it to be like a tutorial
the glue is something I gotta figure out myself by bikeshedding in #engine-dev
It is a good book though, just watch out for the oldisms 
elias found mentions of OGRE lmao
I think it was written before unity and unreal were viable options
I should be able to spot oldisms
so
Unity is absolute garbage but I'll try sticking with it for a while more
I also got digital GEA
finally, I'll try making something on my own
with zero rendering, just an ECS and GLFW
(And by stealing everything from my engjne
)
real
My ECS is a meme, though
I donβt store anything contiguously
Re-reading GEA was kinda disappointing to me. Like, it has good ideas and food for thought, but itβs too high level and glosses over many things
I now consider Game Coding Complete to be the best gamedev book
I can share how my ecs works which is simple and (apparently) could be faster than entt for iterating over components and adding and removing components
but it might require overcommit/swap to be enabled 
sure thanks a lot
ye so generally it's like entt, but
component stores are just a normal array + bitset (with counter thingy to make iteration over sparse bitsets fast)
so entity id is (index, generation) pair
and index is right into the component store as is
no dense[whatever] stupid indirections
ah cool it's a sparse bitset
it's not sparse
it's just fast to iterate over
it actually consumes MORE memory than a normal bitset
e.g. 100000-bit bitset would normally eat like 12.5 kiB, right
in my case it apparently consumes... 12.51 kiB

but yes
(these are paper numbers)
fair enough 
anyway
the important bit is that component stores are just literally T arr[big]
and are indexed using arr[entity id.index]
(and entity id is index, generation pair)
no extra indirections
so another thing is uh
I have a component that's basically "any" type
that's where e.g. my guns and players live
you iterate over entities with that component implementing some interface
and poke that interface
this isn't used by all things I want to express, just by guns and players and some other one-off logic stuff that doesn't really feel nice to make a dedicated component for
so components are then used for communication between systems
(e.g. velocity and other physics-related stuff, for communcation with physics, etc)
yes
yes
well
no
I don't have bullets just yet
only rockets and grenades
and those are individual entities yes
for guns that fire bullets, I'm moving towards physical bullets and they'll be entities too
makes sense
@wicked notch where are your shaders? I need to steal some macros 
π
one way you could slightly improve this is by putting the binding indices into a header that is shared by your C++ and GLSL code
but tbh you'll never change those so who cares 
do your exams end on the 2nd or something
ah, then gob will finally allow you to use it π
next exam is on the 19th so I have a lot of time to procrastinate
btw are you gonna be at vulkanized 
no :(
(I am not
)
understandable
we can still enjoy the many fruits of their labor
but no getting to meet some of the froges here
Frogalized when
there will be one talk and it will be about vsm
No. The one talk will be "Soul vs soulless: you VILL accept it"
I thought that was going to be in EDcon
A bunch of confused older men will show up to the talk
I'm too stoopid for Vulkan, though :((
you can benefit from shady too 
no you just filter yourself from it and use everything worse instead
you could be using vulkan right now
gob banned me, friendship ended
i can make him unban you
"make" 
i chose the word wisely
Nah, it's okay. He usually got extra mad at my takes, so now I can shitpost in peace
This is a form video, meant to send this message to whomever you wish.
Please do not speak to or try to contact me in any way.
must be an old video : )
only 4 billion people, or his people counter was an uint32_t only
it's very old
non-Y2K compliant video
ah indeed 17 years
it's old enough to drink
back to bikeshedding a bit of nanite
there's a hard LOD cutoff at some point for some reason
my guess is that the simplifier fails to do anything and therefore it just grabs the edges with the lowest error until you get to 128 triangles
(this is always about nonsensically disjoint meshes)
unreal does that too but there's a smoother transition between glued vertices
I think that's good enough
question about mesh hashing.Are you using it just to check if user tries to load same model twice or its for internal model meshes, so you dont need to parse same meshes twice?
uhhhh
is this my code?
oh wait maybe this is the old Iris
this code is wrong btw 
yeah try not to use anything from old iris
those were dark days of mine
this is the master branch
,where is the "new one"?
im just curious,i wont use that of course
https://github.com/LVSTRI/Retina here but still try to use this as "what not to do"
lots of wayy smarter guys in this discord you can take examples from
especially for model loading
im too stupid for vulkan) + i can optimize it a bit later
wait until lvstri stumbles upon std::mdspan
if you're smart enough to read random github code, then you're smart enough for π ±οΈulkan
I tried it, got gltf loading,object picking...But amount of information you need to keep in head is too overhelming for me,at least right now
thats a c++23 thing and we wont live long enough to see it being adapted
You probably didn't adopt the Good Subset of Vulkan #1095247179213439046 message
mdspan feels like valarray all over again
in which terms they are "gone"?
somebody created a fork with a new level of abstraction?)
no, it means you literally don't have to use them, or you only need one of them (e.g. the descriptor stuff)
dynamic rendering removes render passes and framebuffers
fences are superseded by timeline semaphores
descriptor stuff is greatly simplified by bindless
sounds good,but not convincing enough)
hehe
vulkan will not solve uv mapping though
god fucking damnit are they annoying even for processing meshes, not only for artists 
is that for nanite
yeah
sounds difficult
spatially close vertices may have UVs that are the exact opposite of each other
Maybe don't merge those vertices with some heuristic
adding connectivity triangles also sounds impossible because how do I figure out new uvs
yeah..
and then the simplifier shits itself
imma see what UE does
Maybe you could put this as a to-do and just average the uvs or something in the meantime
if you could point me at some repo - that would be great, cause some of the code snippets i see...Not in a good quality
or if you prefer c# ... i know a guy
std::list my BELOVED
I saw your repos all over github).sadly not my fav language
oh wow 
unreal straight up says "nope, fuck it I'm not doing this"
it doesn't even pass the foliage through the same pipeline
it's straight up missing
holy shit this is trippy 
drugs
I'm back to bikeshedding a bit of nanite
thankfully context switches in LVSTRIOS are cheap
ah oki
am I tripping or is damaged helmet a connected mesh
how is foliage rendered? just with the non-nanite poipeloine?
the one in bistro is yes
but there are tree megascans that render just fine with nanoite
o
probably because leaves in those trees are made up of 5 trillion triangles 
ok so it must be failing some heuristic to be nanite-ified, right
ye the heuristic is if glm::squared_distance(v0, v1) - glm::squared_distance(uv0, uv1) >= 999999999999999.0f then give_up();
anyways damaged helmet is disconnected
do the artists (need to) know that nanite is going to be used or was that one of the selling points that Γ will just deal with whatever the artists pastes into the scene the same way?
It Just Worksβ’οΈ
- Unreal
except when it fails hard 
: >
what's "connected"
the thing to the thing
the dual of the mesh does not contain islands
I do be doing that
make buffer
that was my follow up
I guess filling the buffer is equally difficult as filling push constants
vkCmdUpdateBuffer my beloved
yo momma having lots of debug buffers
I already got trolled by opengl's limit (and that was per namespace, so more than 16 in practice), never again
the 99 bottles of beer game
alright next question
pretend that push constants is function arguments
you wouldn't have more than 32 function arguments
perchance
push a pointer to a chungus thing instead
alright that's reasonable
well that's what I was gonna do already lol
a pointer to a buffer with my 3000 arguments of allah
@wicked notch what's the deal with this "public" API
https://github.com/LVSTRI/Retina/blob/master/Shaders/Bindings.glsl#L63-L77
is it just to look nicer
ye
it do be
thing is the "private" API is supposed to be a little more clamplicated
but I got sidetracked by nanite
ye like I said
are you using AS descriptors π€¨
ok ur aware that you can use AS bda instead
I'll change it soon
right
yes
ok cool
yoink incoming
remember to use bda
I'll actually make one more additional change and do the paged staging buffer thingβ’οΈ that devsh has
duh
so that we can be freed from vkCmdUpdateBuffer
cmdMemcpy
I'm gonna do gigabytes of updates with vkCmdUpdateBuffer
I hate cmdbuf memory management being magic tbh
give me BUFFER_USAGE_COMMAND_BOOFER
I can't believe they call this a low-level api
I rely on it for my tringle 
think about it
literally just memcpy bro
you wouldn't want glNamedBufferSubData in your pristine vulkan code would you
vkCmdUpdateBuffer is not glNamedWhatever tho
it's literally jsut vkCmdCopyBuffer with storage inside cmdbuf
which is cringe because you can bloat your cmdbufs into oblivion and you can't shrink them or reuse that storage transparently and accurately
but I'd need a staging buffer or {re}bar don't I
pain, literally intractable amounts of management
you can just keep that memory be in sysmem
or yes rebar
tbh what would really be nice is if we could do cached | coherent mappings of VRAM
tbh you'd still need to control bias
so there would be penalty still
but yes it wouldn't be terribly slow to read on host at least
You can bind the staging buffer lifetime to the command buffer and destroy it once it's executed
I could do it smarter tbh, I'm just lazy and don't want to write more code
I mean better than tying it to the cmdbuf
for this case I'm updating the whole buffer (which contains a vec4 or two uint32s) every frame
Ah I see
the epic thing would be the paged staging allocator that devsh has
Is that really needed though, feel like it's just bikeshed
so make fixed staging buffer of 128MiB and allocate slices, then tie the lifetime of the slice to whatever you want and schedule a transfer
(don't let him know I said that)
it's very comfy to use
imagine trying to upload 65mb of object uniforms and devsh's uploader thingy said no
What is the advantage of this over just creating staging buffers all over and just cmd cpying like it's the 90s?
the magic is that it schedules multiple transfers if total_data >= 128MiB
not having to create/manage those staging buffers yourself
you know cmdbufs can report errors too
vkCmd stickies an error which you get at vkEndCommandBuffer
hmm
you just report + crash on any error
that's a random fact
anyway I now want cmdbufs with transparent memory management π
Hmm well daxa has its own allocator thingy so we don't really need to create them either, but it gives more context
so the driver calls my code to get more memery, and when cmdbuf stops being busy I can reuse all of that memery
i stopped counting all the "you can do x" when the context was vk π¦
because it means you can do x in 20 variations, and everyone tells you something different π¦
wym we always tell people to do bindless 
do bindless and noting else
makes the binding circus ultra easy and simple
I love giraffics
yes, you 2 do
oh it's based on Lumen
wtf
AMD basically improved on lumen (a lot)
it all comes back to sdfs though
unless I want to raytrace
(I don't)
i am getting this one recommended again as well : > https://www.youtube.com/watch?v=NoTUzzmxPo0
This talk presents an engine rendering pipeline for Activision games with particular focus on geometry pre-processing, merging and preparation stages for various rendering modes.
Part of SIGGRAPH 2021 Rendering Engine Architecture in Games course, for more about the course, see http://enginearchitecture.realtimerendering.com/2021_course/
There...
for some reason i want to make f+, deferred and potentially vizbuffer renderer, render the same shit
and switch between them to show some numbers of how shit/good they are compared to the others
but someone stole my T and V to do anything grafics related atm : (
huh
I don't reccomend it. It's very fiddly and hard to get good quality with, and wayyyy more complicated than just doing ReSTIR. I'm moving away from it for a reason.
ReSTIR is deceptively easy imo. The hard part is denoising and the GPU scene mangement and everything else.
You could use SDFs probably
why are modern techniques all using some variation of radiance caching instead of restir then 
what are the drawbacks of restir
You want both. ReSTIR for the final gather, and then an irradiance cache for multibounce so you don't have to path trace everything after the first bounce. And the irradiance cache often uses ReSTIR itself in world space.
yeah I was just looking at the paper for GI-1.0 and they do ReSTIR too
what did you mean by "just doing restir" then
surely SSAO + SSGI + two level cache + ReSTIR is better than ReSTIR alone?
you have all these juicy heuristics you can throw at the problem
also, do you have anything on the jump flood algorithm for constructing SDFs
kinetic and potential energy
so K and U then 
Here's my current GI plan:
- ReSTIR GI for the first bounce
- Spatial-hashing based irradiance cache
- Sample direct lighting at cache points via ReSTIR
- Sample indirect lighting from other cache points via ReSTIR GI again
- Look into this paper for merging the cache bounces with the first bounce https://wangningbei.github.io/2023/ReSTIR.html
thank β€οΈ
ReSTIR DI = Direct lighting (what lights to sample from at a vertex)
ReSTIR GI = First bounce indirect lighting (what other vertices to sample from at a vertex, where you get the indirect lighting at that second vertex either through then tracing towards a light directly, or via a cache)
ReSTIR PT = Using ReSTIR GI to trace whole paths, where you perform ReSTIR GI at every single vertex in the path essentially
ReSTIR PT is very expensive, much easier to use ReSTIR GI + some kind of irradiance cache for multibounce
So the full path looks like this:
Camera -> GBuffer pixel (raster or RT) -> Primary vertex (vertex chosen via ReSTIR GI, irradiance taken from the cache at this vertex) -> Sample direct lighting at primary vertex / sample indirect lighting from other cache entries
iirc, I might've missed a vertex somewhere, but you get the idea
SSGI/AO is an option. You'll have to see if you want it or not.
There's also been some improvements using short-range SSAO to guide the ReSTIR spatial heuristics, in addition to using it for short range shadows ReSTIR misses
sdfs are actually not that scary
except for memory consumption but that's easily solved with streaming
64x64x64x2x4096 is 2GiB already 
where 4096 is number of loaded meshes
im ok with you targetting cards with 12gb of vram : )
ill just leave this here https://github.com/b0nes164/GPUPrefixSums
https://www.youtube.com/watch?v=pr8HaIaZfpk
this one feels like potrick explicitly coerced his activision boys to upload this 
Render graphs have become an established way of handling the complexities of synchronization, memory allocation and scheduling for modern rendering engines. In this talk weβll cover our task graph renderer, paying particular attention to the design of the engineer facing APIs, as well as some of the backend implementation details that allow us t...
good talk
i cant believe that so many unity postprocessing effects are literally jsut placing a rectangle in front of the camera to get the fragment shader invocations on the screen
WITH THE MVP MATRIX!!!!
what are they cooking
i will make a unity shader that places suzane in front of the camera to do post processing
it's crazy
no amount of tech debt can make you write something like that
how do you make it the right way though?
that's not the only thing
they do MVP multiplication so it's basically a world space quad in front of the camera
and they use a tiny vertex buffer for it
it's so ridiculous
my small brain can't comprehend (local to world) sdfs
I need the bounding box of every local sdf
transform it to world space
and then just store the sdf at the grid locations that result from the world transform
and also scale the distance function by the scaling factor of the model matrix
I would also need a cell size of scene_box.extent * 2 / grid_size (vec3)
but this feels wrong somehow
and also calculating the scene's bounding box isn't exactly trivial 
I guess I could do it on the GPU though
yeah it's just a classic parallel min/max reduction problem
I'm still wondering about jump flooding this
do I really need the sign
However, the global illumination algorithm can use other methods for ray casting as long as the method returns the hit point of a ray.```
deccer I need some intel
who can I pester for SDFisms
anyone who successfully implemented SDF shadows or GI?
hmm
sdf shadow... Tear mayhaps? i might mix him with someone else
but do you remember that scene of some postapocalyptic scene of some towers
with POM going
its either Tear or AllMight i think
they might be doing SDFisms too
otherwise, ask the question in questions and ill @ here the frogs for you
it's alright
I'll pester them myself after I tried this stuff
it's quite sad that there's so little info on SDFisms out there
boop me if you need to coerce people to react to your question
Godot has done sdfgi
indeed
i believe there w as some conversation here about it, mayhaps thats what i remember π
There's two versions though. Check their GitHub, they have a completetlt new/different GI impl, that iirc is still sdf based?
Can't quite remember the details but I'd check their GitHub
Godot's sdfgi looks like butt
#1128020727380054046 message
I made my first project with it to test the gi
I'd say so
You need to do PT from each probe to get irradiance
Then you just interpolate between probes
damn
The ray count can be adjusted, but overall it should be way lower than 1rpp
You can still use SDFs or BVH for DDGI. Godot's is based on DDGI and even has Morgan's references.
ah epic
The probes are just sampled during the shading
makes sense
Ye but for the RT you just trace the scene as usual
yeah so it's basically useless for me to accelerate the scene
Think of the probes as an irradiance cache in world space
I still need sdfs 
Yes, you can populate the probes however. Sampling them is completely separate except for the visibility term in DDGI IIRC (which can be moved to tracing or sampling). ReSTIR, whatever Godot does nowadays, etc.
I'm looking at implementing DDGI to prepare myself for #1142751596858593372 which I'm skill issuing at right now.
will you use SDFs
I always start with SDFs and then my Cornell Box renderer graduates to a Sponza renderer.
how do you plan to merge multiple SDFs into one for tracing
Want to make sense of the first link here if that's relevant.
This is actually what I'm trying to figure out right now aside from memory concerns.
SDFs are slow and hard to update.
yeah I saw that first thing, it's magic
epic
yea I'm not even considering memory
at this point it may be less memory consuming to make a bvh over tringles 
you can call those "damns per sample" then, lvstri
I want to see what Godot is doing since they moved to H-DDA or something, H I believe is hierarchal.
I really like ROMA and it feels nice and intuitive as well
but I can't figure out the tracing step
all these people who want this GI stuff on mobile... is weird
you basically just voxelize a mesh and build an "occupancy map" (that stores who knows what
wait I don't think you even need voxelization
Someone explained it to me, but I didn't write it down. Will have to hunt them down again. 
please do

ROMA has a spatial resolution of 128^2 and a angular resolution of 8^2.
resolution is low so I assume it's just a bitmask of touched texels?
I'll just read the paper tonight
Our brain cells combined.
It rounds to zero unfortunately. IQ is below room temperature.
I'm afraid we might be going negative 
i shall be standing on the negative side of 0 and keep you guys away from entering < 0 space
Few months ago I was browsing github for renderers and I found one with sdf gi. It might be worth looking into
https://github.com/Gaukler/PlainRenderer
this madlad computes the sdfs on the cpu 
What about computing SDFs via a BVH?
I just noticed the title of this says "array".
I first misunderstood this as a single 2D slice.
Since that's what I naively see here.
he also on the server @ Gaukler
ye you expand the occupancy map by rotating it in N directions
Radiance Cascades were very meh in 3d when I tried them. Way too finicky. Might make sense as a secondary cache, but for the final gather I'm switching to ReSTIR.
btw jasmine, do you have some more detailed info on the "cache" part of radiance caching
is screen space cache just a texture?
what about world space cache?
In what context? Just radiance caches in general, or a specific technique/impl?
They have both several layers of caching. The screen probes (probes placed at world positions based on the screen's gbuffer pixels) are reprojected where possible between frames, so that's a form of a cache
And then there's additional world space caches. Lumen uses basically DDGI, so the same kind of kf probes as the screen cache, but higher resolution, sparser probes.
It's probes all the way down
Lumen also uses a third cache in texture space, where they form "card" meshes that are basically flat surfaces projected onto a mesh, and they cache lighting in a texture set on that mesh as well
it's always just a 3d texture though innit
Gi-1.0 has the same screen probe cache as lumen basically, and then for their world space cache they use spatial hashing (a giant parallel friendly hashmap where you divide the world into hash cells)
Idr off the top of my head
Basically the idea of radiance caches is that path tracing is too expensive and very incoherent
So you usually have some form of world space cache that stores lighting at different parts of the world, and then you can ray trace from the screen and hit those points, and lookup the lighting without tracing further bounces
So for instance you do ReSTIR GI, and then at each ray hit, you ask the cache for the lighting rather than tracing N extra bounce rays
And you have an extra pass somewhere that goes over every active cache cell and traces rays to update the cell lighting, usually direct light sampling, and optionally sampling from other cache entries to approximate multibounce.
a cache miss just means you have to trace the ray though right?
No, it means you get 0 light from the cache, but then you mark the cell as active so it'll be updated next cache update pass
Well, that's one way of doing thinfs
Iirc kajiya does it a bit seperatly? Where they raytrace, note down the hit cells, have a second pass update the cells, and then a third pass read the results and continue from the first paas
So, that's also an option
Idk what the original paper would be
I want some more details because some of it is going way over my head 
rip, do you have any samples or stuff I can look at
But recent renderers that use the idea:
- Kajiya (clipmap)
- Lumen (DDGI + texture space cards)
- GI-1.0 (spatial hashing)
- RTX DI (DDGI, neural net)
The GI-1.0 paper is a pretty good intro to the idea imo
Basically you start by building a path tracer
But then instead of recursive bounces, you read a cache entry for the first bounce hit and trace 0 extra bounce rays
And then you have a pass to update the cache entries
That's it. How you split up the cache, update it, etc is all up to you.
DDGI, clipmaps, and spatial hashing are all popular schemes
updating means tracing rays?
Updating meaning computing lighting at the cache entry, which yes usually involves tracing rays from the cache entry point
The traverse research blog post on their GI impl is basically what I'd recommend. The RTX DI+GI SDK has other tweaks that are slightly more advanced.
Np. Happy to answer questions if you have more. I'm starting my (4th attempt) GI impl soon, just revamping my whole scene manager CPU-side code for setting up light buffers and textures and such first π
Just use reflective shadow maps (with VSM of course
)
No don't do that, rasterized lighting is bad and cursed
I'll send you slides from my Vk talk
If you just want shadows
the goal is GI
but ye do send slides
all vulkanized talks are epic
also you piqued my interest
@wicked notch when you have a chance, you should join the GPVM server. We are discussing meshlets in there and I need your help
#related-servers message
sure thing
so I read ROMA
but I can't figure out what the tracing gives me other than anyhit
ROMA only stores visibility info, where the hell do I get position info?
Almost done with my scene setup for RT
The last real task will be building the light buffer :/
aight that's enough research on SDFisms
it's time to context switch once more
this time, inspired by potrick, I'll be cooking up some heavy duty debug tools
what happened to your vsm thing from september in wip... where you renderethed powerplant
that looked good enough
The worm needs fresh food
no I don't
I've been doing java
every time I write a try catch block, my sanity drops by one
it's currently at -
9223372036854775808
nooby java or full swing and spring boot bs?
I love exceptions
so I delegated all the UIisms to my mates
javafx was making me feel basically depressed
thank god this is the first and last time I have to ever write java in this shitty degree
I only have 4 exams left
you will make it 
it's been a long road but we're nearly home boys
~~let's not think about masters and doctorate degrees now
~~
Hijacking your thread, this is Jasmine-dev now
Finally finished my GPU setup for raytracing! π https://github.com/JMS55/bevy/blob/solari4/crates/bevy_pbr/src/solari/solari_bindings.wgsl
To be fair, this is nearly identical to how it used to be in solari3 om the GPU side, except now lights are a flat list of sources for better sampling, and and cpu code is much saner.
javafx, my condolences
are you sure?
I think, I tested extensively
hmm
when downsampling mips get rounded down, how do you deal width the edges
youd have to sample 3 into 1 in these positions
I just retested, if I make the hzb be like the next power of two I can't see artifacts
my english just broke
yea i do
not subtle
massive
if you have teh wrong screen size it can ignore half the depth map
and non po2?

non PO2 is cancer 
first time seeing "non po2" in the wild lol, instead of "NPOT"
a simple idea i had was to simply make it power of two in the first downsample
read 3x3 in first level, min it and then write to a po2 image
that would make the image much larger
Whatever I did seemed to have worked for me
Not a problem, you can always start at mip 1
true
i think i grew a new braincell today
VRS is "just" a "better" "MSAA" a "MSAA++" if you will
you are correct
in cod we actually do vrs with MSAA
oh yeah I've heard about that, on consoles you have access to the underlying data in msaa textures
hooo, never thought of it like that
you also do that in vk
there's fmask amd ext
but I think they've made significant changes there in rdna3+
man writing a thesis is boring
my supervisor didn't even let me know if the topic is good but I assume it is 
it better is : )
leak topic π₯Έ
but yeah writing it is pain, I delayed it for super long and then had to push through it in like 2 weeks
rest my little slimey friend
therefore I shall collapse on the bed
this kills the frog 
Mister LVSTRI you have some experience with gltfpack right? Is there a way to make it not put primitives into one big mesh?
it didn't do that for me 
do you mean it's combining primitives?
what scene are you trying?
yeah it creates few that are normal with like 4-5 primitives each and then like three giga meshes with like a 100 primitives each
yes
hmm maybe it does do that for me but I don't care
man I should really put my gltfpack fork on github
this is bistro, imported as FBX and exported as gltf from blender
you can try the -km flag
ah the -kill me flag?


