#Fwog and co.

1 messages ยท Page 7 of 1

long robin
#

u need both

shell inlet
#

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

long robin
#

yeah I did something similar to that when I implemented auto exposure

shell inlet
#

I think though one could get fancier and compute both means and fine tune by lerping between them

long robin
#

except I also used buckets

#

to make a histogram

shell inlet
#

hows that working

shell inlet
#

I was hoping for a verbal overview

long robin
#

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

shell inlet
#

I am actually reading this rn cuz your explanation doesn't make sense

#

the 0th and 127th bucket part specifically

long robin
#

I'm trying to remember

#

ah

shell inlet
#

it's an optimization prolly

long robin
#

in my impl, the user can set a min and max allowed exposure, which corresponds to some luminance values

shell inlet
#

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

long robin
#

I guess one nice thing about the histogram approach is that you get more control over the influence of each range of luminance values

shell inlet
#

btw one thing I'm kinda struggling to understand with compute shaders is that there is a local size written in the source

long robin
#

I think I spoke with dot about my approach at length when I wrote this last year

shell inlet
#

but the size at which it would operate efficiently varies between hardware

#

you can even obtain those in vulkan

long robin
#

the subgroup size?

shell inlet
#

yeah

#

on most pascals it's a 4x8 tile iirc

#

but turings are bigger

long robin
#

the subgroup size is just 32 on all nv cards

shell inlet
#

is it?

long robin
#

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

long robin
#

it could be a million things

#

finding the ideal workgroup size is just trial and error

shell inlet
#

awesome, I love it when you can't calculate shit

long robin
#

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

shell inlet
#

well I guess my assumptions were wrong then

#

today I learned

long robin
#

there are some good heuristics you can use though

#

e.g., always use a multiple of 64 threads in a wg

shell inlet
#

it might have been a coincidence that 8x4 performed best for a tracing megakernel

long robin
#

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

shell inlet
#

I don't think that texture locality has a say in here

#

if I was rasterizing then maybe

long robin
#

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

shell inlet
#

ray tracing simply destroys coherence beyond primary rays

long robin
#

well, the fov doesn't change

shell inlet
#

it was a megakernel so there were all the bounces in a loop

#

wavefront is less brutal

#

mainly on register pressure though

long robin
#

it rekts bandwidth though

shell inlet
#

ye but it's a beneficial trade it turns out

long robin
#

not always

#

it depends on what you're doing

shell inlet
#

if you have more than 1 material I anticipate gains

long robin
#

it depends beyond that

shell inlet
#

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

long robin
#

wavefront rt uses much more bandwidth than megakernel rt though

shell inlet
#

that's true

long robin
#

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 nervous

#

can't find mentions of it by name on google, so I'll refrain from discussing it in further detail

shell inlet
daring surge
#

looks good on my 160p monitor!

shell inlet
#

btw >60hz is cheating

#

for me rsm is very ghostish

long robin
#

I need to fix the depth rejection heuristic still

long robin
golden schooner
#

it looks good still, final output that is

long robin
#

it looks horrible in geometrically complex scenes though

golden schooner
#

ah

long robin
#

watch

golden schooner
#

i only noticed the blocks at the last few secs on the right

long robin
#

unfortunately good filtering cannot create new samples

golden schooner
#

i see

#

who needs trees

#

maybe

#

that means different complexities need different settings?

long robin
#

ye

#

scene-dependent parameters and whatnot

golden schooner
#

ye

#

or could there be a general solution for everything?

long robin
#

2x2 upscaling looks okay in this scene

golden schooner
#

besides true PT

long robin
#

a little flickery, but probably solvable with TAA

long robin
golden schooner
#

ah

long robin
#

I think I'm basically done implementing stuff for this

#

now the code just needs to be refactored to be readable

golden schooner
#

: )

#

then we can finally go to the clustered volume thing

shell inlet
#

yes after tonemapping

shell inlet
#

it's not as hard to add as GI and clustered shading but is a good thing to have in a real time renderer

long robin
golden schooner
#

phunky

shell inlet
#

was this always a thing

long robin
#

no

shell inlet
#

something broke along the journey?

long robin
#

I'm trying to fix the depth weight by comparing world space positions

#

I messed up badly

shell inlet
#

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 smart

long robin
#

objects have no motion in my thing so I think it's okay

shell inlet
#

motion vectors include motion of the camera

#

or rather objects that move relative to it

long robin
#

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

shell inlet
#

you're not comparing depth?

long robin
#

I'm trying something new

shell inlet
#

should have went with motion vectors right away tbh

#

even if there is no motion in the scene

long robin
#

adding motion vectors requires effort

#

I don't think it would have changed anything since I have the previous viewproj matrix

shell inlet
#

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

long robin
#

2hard4me

shell inlet
#

you could use procedural motion like vertex-animated foliage with motion vectors

long robin
#

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

long robin
#

something unrelated to rsm for once

heavy cipher
#

tf

#

the frog

long robin
#

you feeling froggy, punk?

heavy cipher
#

i try

golden schooner
#

i like it ๐Ÿ™‚

heavy cipher
#

ye p nice, except for the yellow light's thing, thats a bit jarring

golden schooner
#

the cubicle volume thing looks also quite cool

long robin
long robin
#

no one dares to diss the fog cube

heavy cipher
#

oh its wildly unrealistic on porpoise

#

nvm then

long robin
#

it really do be

  // Fog cube.
  d += 1.0 - smoothstep(0.0, .25, sdBox(wPos - vec3(3., 2., 0.), vec3(0.75)));
heavy cipher
#

or perhaps fog cubes are more common in that part of the US where u be

#

i have not encountered them yet

heavy cipher
#

papa bless

long robin
#

can't believe you didn't even question the realism of having a fog frog

#

a volumetric frog, if you will

heavy cipher
#

thats called faith

long robin
#

faith in frogity restored

rugged notch
long robin
#

The frog is consuming me frogegreenexcited

shell inlet
shell inlet
#

you pushed upscaler?

#

oh yeah you did

#

deccer should bench it

#

there might be noticeable gain in perf

golden schooner
#

requires shader fixes ๐Ÿ™‚

#

invalid shader operandisms

shell inlet
#

you can fix it yourself real quick

golden schooner
#

i dont even know which shader file it is

#

ah wait

#

when i hit debug, callback will tell me

shell inlet
#

^

golden schooner
#

got it

#

ye

#

10ms unfiltered

#

2ms filtered

shell inlet
#

is there a slider for upscaling feature?

#

I haven't tried it yet

golden schooner
#

nope, not in deferred at least

#

let me check gltf viewer

#

nope

shell inlet
#

is it a default

#

probably

golden schooner
#

there is no word about "upsample" in the code

shell inlet
#

there's a word about upscale

golden schooner
#

oh wait

#

i cant read

shell inlet
#

I already closed git page

#

would have linked

golden schooner
#

illuminationUpscaled

long robin
golden schooner
#

i walked upstairs after i typed in the thing, and fell asleep

long robin
#

Frogor

golden schooner
#

: )

long robin
#

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

long robin
#

using a radiance cache means you can get specular indirect for freeโ„ข๏ธ even

long robin
#

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

heavy cipher
#

but now it is ๐Ÿ†‘๐Ÿ‡ฆ๐Ÿ‡ฒ๐Ÿ‡ต๐Ÿ‡ฑ๐Ÿ‡ฎ๐Ÿ‡จ๐Ÿ…ฐ๏ธ๐Ÿงธ

long robin
#

that right there is a modern art masterpiece

long robin
#

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?

shell inlet
#

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

long robin
#

tl;dr: store incoming light and denoise that

long robin
#

but yeah I guess it'd be irradiance since we care about all directions

shell inlet
#

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

long robin
#

ok so radiance probes store radiance coming from several directions

#

but I only care about the light coming from all directions for diffuse

shell inlet
#

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

long robin
#

seems okay

shell inlet
#

you can integrate it to get irradiance

#

like what deccer did recently

#

that would be irradiance map

#

so which one you have

long robin
#

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

shell inlet
#

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

long robin
#

So the original ComputePixelLight function has two dot products, but only one depends on the normal of the surface we're looking at

shell inlet
#

irradiance probe would mean you already integrate that map also with some brdf

long robin
#

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

shell inlet
#

surface element ๐Ÿค”

long robin
#

ignore that term too KEKW

shell inlet
#

okay

long robin
shell inlet
#

are they only computing irradiance at sparse points in screen space?

#

and then interpolate?

long robin
#

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

shell inlet
#

yeah that is basically a mini cubemap, well half of it

#

and with different mapping also probably

long robin
#

exactly

shell inlet
#

idk

#

very low quality radiance in there, so no sharp specular

long robin
#

Yeah, I suppose so

shell inlet
#

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

long robin
#

well I'm not actually planning on using radiance cuz it seemed too hard

shell inlet
#

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

long robin
#

irradiance is a single value on the other hand, and works fine for diffuse as long as you have a shrimple brdf

shell inlet
#

this may be a fitting thing to try for when we make ray tracing in fwog

long robin
#

yeah

#

when

shell inlet
#

is this a question

long robin
#

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 KEKW

shell inlet
#

I'm just curious how you're gonna cache the radiance

#

or are you talking about something different?

long robin
#

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

shell inlet
#

uhh but the brdf is already constant and is cancelled out

#

by normalization factor

long robin
#

Ok then I'm talking about something slightly different

#

The part where you calculate the pixel light

shell inlet
#

it was 2piR^2 but 1/pi brdf made it 2R^2

long robin
#

I'm going to move one of the two dot products

shell inlet
#

you were mentioning the geometry term cos_src*cos_dest/dist^2

long robin
#

ye

#

apologies for poor use of terminology

shell inlet
#

move where? both cosines depend on ray direction

#

not on the outgoing direction but incident direction

#

which is unique per sample

long robin
#

wait shit

#

yeah I'm tripping hard yo

#

Everything I said in this conversation

shell inlet
#

lol

#

yeah happens

long robin
#

We're literally already computing the irradiance

#

The function is even called that KEKW
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

shell inlet
#

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

long robin
#

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

shell inlet
#

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

long robin
#

I remember that

#

iirc you and criver had a long talk about it with a sad conclusion

shell inlet
#

yep

long robin
#

The sampling is probably perfect then

#

Ignoring the possibility of creating a structure from the RSM

#

like in LPVs

shell inlet
#

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

long robin
#

I see

#

It sounds like you need to take extra samples though

#

Or do you refine it temporally?

shell inlet
#

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

long robin
#

I'd say don't worry too much about it

#

We've been polishing this turd for long enough KEKW

golden schooner
#

its super smooth now ๐Ÿ™‚

shell inlet
#

1 sample works also for RIS

long robin
#

ye, it looks better than I'd ever expect after seeing the og version

shell inlet
#

here have a totally out of context equation

long robin
shell inlet
#

integrand over target distribution

long robin
#

And what's w(x_j)?

shell inlet
#

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

long robin
#

I gotta sleep but I'll try to remember to read it tomorrow

shell inlet
#

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

long robin
#

I'm the kind of person to call some weighting function a pdf

long robin
shell inlet
#

set of RIS weights apparently

shell inlet
#

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

golden schooner
#

mean as in evil?

shell inlet
#

poe's law doesn't let me decide whether you're legit or joking

#

so haha and also as in average

golden schooner
#

: )

#

i wasnt sure about your min is mean thing earlier hence the question, but now i know

shell inlet
#

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

shell inlet
#

clamplicatedd

long robin
#

throwback to last night when I forgot that diffuse illumination is not view-dependent

golden schooner
shell inlet
#

but I am nitpicking

long robin
#

yeah yeah I know a real diffuse brdf has view-dependent parameters

#

microfacets and shiz

shell inlet
#

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

long robin
#

I will make another

shell inlet
#

yes double lambertian brdf 2/2pi

long robin
#

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

golden schooner
#

R8G8B8A8 is fine

#

d3d does something similar

#

imaging libraries do RgbaX isms

long robin
#

it's explicit which isn't bad

#

just kinda difficult to read sometimes lmao

#

R8G8B8A8 is really bad because every single character has similarities

heavy cipher
#

just make an rpsl backend

long robin
#

idk what that is

golden schooner
#

RedEightGreenEightBlueEightAlphaEight_YouNormalizedIt

golden schooner
#

oh meant to reply to jaker ๐Ÿ™‚

heavy cipher
#

eh not really

golden schooner
#

i tried to be funny here, emphasis on tried

shell inlet
#

you tried so hard ๐ŸŽต

#

and got so far ๐ŸŽต

shell inlet
#

remember someone told that this meme will die shortly after someone suggested the emoji

#

well guess what, not on our watch

shell inlet
#

what's next for fwog?

brisk narwhal
#

c l o u d s

shell inlet
#

it has volumetric fog already

#

not very different from c l o u d s

rugged notch
#

non-euclidean rendering

#

non-photorealistic rendering

#

non-virtual rendering (going outside)

shell inlet
#

no rendering (miserable life)

brisk narwhal
golden schooner
#

clustered volume rendering is next

brisk narwhal
#

What would you like to cluster

golden schooner
#

lights ๐Ÿ™‚

#

its on the frog's list

brisk narwhal
#

but that's boring

#

no fancy VFX

golden schooner
#

maybe jaker adds some SFX next

shell inlet
#

apparently fwog thread has the most messages out of all

brisk narwhal
#

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

shell inlet
#

what are you gonna add

brisk narwhal
#

Dunno yet

#

I'll probably find some interesting paper and experiment

shell inlet
#

atmospheric scattering example?

brisk narwhal
#

Oh that sounds nice

#

any reference papers you know of

shell inlet
#

nope, never implemented any

brisk narwhal
#

aight, I'll do some research then

shell inlet
#

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

golden schooner
shell inlet
#

my apologies

golden schooner
#

no reason to apologise

shell inlet
#

my not apologies

golden schooner
#

: )

shell inlet
long robin
shell inlet
#

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

long robin
#

Amazing

long robin
#

ah copying stickers is annoying

long robin
shell inlet
#

jesus local tonemapping looks cursed

long robin
shell inlet
#

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

rugged notch
#

literally revealed in a dream, nice

shell inlet
#

what if we used some another average to get that white point

#

how cursed would it be

long robin
#

I dunno

shell inlet
#

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

long robin
#

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

shell inlet
shell inlet
long robin
#

I think so

shell inlet
#

it's ez, same reinhard except multiply each channel by same factor

long robin
#

ok, so you're talking about something else now

shell inlet
#

1 float value of luminance instead of RGB

long robin
#

ye, shrimple enough

#

aight gotta dip

shell inlet
#

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

shell inlet
#

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

long robin
long robin
shell inlet
#

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

long robin
#

I see

shell inlet
#

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

long robin
#

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

shell inlet
#

tricubic filtering ๐Ÿค”

long robin
#

bicubic but 3d

shell inlet
#

is it like... ok

#

this shouldn't be hard to add I think

#

but you have SDFs tho

long robin
#

yeah, just one function

#

just gotta apply the tricubic in the final pass where you composite the fog into the scene

shell inlet
#

you're raymarching via sphere tracing I guess?

long robin
#

it's marching through every cell in a 3D texture

shell inlet
#

wait hows that working

#

I mean I know how marching thru cell working

long robin
#

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

shell inlet
#

oh sure yeah

#

3d blur kinda?

long robin
#

kinda

shell inlet
#

well filtering

#

blur would be different

long robin
#

Trilinear filtering has obvious artifacts, but tricubic does not

shell inlet
#

it still had visible aliasing with shadows

#

but yeah better than linear

long robin
shell inlet
#

pretty cool

#

from what they shown it is indeed magical solution

long robin
#

The whole talk is ridiculously packed with info

#

At the end they talk about tone mapping and exposure

shell inlet
#

I am now gonna watch tonemapping section

golden schooner
#

should go into #graphics-resources at some point ๐Ÿ™‚

long robin
#

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

shell inlet
#

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"

golden schooner
#

Cube Map Shadow Tracing ๐Ÿ™‚

shell inlet
#

maybe you should start some project on top of fwog where we could put all advanced stuff in

#

@long robin

golden schooner
#

like an air plane dog fight game, where people fly around in sponza and moana island

shell inlet
#

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

golden schooner
#

ye

shell inlet
#

a compromise would be a separate renderer

golden schooner
#

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

shell inlet
#

that'd be quite a task

#

sprite renderer shouldn't be hard though

golden schooner
#

i mean its something else for a change

#

and it doesnt have to be implemented in 2hrs, all those things ๐Ÿ™‚

long robin
#

Making a separate project with all these advanced renderisms seems like a decent idea

shell inlet
#

call it something based on toad

#

to get frog and toad

long robin
shell inlet
#

yea lmao

#

can go to desmos page too if you click logo in the left right corner and play with it there

long robin
#

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)

#

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

golden schooner
#

but half-life architecture is super super boring

#

ugly textures in low res

#

harsh transitions between faces

long robin
#

use AI upscaler smart

#

I mean what can you expect from a 2004 game that's trying to look realistic

golden schooner
#

elderscrolls stuff is probably cooler

#

and the game is practically still 1998 ๐Ÿ˜„ from the looks of it

long robin
#

the thing with hl2 is that it's obvious how it can look better since it's attempting realism

golden schooner
#

: )

long robin
#

so you "just" have to add modern lighting

#

and textures ofc :))

golden schooner
#

i shtronkly disagree

long robin
#

the models would probably have to be remade too

#

or you can just abuse tessellation smart

golden schooner
#

but would be cool nonetheless, HL3 renderer made in fwog

long robin
#

I think HL2 with the latest PBRisms and GIisms would look cool

golden schooner
#

you might be able to f ind some hl inspired models on sketchfab, or even exports... hmm i wonder ๐Ÿ˜„

#

would be cool to run around in these as well not just fly

long robin
#

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

golden schooner
#

: )

#

maybe i could invest some braincells into the cmake-template-thing of mine, and see how physx could be integrated

long robin
#

someone posted a cmake snippet once, but I forgor to save it

golden schooner
#

: )

#

you wanted to try jolt anyway

long robin
#

ideed

#

ineded

#

indede

#

indubitably ๐Ÿ‘

golden schooner
#

indubiousedly

rugged notch
#

Undeviously

brisk narwhal
#

unequivocally

golden schooner
#

unschleppingly

#

also time to schlepp my ass over into my cave to work on the things i wanted to work on

shell inlet
#

people already mod the shit out of portal to get hl2 and stuff running on top of it

golden schooner
#

indeed

shell inlet
#

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

golden schooner
#

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...

โ–ถ Play video
shell inlet
#

ah yes gibs I mentioned it before

#

not with rsm

#

needs ray tracing

golden schooner
#

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

shell inlet
#

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

golden schooner
#

muh better than

shell inlet
#

I don't think so, not without visibility term

golden schooner
#

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

golden schooner
#

i see

shell inlet
#

also the reason why multiple scattering in brdfs give saturation

golden schooner
#

but i was also just refering to the uglyness of source worlds ๐Ÿ™‚

#

the last frame is quite "red"

#

compared to the previous ones

shell inlet
#

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

shell inlet
#

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

shell inlet
#

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

long robin
#

Hmm

#

Sounds orthogonal to the RSM sampling, so more like ssgi

long robin
shell inlet
#

ye ssgi

#

it is orthogonal

#

except ssgi doesn't necessarily use feedback loop

long robin
#

I see

long robin
#

fun fact: teardown does not have contact-hardening shadows, but you can trivially add them with the glsl editor in renderdoc

heavy cipher
#

#extemsiom GL_CONTACT_SHADOWS : enable

long robin
#

I'll pay you a dollar if you write an extension spec for that

#

a zimbabwean dollar (rare and exclusive currency)

shell inlet
#

by distributing samples?

long robin
#

Yeah

#

all the code for generating rays and traversal is right there

shell inlet
#

so someone mentioned pcss maybe worth trying out first

#

before you do the other one

long robin
#

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

long robin
#

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

heavy cipher
#

why do you want to do this? pretty drastic

long robin
#

my contributions chart be looking kinda sparse doe

#

literally the only reason btw

heavy cipher
long robin
#

bruh reddit silver's value has depreciated, now I need like ten of those to feel sufficiently validated

heavy cipher
#

inflation

golden schooner
#

@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

golden schooner
#

did it work?

long robin
#

gonna try it tomorrow ๐Ÿ˜„

#

12/22/2022 4:04

#

(sry for burger format)

golden schooner
#

heh

#

isnt steam sale starting today again

long robin
#

the gabening has arrived

long robin
#

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

heavy cipher
#

exshrimple thonk

long robin
#

shrimple as dat

golden schooner
#

i like it

long robin
golden schooner
#

fog color needs color

long robin
#

it could have color

#

AKA a different albedo

golden schooner
#

a different odebla

#

a tnereffid odebla

rugged notch
#

Spooky froge

#

Did you see that I made an sdf for froge btw

long robin
#

Link plox

golden schooner
#

we talked about it back when but jaker ignored it for some reason

long robin
#

I must've been on mobile if I didn't click it

golden schooner
#

good excuse

long robin
#

Ah btw the frog in the scene uses a different fog color

#

The fogfrog

golden schooner
#

allez dodo, we bikeshed this later

shell inlet
#

what the... is this a rainbow

golden schooner
#

hehe thats cool

shell inlet
#

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

long robin
#

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

long robin
golden schooner
#

thats a frog bow, my frog

long robin
#

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

shell inlet
#

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

long robin
#

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

shell inlet
#

but you said...

#

you can do variable density

long robin
#

yes

#

by "constant", I actually mean based on the density of the point

#

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

shell inlet
#

well but this is obviously a cut corner

long robin
#

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

shell inlet
#

this is view space?

long robin
#

what is?

shell inlet
#

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

long robin
#

yes

shell inlet
#

but you have world space sdfs

#

why don't you also use world space density

#

why does it have to be in a grid

long robin
#

I dunno what world space density is

shell inlet
#

well you have a sdf which is a function right

long robin
#

also this isn't only using SDFs for density

shell inlet
#

function of world space position

long robin
#

it can use noise or any other kind of injected density

#

ye

#

but not always

shell inlet
#

so why don't you have a density function of world space position

long robin
#

hmm

#

I could sample some of the density functions in the direction of the light

#

that would help

shell inlet
#

but not always
in which case it's not?

long robin
#

you could inject artist-made density shapes into the volume, hypothetically speaking

shell inlet
#

you can compose them with the function

#

by overriding or lerping and whatnot

#

or adding

long robin
#

you can compose anything with functions

shell inlet
#

ye so I'm still not understanding the idea

#

missing some pieces maybe

long robin
#

Like if you author an arbitrary 3D shape in a modeling program and want your fog to have that shape

shell inlet
#

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

long robin
#

true

shell inlet
#

and access it regardless of what you're looking at

long robin
#

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

shell inlet
#

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

long robin
#

Yeah, I get you

shell inlet
#

alright

long robin
#

I can probably fix it 2nite

shell inlet
#

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

long robin
#

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)

shell inlet
#

(I didn't read the shader)

long robin
#

np

shell inlet
#

(but I looked at it out of consideration)

#

(and my brain did not process a thing)

long robin
#

It's just calculating density and lighting for each cell in the volume

#

The stuff we're talking about will affect the lighting

shell inlet
#

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

long robin
#

lmao

#

I took an SQL class and barely understood a thing

#

the query syntax made me want to die

shell inlet
#

what makes me die is that it has a million dialects

#

and different software that uses it, that you have to also learn

long robin
#

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

shell inlet
#

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

long robin
#

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

shell inlet
#

lol

long robin
#

fun fact: there is no way to turn down the volume of TTS in discord

shell inlet
#

damn tts is disabled here, I was gonna try it out

golden schooner
#

i have tts disabled too

golden schooner
#

that id stuff is some neat stuff

#

and potti still hasnt noticed

shell inlet
#

any updates?

long robin
#

unfortunately I started playing Valheim again yesterday and can't stop

#

my to-do list:

  • fix light scattering
  • run that one git script
long robin
#

something

golden schooner
#

: O

#

looks like a cotton ball of sorts ๐Ÿ™‚

long robin
#

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

golden schooner
#

unless the cloud volume was just a bunch of minecraft sized voxels

long robin
#

I still need to think about the math for in-scattering of the lights, but it shouldn't be too bad

golden schooner
#

i like it

#

those kind of things i also need later somehow

#

for local nebulae

#

or debris fields of sorts

long robin
#

Hehe I wonder if mieplot can do space debris

#

So you can generate an accurate phase function lut

golden schooner
#

maybe after i added some "physicsisms" we could check ๐Ÿ™‚

long robin
#

Driving through fog right now (as a passenger) ๐Ÿ˜

golden schooner
#

: )

#

you have some crazy weather going on there right now

long robin
#

Today the ground was snowy and foggy while it rained

#

I guess snow+rain=fog

#

sublimation, clearly smart

golden schooner
#

๐Ÿ˜„

#

TYL so to speak

long robin
#

tyl?

golden schooner
#

Today You Learned

#

Tyl is the surname of one of my eve online characters thonk

long robin
#

Your subliminal thought surfaced

#

Subconscious I mean

golden schooner
#

ye

#

i read it as that

#

subcouscousse

long robin
#

Subliminally conscious

golden schooner
#

superluminal conscious

long robin
#

I haven't even watched die hard this year listenyoupieceofshit

golden schooner
#

xD

long robin
#

my dad made a tree ornament of it. I gotta show you a pic

golden schooner
#

bruce willis' german voice fits him much better than his original

long robin
#

I like how the characters just walk away at the end of that movie

golden schooner
#

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

long robin
#

Idk I only saw the og one

golden schooner
#

WAT

long robin
#

The first one

golden schooner
#

i heard you

#

but just the first??

long robin
#

what did I do wrong

golden schooner
#

heh i thought you did a marathon, watching all 4

long robin
#

nein

golden schooner
#

ungeheuerlich

long robin
#

Are 2, 3, and 4 good?

golden schooner
#

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 ๐Ÿ˜„

long robin
#

Continuity fail

golden schooner
#

๐Ÿ˜„

golden schooner
#

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

golden schooner
#

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

shell inlet
long robin
#

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

shell inlet
#

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)

golden schooner
long robin
#

I'm sampling the lights per frustum cell btw

long robin
#

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)

shell inlet
#

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

long robin
#

Wait how does light leak in RT

shell inlet
#

restir spatial reuse + no visibility check

long robin
#

Hmm I thought it was just reusing a sampling direction or something (I actually know almost nothing about restir though)

shell inlet
#

when you take samples from neighbors and ignore if they are occluded or not for the pixel where you gather them at

long robin
#

That sounds like a spatial blur

shell inlet
#

restir gi reuses path vertices

long robin
#

I see how that could cause a leak

shell inlet
#

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

long robin
#

now the frog actually occludes the light somewhat

shell inlet
#

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? ๐Ÿค”

long robin
#

there is no in-scattering from the sun atm

#

er

#

yes there is

golden schooner
#

the volume needs to be a bit more caustic, its too artivisual looking

long robin
long robin
golden schooner
#

yep that

long robin
#

It is using simplex noise for density, but it's hard to tell when you're inside it

golden schooner
#

ah

long robin
#

I can try increasing the scale and amplitude to make it obvious

golden schooner
#

schrimplex being too schlepplex

#

tbh

#

i didnt even notice any simplex patterns

#

it looked like a unit cube filled with uniform smog of sorts

long robin
#

There is a unit cube and simplex "ground fog" that fades away as you go up

golden schooner
#

excuse my inaccurate use of terms (t)here

long robin
#

shrimplex

long robin
#

@golden schooner I hope the noise in the fog is more obvious now

shell inlet
#

cool looks like a wind

#

I like it

shell inlet
#

you should totally leave it animated, or at least optionally so

long robin
#

it was always animated, just hard to tell because the fog density was more uniform

long robin
#

1-tap tricubic filtering

long robin
#

also TIL about iChannelResolution in shadertoy. I always used textureSize ๐Ÿ˜„

shell inlet
#

doesn't look like cubic filtering to me

#

looks like smoothstep hack

#

I showed you some time ago

long robin
#

rip

#

yeah, doesn't seem to actually fix aliasing like I was hoping

shell inlet
#

ye iq also says that in comments lol

long robin
#

that ghost of tsushima talk (I think) mentioned an optimized tricubic function, only requiring 16 taps or so

shell inlet
#

not 4?

long robin
#

maybe it was 4

shell inlet
#

wait no 8

long robin
#

either way, it was fewer than 64

shell inlet
#

like it's 4 in 2d, but add dimension and maybe it's possible to use just 8

#

8 taps

long robin
#

he do say 8 taps

#

tricubic do be looking a lot blurrier

long robin
shell inlet
#

informal fork

#

why not a real fork

long robin
#

I guess the extension I have turns the fork button into fake fork