#Fwog and co.
1 messages ยท Page 7 of 1
btw fast method to get stable luminance is to write ln of luminance and generate mip chain to 1x1 then do exp on the pixel
this gives you geometric mean which is insensitive to small very bright spots
and vice versa
yeah I did something similar to that when I implemented auto exposure
I think though one could get fancier and compute both means and fine tune by lerping between them
hows that working
I was hoping for a verbal overview
I'm trying to rember
basically the idea is that you take the log of the luminance of each pixel, then adds it to a bucket (each bucket is an atomic int)
there are e.g., 128 buckets
the 0th bucket corresponds to the minimum allowed exposure or something, and the 127th bucket corresponds to the highest exposure
then you have another pass which sums all the buckets together and computes the exposure
you can use a parallel reduction in shared memory to sum the buckets, or you can use a 1x1x1 dispatch (which I do, since it's super cheap anyways)
https://github.com/JuanDiegoMontoya/Gengine/blob/master/data/game/Shaders/calc_exposure.cs.glsl
I think this guy uses a similar approach
https://bruop.github.io/exposure/
I am actually reading this rn cuz your explanation doesn't make sense
the 0th and 127th bucket part specifically
it's an optimization prolly
in my impl, the user can set a min and max allowed exposure, which corresponds to some luminance values
just a compute version of the mip reduction
except you also compute averages per some bucket assigned to a tile
and then reduce this set of averages you got from buckets and stored in a histogram
mip reduction would be more wasteful I guess since it reduces in a 2x2 tile at a time
GPUs can chew more pixels per workgroup
I guess one nice thing about the histogram approach is that you get more control over the influence of each range of luminance values
btw one thing I'm kinda struggling to understand with compute shaders is that there is a local size written in the source
I think I spoke with dot about my approach at length when I wrote this last year
but the size at which it would operate efficiently varies between hardware
you can even obtain those in vulkan
the subgroup size?
the subgroup size is just 32 on all nv cards
is it?
the ideal dimensions to use for image processing is either 4x8 or 8x4, I can't remember
on older AMD cards, the wave size is 64
RDNA+ can switch between wave32 and wave64 depending on SC heuristics and whether a driver engineer has forced a mode for your pipeline
it could be a million things
finding the ideal workgroup size is just trial and error
awesome, I love it when you can't calculate shit
the use of shared memory here has some implications w.r.t. scheduling
a large workgroup means you can maximally leverage shared memory, but it also means more sync
and some gens might not be able to retire waves that finish early, I can't remember precisely
tl;dr you gotta profile
there are some good heuristics you can use though
e.g., always use a multiple of 64 threads in a wg
it might have been a coincidence that 8x4 performed best for a tracing megakernel
it's possible that a workgroup shape like that can access memory slightly more efficiently
definitely more efficient than 32x1
maybe slightly more efficient than 4x8 due to how textures are laid out in memory
I don't think that texture locality has a say in here
if I was rasterizing then maybe
maybe it's better for ray tracing because the fov changes less over the x axis than the y axis, meaning the rays are more coherent
ray tracing simply destroys coherence beyond primary rays
well, the fov doesn't change
it was a megakernel so there were all the bounces in a loop
wavefront is less brutal
mainly on register pressure though
it rekts bandwidth though
ye but it's a beneficial trade it turns out
if you have more than 1 material I anticipate gains
it depends beyond that
if you have lots of divergence I anticipate gains
because it orders every aspect of the ray tracing such that there is almost no wasted work
wavefront rt uses much more bandwidth than megakernel rt though
that's true
bandwidth is far from free
UE has a feature to enable a wavefront rt-like thing and it's not enabled by default because it's not automatic perf gains
I'm not sure if the feature is public, might be an AMD-only thing 
can't find mentions of it by name on google, so I'll refrain from discussing it in further detail
looks good on my 160p monitor!
I need to fix the depth rejection heuristic still
it ghosts a lot less for me at 60hz when I lower phi depth to 0.1
๐ฆle scenes like this work at 16x16 upscaling
it looks good still, final output that is
it looks horrible in geometrically complex scenes though
ah
watch
i only noticed the blocks at the last few secs on the right
i see
who needs trees
maybe
that means different complexities need different settings?
2x2 upscaling looks okay in this scene
besides true PT
a little flickery, but probably solvable with TAA
SVGF also struggles with high complexity scenes because the spatial filters aren't very effective
ah
I think I'm basically done implementing stuff for this
now the code just needs to be refactored to be readable
yes after tonemapping
it's not as hard to add as GI and clustered shading but is a good thing to have in a real time renderer

phunky
was this always a thing
no
something broke along the journey?
I'm trying to fix the depth weight by comparing world space positions
I messed up badly
iirc they compensate depth with motion vector z
something like this?
d1 depth from previous frame, d2 also depth from previous frame but reprojected and compensated
d reprojected is reprojected depth from previous frame 
objects have no motion in my thing so I think it's okay
motion vectors include motion of the camera
or rather objects that move relative to it
ye but I'm comparing world space pos in the weight
rather than view space pos
so it should be stable even if the camera moves
you're not comparing depth?
I'm trying something new
should have went with motion vectors right away tbh
even if there is no motion in the scene
adding motion vectors requires effort
I don't think it would have changed anything since I have the previous viewproj matrix
well yeah you normally keep previous transforms but you don't have to since there is no motion, otherwise it's next to none in terms of effort to add
it's a diff between mvp*p and mvp_prev*p
2hard4me
you could use procedural motion like vertex-animated foliage with motion vectors
yeah once stuff starts moving I'll be forced to add them
but rn I don't have to
ok I just realized that comparing positions for the weight is dumb
well, it sorta makes sense for reprojection
but for the filters it makes 0 sense
changing your distance to the surface will change the blur width
you feeling froggy, punk?
i try
i like it ๐
ye p nice, except for the yellow light's thing, thats a bit jarring
the cubicle volume thing looks also quite cool
you mean the fog cube?
no one dares to diss the fog cube
it really do be
// Fog cube.
d += 1.0 - smoothstep(0.0, .25, sdBox(wPos - vec3(3., 2., 0.), vec3(0.75)));
or perhaps fog cubes are more common in that part of the US where u be
i have not encountered them yet
papa bless
can't believe you didn't even question the realism of having a fog frog
a volumetric frog, if you will
thats called faith
faith in frogity restored
The frog is consuming me 
damn boi the giraffics ๐
you pushed upscaler?
oh yeah you did
deccer should bench it
there might be noticeable gain in perf
to division?
you can fix it yourself real quick
i dont even know which shader file it is
ah wait
when i hit debug, callback will tell me
^
there is no word about "upsample" in the code
there's a word about upscale
illuminationUpscaled
No
i walked upstairs after i typed in the thing, and fell asleep
Frogor
: )
I think I just had a revelation from this talk
https://youtu.be/2GYXuM10riw?t=266
maybe
what if I stored incoming radiance + its direction instead of irradiance
then I can sample and denoise radiance at low res and later shade at full res
man, it actually sounds plausible
ah, it's not radiance + direction that they store, but an 8x8 probe per pixel
that makes a lot of sense
using a radiance cache means you can get specular indirect for freeโข๏ธ even
I wonder what data structure they're using to adaptively place probes like this
maybe it's just N textures of increasing resolution
the technique seems ๐ฆle until you get to this
but now it is ๐๐ฆ๐ฒ๐ต๐ฑ๐ฎ๐จ๐ ฐ๏ธ๐งธ
that right there is a modern art masterpiece
I also found this technique which might be interesante (pdf included)
https://www.nvidia.com/en-us/on-demand/session/gtcsj20-s22699/
I just realized that the direction for the radiance probes is only necessary if you want specular
I think I can split the pixel light calculation into two parts then
basically, the radiance part (the light bouncing off the first surface and the distance to the next surface) and the surface part (light bouncing off the second surface to the eye)
then I can denoise radiance, which is probably much easier than denoising illuminance
it should take the normal weight out of the denoising equation
@shell inlet do you have any thoughts on my recent ramblings?
I don't understand a thing
is what I'm thinking
denoising radiance sounds especially incomprehensive
maybe you mean irradiance
radiance is like 1 direction only
tl;dr: store incoming light and denoise that
my terminology with light units is bad
but yeah I guess it'd be irradiance since we care about all directions
A spectral radiance measurement expresses radiance as a function of wavelength or frequency. In contrast to radiance measurements, irradiance is the radiant flux received by a surface or the flux that is incident on the surface. The irradiance unit is determined as power per unit area.
shit this sounds even less intuitive
ok so radiance probes store radiance coming from several directions
but I only care about the light coming from all directions for diffuse
ok when you use cubemap for specular you can call the cubemap radiance map
cuz 1 direction tells you how much radiance is there for it
seems okay
you can integrate it to get irradiance
like what deccer did recently
that would be irradiance map
so which one you have
irradiance
I think radiance probes would work great for adding specular to RSM, but it seems extra complex since you need to store "all" the possible incoming directions of light (lumen just uses 8x8 oct encoded probes)
But irradiance seems like a trivial extension of what we currently have
It's like demodulated albedo 2.0 in how it simplifies denoising
I still don't get the full picture of what you're describing
radiance probes is like, render scene to a cubemap around some position
with direct illumination or whatever
So the original ComputePixelLight function has two dot products, but only one depends on the normal of the surface we're looking at
irradiance probe would mean you already integrate that map also with some brdf
Forget I said the word probe
It's in screen space still
It's just storing illuminance at each pixel
I mean irradiance
light going into the pixel (which represents the surface element) from all directions
The difference is that you put the brdf, which introduces noise, at the end of the pipeline
surface element ๐ค
ignore that term too 
okay
I stole these ideas from this talk that I linked earlier
https://youtu.be/2GYXuM10riw?t=266
are they only computing irradiance at sparse points in screen space?
and then interpolate?
They're computing radiance and putting them in screen space probes
But radiance is harder because the incoming direction matters for the brdf, so each probe is 64 values instead of 1 value
yeah that is basically a mini cubemap, well half of it
and with different mapping also probably
exactly
Yeah, I suppose so
but also they are using ray tracing and generate rays on a hemisphere
while rsm generates samples on a surface
how are you going to cache the radiance, especially since you don't have visibility, so many points may overlap each other along same direction
well I'm not actually planning on using radiance cuz it seemed too hard
like what you saw in the screenshot of my brute force rsm specular
you could see the wall right through the box
because some samples landed on a wall and some on the box
irradiance is a single value on the other hand, and works fine for diffuse as long as you have a shrimple brdf
this may be a fitting thing to try for when we make ray tracing in fwog
is this a question
I forgot to put the > before it
I like the ambiguity, however
I'm gonna try my irradiance idea tomorrow since it seems really easy to add in my head
I'm less warm on the specular idea after you reminded me that leaking exists 
I'm just curious how you're gonna cache the radiance
or are you talking about something different?
I'm not going to cache radiance
I'm just gonna move part of the brdf to the end of the pipeline and then comment out the normal weight in the denoiser
Ok then I'm talking about something slightly different
The part where you calculate the pixel light
it was 2piR^2 but 1/pi brdf made it 2R^2
I'm going to move one of the two dot products
you were mentioning the geometry term cos_src*cos_dest/dist^2
move where? both cosines depend on ray direction
not on the outgoing direction but incident direction
which is unique per sample
We're literally already computing the irradiance
The function is even called that 
ComputeIndirectIrradiance
So then the only other thing is radiance probes for specular, but that'll suck because 1) sampling specular RSM sucks, and 2) light leakage
sampling surfaces sucks in general
rsm uses surface estimator
I tried to make it directional but it doesn't really work without visibility term
and we can't even properly remap between a direction and a rsm texture to begin with
I guess the only thing that might improve RSM now is the hierarchical adaptive sampling idea in that talk, but I don't even fully understand it
my idea was to generate random point on a hemisphere with some distribution, project that to rsm uv and then compute the metric tensor of the transformation to integrate irradiance still using surface form but it's too hard to derive
yep
The sampling is probably perfect then
Ignoring the possibility of creating a structure from the RSM
like in LPVs
I think it's possible to use resampling for RSM
but I'm not gonna think about that now
resampling is essentially a numerical way to refine samples to better match integrand
I see
It sounds like you need to take extra samples though
Or do you refine it temporally?
well it depends
RIS afaik needs more than one sample but ReSTIR can exchange them spatially
wait maybe RIS can also go with 1
I need to re-read the paper to answer that
it's not a hard thing, it's explained in one paragraph in ReSTIR paper
its super smooth now ๐
1 sample works also for RIS
ye, it looks better than I'd ever expect after seeing the og version
here have a totally out of context equation
What's f(y)/p(y)
integrand over target distribution
And what's w(x_j)?
I forgor
I guess the whole thing in parentheses is expected value of w
start with section 2 and in 2.1 it's explained
there is one error in their terminology in original restir paper however
I gotta sleep but I'll try to remember to read it tomorrow
they're calling some function a pdf while it clearly doesn't satisfy the conditions of being called a pdf
it's more like a weighting function if anything
cuz for resampling you don't need a function that integrates to 1
only some function to correlate your samples against
I'm the kind of person to call some weighting function a pdf
I was tempted to ask you if w here is the pdf
idk where to write this but apparently min() function is also a form of mean
here I was trying to see how would each mean behave (we talked about means and autoexposure recently)
kinda seeing the trend of each mean going lower, and turns out there is a generalized mean and minimum is some special case of it
ยฏ_(ใ)_/ยฏ
maths
maximum is also a mean
mean as in evil?
poe's law doesn't let me decide whether you're legit or joking
so haha and also as in average
: )
i wasnt sure about your min is mean thing earlier hence the question, but now i know
so anyways maybe harmonic mean is even better than geometric mean for autoexposure
it only involves divisions as opposed to natural log and exp
maybe even faster? Is log and exp slow on GPU?
harmonic is literally reciprocal of a sum of reciprocals times amount of reciprocals
and seems to be affected even less by tiny bright lights
needs to be tested on some real images I guess
trying to say this outloud makes me suffer
clamplicatedd
throwback to last night when I forgot that diffuse illumination is not view-dependent
haha wrong
but I am nitpicking
yeah yeah I know a real diffuse brdf has view-dependent parameters
microfacets and shiz
no I mean lambert is just constant that's why it's independent to anything
any other brdf you'd find is not a constant
e.g. even oren-nayar
it's not necessarily a microfacet brdf, but it was fitted to real world data to add roughness
I think lambertian may be the only one like that
I will make another
yes double lambertian brdf 2/2pi
in terms of fwog, I think copying vulkan for the formats was a bad choice
e.g., stuff like this R8G8B8A8_UNORM
I'd rather write RGBA8_UNORM
memory barriers are also slightly annoying, but I don't see a way to fix that outside of a full-blown dependency graph
maybe I could do something simple
actually nah it would immediately become not simple
it's explicit which isn't bad
just kinda difficult to read sometimes lmao
R8G8B8A8 is really bad because every single character has similarities
just make an rpsl backend
idk what that is
RedEightGreenEightBlueEightAlphaEight_YouNormalizedIt
AMDs new Mantle 2.0 shading langauge
oh meant to reply to jaker ๐
eh not really
i tried to be funny here, emphasis on tried
remember someone told that this meme will die shortly after someone suggested the emoji
well guess what, not on our watch
what's next for fwog?
c l o u d s
non-euclidean rendering
non-photorealistic rendering
non-virtual rendering (going outside)
no rendering (miserable life)
clustered volume rendering is next
What would you like to cluster
maybe jaker adds some SFX next
apparently fwog thread has the most messages out of all
Since I'm at a good spot to get some rest
I'll spend it wisely
By cloning Fwog and adding stuff
Yes this is a good way to spend my time
what are you gonna add
atmospheric scattering example?
nope, never implemented any
aight, I'll do some research then
but I've heard UE one is the best out there
maybe outdated info
this maybe
#graphics-resources message
the only one I found in #graphics-resources
that cant be true ๐
no reason to apologise
my not apologies
: )
checked it out, this is not for real time...
I hate how they don't fix the code samples on this site
what's more some of them have invisible unicode characters
I remember long long time ago I had fun time due to me copypasting shaders, nvidia does a little trolling
Amazing
was watching a talk when it mentioned this enhanced-performance bilateral filter algo
https://people.csail.mit.edu/sparis/publi/2007/siggraph/Chen_07_Bilateral_Grid.pdf
jesus local tonemapping looks cursed
I read a thing about it once, but forgot everything
https://bartwronski.com/2022/02/28/exposure-fusion-local-tonemapping-for-real-time-rendering/
btw today I had an idea in my dream
remember that extended reinhard has white point value that tells up to which point to compress the highs
literally revealed in a dream, nice
I dunno
sometimes both averages can be really close though so I guess you'd need to clamp the value
or maybe if the difference between averages is so tiny then the image's contents is not really detailed
the idea surely came from my research on generalized mean aka power mean
I gtg to bed, but I'll be back in 7-8 hours to read the rest
I'll have to study the extended reinhard thing a little too because I just copied your function without reading it carefully
I posted graph and my thoughts here^
which one, luminance scaling only version?
I think so
it's ez, same reinhard except multiply each channel by same factor
ok, so you're talking about something else now
1 float value of luminance instead of RGB
and the luminance you get by dotting with a vector that basically contains how sensitive human eyes are to color components in terms of luminance
here updated the thing and included power mean
can use a really high power to get upper white point that is not absolute maximum to still have some overblown parts, plus tiny bright lights will definitely ruin stability with maximum
this means a lot
is this for finding the mean luminance for auto exposure?
one could be fore the luminance, another for the white point
so that both are adaptive, not just exposure but also tonemapper
like you'd use geometric or harmonic to find average luminance to use for autoexposure
and cubic or quadratic (or arbitrary power) for white point
since those are above arithmetic mean but still below maximum
so you'll have some blown out parts that will make bloom shine
if you take maximum as your white then reinhard will compress hard
and won't have any noticeable bloom
this is again just an idea to try out btw it's not from somewhere
I'd like to do it myself but I am in college jail
I see
are you gonna make tonemapper in fwog?
if you add basic one with autoexposure I might fork and experiment with it
working on something from scratch would be too time consuming for me
I might add it as a new example or maybe cram that into the gltf viewer as well
But don't hold your breath
I saw that they use tricubic filtering for the fog volume in ghost of Tsushima
I might copy that
tricubic filtering ๐ค
bicubic but 3d
yeah, just one function
just gotta apply the tricubic in the final pass where you composite the fog into the scene
you're raymarching via sphere tracing I guess?
it's marching through every cell in a 3D texture
talking about this
the in scattering and transmittance are calculated and stored in a 3D texture which is trivial to apply to geometry on the screen
you just convert world space to 3D texture space and sample
kinda
Trilinear filtering has obvious artifacts, but tricubic does not
37 minutes in
https://youtu.be/GOee6lcEbWg
The whole talk is ridiculously packed with info
At the end they talk about tone mapping and exposure
I am now gonna watch tonemapping section
should go into #graphics-resources at some point ๐
I think it has too much info lol
A lot of it went over my head
It is interesting though. It covers a lot of topics
I guess what I'm trying to say is that its information is not super accessible
here's the presentation
with links and all
funny they also use desmos
oh hey they use white balance
pretty cool
didn't know it's actually used in games
their white balance doesn't seem to be balancing the whites tho
it's "artistic"
Cube Map Shadow Tracing ๐
maybe you should start some project on top of fwog where we could put all advanced stuff in
@long robin
like an air plane dog fight game, where people fly around in sponza and moana island
nah just a renderer would do imo
a game will take time away from graphics
jaker been saying fwog examples are getting big and suggesting me to create a project but I already have a project
ye
a compromise would be a separate renderer
a renderer for different situations
one for your indoor only game, one for your mmo openworld one, one for your side scrolling pure 2d sprites
your naive deferred renderer, and something more complicated with all sorts of effects, for "true" physical goodness
to show off techniques and how to use fwog
or something like serious-sam tech demo world, which would show off different effects in various rooms
i mean its something else for a change
and it doesnt have to be implemented in 2hrs, all those things ๐
Making a separate project with all these advanced renderisms seems like a decent idea
wtf they actually embedded a desmos graph into the presentation
yea lmao
can go to desmos page too if you click logo in the left right corner and play with it there
it would be cool to load HL2 maps (or Source maps in general) and view them in a newer renderer
idk how complicated .bsp files are though
might be feasible to load .vmf files instead, idk
ugh writing yet another loader would suck though
maybe there's a .bsp -> model format converter out there (then I can just convert the model to gltf in blender)
this seems clamplicated
https://developer.valvesoftware.com/wiki/Source_BSP_File_Format
seems like most point lights get completely baked into the lightmap and have no other representation in the bsp
I'd rather just load gltfs and forget about these oldisms
but half-life architecture is super super boring
ugly textures in low res
harsh transitions between faces
use AI upscaler 
I mean what can you expect from a 2004 game that's trying to look realistic
elderscrolls stuff is probably cooler
and the game is practically still 1998 ๐ from the looks of it
the thing with hl2 is that it's obvious how it can look better since it's attempting realism
: )
i shtronkly disagree
but would be cool nonetheless, HL3 renderer made in fwog
I think HL2 with the latest PBRisms and GIisms would look cool
you might be able to f ind some hl inspired models on sketchfab, or even exports... hmm i wonder ๐
Use Sketchfab to publish, share and embed interactive 3D files. Discover and download thousands of 3D models from games, cultural heritage, architecture, design and more.
would be cool to run around in these as well not just fly
could add some physics library to the new renderer
jolt seems shrimple to add compared to physx
physx makes me want to die whenever I integrate it
could never figure out the cmake incantation required to summon it, so I ended up building it and copy-pasting the dlls/libs/headers myself
: )
maybe i could invest some braincells into the cmake-template-thing of mine, and see how physx could be integrated
someone posted a cmake snippet once, but I forgor to save it
indubiousedly
Undeviously
unequivocally
unschleppingly
also time to schlepp my ass over into my cave to work on the things i wanted to work on
just wait until rtx remix is out
people already mod the shit out of portal to get hl2 and stuff running on top of it
ask sultim ๐ค
indeed
if someone can manage to find hl2 sources where you can rewrite graphics code then maybe but I talked with sultim and neither him nor me could manage to do so
it probably requires premission to access a private repo or something
hl1 has an open source port of goldsrc called xash3d which is what he's using to get rt into hl1
https://www.youtube.com/watch?v=Uea9Wq1XdA4 could you implement something like this with plain opengl fwog
This talk delves into real-time global illumination approaches based on Surfels designed by EA SEED and EA DICE, and it's a part of the SIGGRAPH 2021 Advances in Real-Time Rendering in Games course (http://advances.realtimerendering.com/).
Global Illumination Based on Surfels (GIBS) is a solution for calculating indirect diffuse illumination i...
ah then it was here where i read "surfels" in the corner of my eyes recently
i also like the rocky scene in the background of the thumbnail
on second thought you can
but radiance caching part will be very suboptimal
it's always about optimal sampling when it comes to irradiance
surface integral that rsm uses is the biggest problem
muh better than
I don't think so, not without visibility term
you can throw RTX on as much as you want at HL2 it will never look better than this
compared to the rocky thing in the background of the thumbnail
it's already ray traced
except it's baked
and only 1-2 indirect bounces
not sure how many exactly but not much
probably just 1 cuz there's no saturation
more than 1 bounces give saturation and you actually can see it in source 2 lightmaps
https://cdn.discordapp.com/attachments/707034102343139370/855428933993889792/unknown.png
https://cdn.discordapp.com/attachments/707034102343139370/855428972823969793/unknown.png
https://cdn.discordapp.com/attachments/707034102343139370/855429004172984351/unknown.png
https://cdn.discordapp.com/attachments/707034102343139370/855429028348428339/unknown.png
https://cdn.discordapp.com/attachments/707034102343139370/855429051170029568/unknown.png
0 to 5 bounces, last one is 128
you can see saturation increase with each new bounce
i see
also the reason why multiple scattering in brdfs give saturation
but i was also just refering to the uglyness of source worlds ๐
the last frame is quite "red"
compared to the previous ones
it's red and beautiful
unfortunately not suitable for real time
sometimes I think that irl is surprisingly shadeless and flat
and old games with primitive shading looked way more realistic on old crts than games from 200X
but maybe it's increase in resolution that makes stuff look more obviously artificial
funny thing I thought about
what if during rsm indirect estimation you check if sample is on screen and if it is you add its contribution from previous frame
feedback loop from screen space for multiple bounces
wait that's not gonna work if we sample in rsm space, what if we sample in screen space though, disregarding visibility (again)
but that's like extra cursed probably
so like 1 rsm sample and 1 sample in screen space from previous frame
Maybe I misunderstood this line though
I see
fun fact: teardown does not have contact-hardening shadows, but you can trivially add them with the glsl editor in renderdoc
#extemsiom GL_CONTACT_SHADOWS : enable
I'll pay you a dollar if you write an extension spec for that
a zimbabwean dollar (rare and exclusive currency)
how?
by distributing samples?
so someone mentioned pcss maybe worth trying out first
before you do the other one
the author of that gamedev.net article does not know about bilateral filters
nvm, they do, but for some reason only mention it in the checkerboard upscaling part
hmm, is there a ๐ฆle way to add an email to all my previous commits on github?
it probably falls under changing the author of those commits
gh kindly provides this script that I'm afraid to run
https://web.archive.org/web/20200823163529/https://docs.github.com/en/github/using-git/changing-author-info#changing-the-git-history-of-your-repository-using-a-script
why do you want to do this? pretty drastic
bruh reddit silver's value has depreciated, now I need like ten of those to feel sufficiently validated
inflation
@long robin clone your repo into a new folder, run the thing there, check if it werked, do the same on the real one, push force
did it work?
I was wondering why my program was immediately closing
auto appInfo = Application::CreateInfo{.name = "Volumetric Fog"};
auto app = VolumetricApplication(appInfo, filename, scale, binary);
return 0;
I frogor app.Run();
anyways, the volumetric ex๐ฆle has been refactored now
exshrimple 
i like it
fog color needs color
I'm going to bed rn, but if you pull you should be able to change the shader that controls it. Here's the line
https://github.com/JuanDiegoMontoya/Fwog/blob/examples-refactor/example/shaders/volumetric/CellLightingAndDensity.comp.glsl#L152
Link plox
we talked about it back when but jaker ignored it for some reason
I must've been on mobile if I didn't click it
good excuse
allez dodo, we bikeshed this later
what the... is this a rainbow
hehe thats cool
also somehow fog doesn't seem to absorb (and/or out-scatter?) light
I'd expect some darkening both due to out-scattering and absorption
but maybe there is some of it and the in-scattering seems to be the greatest contributor to the fog's appearance
maybe I'm wrong, the maths needs to be checked to make sure, but I'm not going to do that
Yeah, the sun light doesn't get absorbed at all
But the only way to add that would be to make it an approximation
Like assuming it traveled through a constant amount of fog or something
It's a fogbow 
I can try experimenting with hardcoded optical depth for the sun light or somehow estimating it
I could make a separate scattering volume for the sun, but that means doing everything twice basically
honestly not sure how sun is different than any other light source
must be something implementation related, because in rt it makes no difference what your light source is and where it is, it's all just radiance and visibility
the problem is that it's harder to approximate scattering for the sun compared to local lights
for local lights, I just presume that the fog density between the light and the point in the volume is constant
yes
by "constant", I actually mean based on the density of the point
the math is probably completely sound
https://github.com/JuanDiegoMontoya/Fwog/blob/examples-refactor/example/shaders/volumetric/CellLightingAndDensity.comp.glsl#L78
anyways, that approximation is okay for local lights because the participating media density probably won't change all that much between the point and the light
well but this is obviously a cut corner
remember that the density is only stored in a screen-aligned froxel grid
tracing a ray from a point to the sun or light won't work if the light source if off-screen
this is view space?
what is?
the technique, if it's aligned to the screen
as far as I understand you mean there is no info outside of the view about fog density
yes
but you have world space sdfs
why don't you also use world space density
why does it have to be in a grid
I dunno what world space density is
well you have a sdf which is a function right
also this isn't only using SDFs for density
function of world space position
so why don't you have a density function of world space position
hmm
I could sample some of the density functions in the direction of the light
that would help
but not always
in which case it's not?
you could inject artist-made density shapes into the volume, hypothetically speaking
you can compose them with the function
by overriding or lerping and whatnot
or adding
you can compose anything with functions
Like if you author an arbitrary 3D shape in a modeling program and want your fog to have that shape
are we on the same page?
I mean, this arbitrary 3d shape is still a map
be it a 3d texture or also a continuous function
you can have it in world space
true
and access it regardless of what you're looking at
I was thinking you might have an arbitrary number of them. But then again, I'm only using sdfs and noise for the fog so lol
so what I'm talking about is
float density_map(vec3 world_pos)
{
//compose all shapes by adding densities
return texture(your3dsampler, (vec4(world_pos, 1)*inv_your_shape_matrix).xyz) + density_continuous_function(world_pos);
}
you can then march through this, and you can also do same with sdfs, but it's more finnicky ig
Yeah, I get you
alright
I can probably fix it 2nite
maybe it's more expensive than the screen space grid approach?
I was also thinking you'd need to check borders of the volumes stored in textures, but maybe you can just set clamp to border and write zeros to borders
It won't change the grid, it'll just be taking extra density samples between the grid point and the light source in the first pass (the shader I linked)
(I didn't read the shader)
np
It's just calculating density and lighting for each cell in the volume
The stuff we're talking about will affect the lighting
I need to do homework, unrelated to the discussion but I was working with SQL and yet again, as usual, I ended up googling "SQL sucks"
instead of googling actual things about it
lmao
I took an SQL class and barely understood a thing
the query syntax made me want to die
what makes me die is that it has a million dialects
and different software that uses it, that you have to also learn
I only had to learn how to use MySQL stuff (I think) when I took it
I guess part of the reason my SQL (pun not intended) class sucked is because the prof was just reading off slides in broken English in all the lectures
no surprises, education is shrimply broken worldwide
but my situation is unique though, although I can learn at my own pace, I just hate web related stuff
I had web classes for my last 1.5 years (due to beer virus) and those sucked
but at least I could sleep between classes every day
well tbf some of the profs made a decent effort to make their virtual classes interactive/tolerable
I was in a class with my friends and we would troll each other by writing obnoxious text-to-speech messages in discord while they were speaking in class
lol
fun fact: there is no way to turn down the volume of TTS in discord
damn tts is disabled here, I was gonna try it out
i have tts disabled too
any updates?
unfortunately I started playing Valheim again yesterday and can't stop
my to-do list:
- fix light scattering
- run that one git script
I added extinction for sunlight
By marching from the sun to the point and accumulating density
I tried doing it for local lights and it's way too expensive since I have to do a march for every light
unless the cloud volume was just a bunch of minecraft sized voxels
I still need to think about the math for in-scattering of the lights, but it shouldn't be too bad
i like it
those kind of things i also need later somehow
for local nebulae
or debris fields of sorts
Hehe I wonder if mieplot can do space debris
So you can generate an accurate phase function lut
maybe after i added some "physicsisms" we could check ๐
Driving through fog right now (as a passenger) ๐
Today the ground was snowy and foggy while it rained
I guess snow+rain=fog
sublimation, clearly 
tyl?
Subliminally conscious
superluminal conscious
I haven't even watched die hard this year 
xD
my dad made a tree ornament of it. I gotta show you a pic
bruce willis' german voice fits him much better than his original
I like how the characters just walk away at the end of that movie
dont they do that in all of them
but tis a good idea to watch all of them again, minus 5th one, that was crap
Idk I only saw the og one
WAT
The first one
what did I do wrong
heh i thought you did a marathon, watching all 4
nein
ungeheuerlich
Are 2, 3, and 4 good?
3 is my fav
2 is like 1, just at the airport
4 is a little bit modern
but same principle, takes off shirt, vest is white at the beginning, movie ends, vest is pitch black ๐
Continuity fail
๐
since you know your way around in die hard
ill call you Argyle from now on
man the audio is really fucked
when they sit in the limo, it sounds like they talk in an echo-y room and not driving in a car
another funny thing with these old 60s/70s/80s/90s movies or series
you ALWAYS hear footsteps, as if they dubbed that for some reason
foley or whatever that is
nice, how's it looking on the nightmare now?
once I'm back on my PC I'll show
The effect isn't super obvious when you're in the fog on that scene
there should be visible extinction from everything
like if you look at a wall the radiance coming from it should also be attenuated with distance
and there also should be radiance coming from the sky
but I guess I am asking for too much from an approximation
btw nobody stops you from sampling lights stochastically, tho it'll be noisy (tho x2 you can sample more than one per pixel)

I'm sampling the lights per frustum cell btw
That should be accounted for already
Since I store accumulated density from the cell to the camera in the grid
I'm kinda accounting for sky radiance with a hacky approximation (basically constant ambient term)
leaking my beloved
but ye that's how it be without rt
tbh even with rt there is a lot of leaking if you use biased restir
in realtime apps
I didn't notice any in portal rtx they must be using unbiased restir
or maybe they don't ๐ค
can't tell tbh because sometimes in disoccluded areas shadows disappear
like on ultra perf dlss
maybe that's just what disocclusion filter in relax does
they do use relax in rtx remix
Wait how does light leak in RT
restir spatial reuse + no visibility check
Hmm I thought it was just reusing a sampling direction or something (I actually know almost nothing about restir though)
when you take samples from neighbors and ignore if they are occluded or not for the pixel where you gather them at
That sounds like a spatial blur
restir gi reuses path vertices
I see how that could cause a leak
ye same path may not be valid for other pixels
so you have to trace a shadow ray to check
but it's obviously expensive
now the frog actually occludes the light somewhat
you can see it under the frog here as well
hey that's pretty good already
I wonder what causes fog to look like it's glowing
there is visibility from primary source
and also absorption now
you might not even need in-scattering ๐
wait maybe it's the in-scattering from the sun? ๐ค
the volume needs to be a bit more caustic, its too artivisual looking
There are local lights that make it look like it's literally glowing if that's what you mean
You mean the volume is too uniformly dense? Otherwise I'm not sure
yep that
It is using simplex noise for density, but it's hard to tell when you're inside it
ah
I can try increasing the scale and amplitude to make it obvious
schrimplex being too schlepplex
tbh
i didnt even notice any simplex patterns
it looked like a unit cube filled with uniform smog of sorts
There is a unit cube and simplex "ground fog" that fades away as you go up
excuse my inaccurate use of terms (t)here
shrimplex
you should totally leave it animated, or at least optionally so
it was always animated, just hard to tell because the fog density was more uniform
also TIL about iChannelResolution in shadertoy. I always used textureSize ๐
doesn't look like cubic filtering to me
looks like smoothstep hack
I showed you some time ago
that ghost of tsushima talk (I think) mentioned an optimized tricubic function, only requiring 16 taps or so
not 4?
maybe it was 4
wait no 8
either way, it was fewer than 64
like it's 4 in 2d, but add dimension and maybe it's possible to use just 8
8 taps
btw here's the part in the video
https://youtu.be/GOee6lcEbWg?t=2223
he do say 8 taps
tricubic do be looking a lot blurrier
