#Fwog and co.
1 messages · Page 10 of 1
hehe
btw Teardown article is now 95% complete
https://juandiegomontoya.github.io/teardown_breakdown.html
fixed the gamma in the early pics and videos, changed the intro (no more cringeworthy slowpoke meme), and added a bunch of missing content, plus some probably minor changes
still need to finish the bloom section and add a table of contents
inshallah y'all will skim it and hopefully the new sections will catch your eye
this image is giving me a taaneurysm
lel
I just pasted the whole thing into Word and immediately found something I forgor to finish 
yeah the smoke makes some pretty nasty TAA artifacts
quite epic how they are captured in photo mode when literally nothing is moving
wait what
well except for the fact that it needs motion vectors for motion blur 
but it has real motion blur why does it need motion vectors
only some things have real motion I guess
only vehicles seem to do the jittering thing from what I've seen
possibly some other things have it, but I haven't checked
clearly this guy needs to use the transparency and composition mask of FSR 2 for smoke
may just use fsr2
tbh i dislike the mixed smooth-blocky aesthetic, but i think this is due to lack of mc indoctrination on my end
wait does it use it? I might have misread
ok then why not use fsr2
it was released before fsr2 existed for one, and secondly there is no official opengl backend for fsr2 (though I have thought about making one myself)
I would, I'd hate to implement temporal aa and upscaler myself
oh ok makes sense
the opengl thing
if I make the fsr2 backend, I will try to convince dennis to use it
just RIIV bro
what's a riiv
its a joke on RIIR (rewrite it in rust)
the V stands for vuk u
perhamps
I'm going to use vuk btw
vulkan bad imo
or maybe C bad
and vulkan by extension because it couldn't
join the discord when you do
what do you mean I'm already using discord
the vuk discor
link is in #related-servers
yeah idk what for though
martty's vuk server
for the excellent discussion of the GP zeitgeist
tech support from his underpaid indian contractors
maybe asking questions there but if it's so bad I couldn't figure it out on my own then I'll be using raw vulkan instead
it has examples which should be enough to get started
imagine asking questions online instead of reading docs and papers
oh wait that's the premise of this whole server
why read docs when you can have someone else read them for you
society if people could read docs and papers: <insert image of advanced civilization>
society if we would have better form of meme generics than templates
vuk fanclub meetup
lmao
this sounds like something a rust user would say
I remembered I could do that
sorry jaker
so yeah anyways vuk good I imagine
I have never used it but I believe that as long as I don't have to manually put barriers it's already a step towards modern age from stone age
OpenGL users be living in 2023
yeah someone had to invent vulkan and make us suffer
like when newton invented gravity
someone had to counterinvent vuk
Fwog is the antivuk
All I'm missing is explicit sync
or like at least finer-grained
It's kinda lower level in the sense that it doesn't abstract the API as much
if only graphics APIs were designed around principles of surface easy to use API with fine-grained custom stuff added if something really obscure is needed like manual sync
but practically speaking, no
I think that's the idea behind vuk lol
And nvrhi
yeah, unfortunate that openGL doesn't have the hatch to get access to the fiddly bits
but it kinda kills the model
Some NV extensions are kinda like a shitty rusty hatch that doesn't open all the way
opengl fundamentally is stinky with its lack of structure like what vulkan does with structs and individual enums
and multithreading pain
dennis flashbacks
Fwog hasn't solved the multithreading problem, and I dunno if I want to
Basically push calls to a buffer and then submit all at once on the main thread
Delayed error reporting 😢
its a bit ironic that while the MT problem is solved in vulkan, you also don't really need it
except maybe for submitting on a different thread, but thats very coarse
okay, maybe for like uploading shit it still makes sense
I've heard that even if you have multiple queues gpu may still not be able to process them at the same time after submission
nvidia with their 16 gfx queues of meme material
16 queues of Allah
attracting gamers with large numbers
but presumably they are able to understand 16 > 1, which is what matters for marketing
i am joking btw, not sure why they did it this way
in theory the spec says that implementations should not be locking willy-nilly
but that is what you'd call "guidelines"
fun fact: you cannot lock your willy with Fwog 
instructions were clear, willy is free 
I wonder if there's a clever way to expose glTextureBarrier, or if I should just make a simple wrapper (with possibly better naming)
hehe
the answer to the question is the question itself, since you answered it already 🙂
took me a minute to find the fwog thread again : )
i had this open as well https://github.com/JuanDiegoMontoya/Fwog/issues/41
made me smile a little, and reminded me of previous type-safety-discussions
Fwog and co.

I keep looking at this issue but I'm still not sure what the ideal solution is
@heavy cipher does vuk do anything to improve type-safety for images?
no
I imagine it has crossed your mind too though
yes
Tear wanted typed buffers for some time
but baking the format at compile time, not sure how useful that is
your code cares very little if you use RGBA or BGRA
but if you bake that into the type, you have to carry it everywhere
yeah format baking sounds eh, but baking the "class" of the texture (color, depth, stencil) sounds useful
another one is baking the number of components, but that also carries some of the suckiness from the first idea
i don't mind you going onto the minefield first 
How is fwog doing lately
or do you want the api to work on it?
basically this
and the API will use these types, e.g., for render pass info
it's going

mostly just polishing the API at this point and fixing bugs
Yeah makes sense
nothing major left to do
Except write docs and lure in users 🙃
doxygen is nice
The last time I had to generate docs was in college, and we used doxygen
Still works like a charm tbh
its useful wen constructing an efbo i guess
when you want to add a color texture as GL_DEPTH_SHRIMPLE
where the type safety officer should interject
or in glBindXXXUnit situations mayhaps (at least in debug)
I used it only to make a pdf for my assignments. I can't even remember how to do that anymore
I think I'd have to make separate enums for each class of texture
to be part of create_texture_info then?
Yeah
makes sense
But then I'd still want the generic "texture" interface in case something doesn't care
Which means I'd need something more to make these types work
Like a variant
what would a case like that be, where something doesnt matter
Hmm gimme sum types
ImGui::Image() doesnt count
Like if you want to display an image for debugging lol
But yeah can't think of much else
Still, it's a useful feature for that
there are no variants or situations where it doesnt matter what type of exture it is
if the fbo is somehow linked to a fragment shader output, that would be neat
as part of debug-validation-isms
slithglyery different topic tho
dont give him ideas
go stealy mcwheely on my setup
I'd just make a texture class and inherit from it for the specialized ones
Right yeah
I'd have to make multiple create info structs, one for each "specialization"
if you use inheritance, then you can also just use a factory, and just make it multiple factory methods, rather than extending the createinfo
Then the specialized structs would be translated to the generic one
I wouldn't extend the create info exactly
It would be separate create infos in order to enforce type safety
depth stencil create info, color create info..
hmm
I'm still not convinced that this will be super useful
validation layer is probalby a good thing in general
opengl-validation-layer 🥲
at some point we should pick that one up again, was a good start 🙂
it's a big pita though
ye
Yeah kinda :p
another issue I see happening with my inheritance approach is the potential need to convert from generic textures (the base class) to its derived classes. I guess that could be a move constructor with a runtime check
Could be some sort of .cast() on the generic one
not a bad idea
I wonder how that would work without a dynamic cast though
Er, ignore that
the whole engine is not really made with oopisms in mind why start now 🙂
It would basically be a static cast, except textures can't be copied, and reinterpret cast would be fat UB
oopsi-isms more likely lol
Yeah, so you move the handle into the return value
cast() would consume the generic one into a typed one
nah just transport the type via the create struct, bindxxxunit/fbo creation have access to it then
hmm
or use the format already? which you specify anyway when creating a txture?
That's basically an explicit move constructor then
Just more documented in the API I guess
Yeah
Feels kinda icky that a non move constructor function would invalidate the object though
Yeah it's not a common pattern in C++ I suppose
&&
uh std::move(myTexture).cast()
this smells like a comism
to be on the same page i have no idea what is being discussed but it doesn't seem good
very icky, no good, etc.
.cast() seems like a massive antipattern
you know you can override the cast operator
operator DestType() {
...
}```
You could use a &&
DestType cast() && {}
But ye should probably be the cast operator
Can you specify rvalueness on a cast operator :0
i did not realize this was a function declaration
i was reading it as if (func() && {})
disturbed
Yee
man, math has me fucc'd up yo
- "a 2-sphere is an ordinary 2-dimensional sphere in 3-dimensional Euclidean space, and is the boundary of an ordinary ball (3-ball)." https://en.wikipedia.org/wiki/N-sphere
- "A sphere (from Ancient Greek σφαῖρα (sphaîra) 'globe, ball')[1] is a geometrical object that is a three-dimensional analogue to a two-dimensional circle." https://en.wikipedia.org/wiki/Sphere
not to be conchfused with n-balls
- "A 2-ball, a disk, is the interior of a circle (1-sphere)."
- "A 3-ball, an ordinary ball, is the interior of a sphere (2-sphere)."
the real ball torture was in trying to figure out how to simply generate a random direction vector in a cone

by looking in GI compendium
mfw my old renderer that uses c++20 modules no longer compiles (I get an epic ICE)
this one, right?
no the one above it
that's actually the top result for me 
hey thats my university
ive had classes from that professor, hes a good dude
wtf i didnt know this
i gotta ask him next time i see him
the gastrointestinal compendium is quite based
oh
hmm is it possible to introspect the workgroup size of a compute shader
I thought it would be, but I don't see it on the famously accurate ref pages
https://www.khronos.org/opengl/wiki/Program_Introspection
void GetProgramiv( uint program, enum pname,
int *params );
- If pname is COMPUTE_WORK_GROUP_SIZE, an array of three integers containing the local work group size of the compute program (see chapter 19), as specified
by its input layout qualifier(s), is returned
ah I was looking at GetShaderiv 🦐
ref pages
links the wiki
:screm:
eh wiki is much better
actually provides value over the spec
whereas the ref pages is just the spec that someone copied while peeking during the exam
fair 'nu'f'
'
sometimes the wiki has questionable info, but as a learning resource it do be pretty good
ye, sometimes it do be like that
what's going on in the second-to-last line here? it's like it's rotating the basis of the normal vector or something, but I don't have an intuition (all of it was lost after my final linear algebra exam) (code from learnopengl)
vec3 ImportanceSampleGGX(vec2 Xi, vec3 N, float roughness)
{
float a = roughness*roughness;
float phi = 2.0 * PI * Xi.x;
float cosTheta = sqrt((1.0 - Xi.y) / (1.0 + (a*a - 1.0) * Xi.y));
float sinTheta = sqrt(1.0 - cosTheta*cosTheta);
// from spherical coordinates to cartesian coordinates
vec3 H;
H.x = cos(phi) * sinTheta;
H.y = sin(phi) * sinTheta;
H.z = cosTheta;
// from tangent-space vector to world-space sample vector
vec3 up = abs(N.z) < 0.999 ? vec3(0.0, 0.0, 1.0) : vec3(1.0, 0.0, 0.0);
vec3 tangent = normalize(cross(up, N));
vec3 bitangent = cross(N, tangent);
vec3 sampleVec = tangent * H.x + bitangent * H.y + N * H.z;
return normalize(sampleVec);
}
just coordinate space conversion?
I'm only used to seeing it expressed as a matrix-vector mul so I feel 3head looking at this
isnt this just TBN * H
hold on I'm writing this one out
3-head, or ordinary head
according to my math, they are not the same
let me make something presentable
wait nvm I'm a moron
is this literally just a more obfuscated matrix-vec mul
yea
yeah, if im not mistaken this is just mat3(T, B, N) * H
I wrote it out and they are the same in terms of final result
I assume they are the same number of ops (I'll let someone else confirm xd)
definitely after optimization
that conchfusing piece of code has been bugging me for a long time
learnopengl shader code be weird sometimes
but now I'm even more annoyed that it's something shrimple expressed in a different way
found some pretty big brain code that I wrote in an SSR shader a while back
vec3 worldPosition = WorldPosFromDepth(texture(s_depthTex, projected.xy).x, u_viewportSize, u_invViewProjMat);
float viewDepth = (u_viewMat * vec4(worldPosition, 1.0)).z;
if you paid for all those gpu cores, you better use em
texture(s_depthTex, projected.xy).x?
no I mean it's what you can do to get view depth
asking if that's the funny part
that you get view depth from reconstructed world pos using view depth
but also wait isn't it lacking perspective division
that's clip space z
the joke is bouncing between spaces like a football on methamphetamines
the texture is window space depth
window space depth? whassat
hyperbolic depf
if you don't have multiple mippos, then it doesn't matter
I'm not taking any chances
hyperbolic depth what's that
the value that's stored in the depth buffer
is the thing from dragon ball Z
ndc space z then?
opengl has different window space and ndc space depth by default which is cancer
v/v.w: clip->ndc
first time I'm seeing window space term
[0; 1] is like uv space
I'd assume window space meaning viewport space or something
where it's in pixels
opengl is chadonkulous api because ndc depth is configurable
I love copying my old GL code and it not working in my current project because the ndc depth range is different
i don't think it is configurable either in d3d or vk
vk has an extension
VK_EXT_depth_clip_control lets you use the GL convention
We're putting this in DD, right? 
Jaker, is this way of deferring initialization considered 'good practice' or is this a temporary workaround?cpp // Since pipelines have complicated construction, we use a std::optional here to // delay its initialization so it can be constructed in the body of the function. std::optional<Fwog::GraphicsPipeline> pipeline; Seems pretty interesting, and by doing this I dont need to use std::unique_ptr in a few places just because I needn deferred initialization
File where I found said code : https://github.com/JuanDiegoMontoya/Fwog/blob/main/example/01_hello_triangle.cpp
you mean you didn't know about optional?
I knew about it, but only use it in places where the data type it wraps is optional
Like the mapped buffer pointer for a constant buffer, when the buffer abstraction is same for all types of buffer
I'll switch my code to use it, much better than having these random unique pointers that wrap objects that dont need to be heap allocated and in turn hold some pointers internally
optional allows the memory to be pre-allocated
using unique_ptr would mean allocating from heap
for that reason I am myself transitioning from unique_ptr to optional where possible
optional<> member memory is part of the struct/class it is part of
it's a tagged union that's pretty much all there is to it
on the other hand, unique_ptr<> works with forward declared types
optional<> needs the type to be defined
It's kinda hacky compared to just initializing the pipeline in the member initializer list
But that means I'd need another function to make the pipeline 😩
I think using std::optional is not a bad way of doing deferred init still, if it is needed
can you massage the oop such that it gets initialized in the right order?
or what is the issue?
the problem is entirely me being lazy
skill issue!?
in every other ex🦐le I init the pipelines the correct way
https://github.com/JuanDiegoMontoya/Fwog/blob/main/example/02_deferred.cpp#L295
/s
maybe I should change it for hello triangle so I don't teach bad habits immediately
people(1) come at you with a raised eyebrow already so perhaps
but tbh maybe it's cause people come to look at examples with too high expectations
you have the mvp tag after all
hehe i rember trying to convince jaker of temporal coupling
back in july last year
temporal coping
🔬
@heavy cipher remember when you teased me for that sus "avoids UB" comment that my program has? well now I can blame someone else 
apparently the race to write the constant value 1 to the buffer
without an atomic op ye
that does look like ub
well it's not ub for nvidia, when published by nvidia, cuz they're in charge of the behaviour
would be evil if picked up as is and broken on other vendors' hardware
maybe they can just bundle the correctness into some implicitly-enabled shader extension like GL_NV_gpu_shader69
ngl the "no atomics required" comment sounds like tongue in cheek bruh who cares about other hardware
I'm pretty sure it worked on AMD when I tested but idk
I don't see how this could fail on any hardware tbh, even if it is technically UB
I might be looking too deep into it
I don't think it's a very big deal overall
it does make my language lawyer senses tingle though
it is
thank you pixel 🙂
ok I just realized that you can put immediately-invoked lambda expressions basically anywhere
auto descColor = Fwog::VertexInputBindingDescription{
.location = []() { return 1; }(),
.binding = 1,
.format = Fwog::Format::R8G8B8_UNORM,
.offset = 0,
};
Foo<decltype([]()->void { })> foo;
You can use that for custom hash functions but its a bit cursed
std::unordered_map<std::string, int, decltype([](std::string const& s) { return s.size(); })> map;
true
my autoformatter did not like it, but it checks out
Ah yes, () > ()
👁️>👁️
making a lambda that returns the constant 1 feels fancy though
no difference for release build after optimizations either
but still not a welcome practice tbh
I like to put things like this in my code to keep readers on their toes
hehe
re the conchfusing std::optional thing in hello triangle: it is now fixed (read: gone)
👏
I like how only the GL 2 ref pages have the warning
heh
that also reminds me of another project i wanted to do
i wanted to make all the glXXX links available as hyperlinks
and link missing ones in the See Also section
seems like GL lacks an equivalent to arrayPitch and depthPitch in VkSubresourceLayout
so I guess they all use the value for UNPACK_ALIGNMENT
wtf it took until GL 4.3 to be able to read the stencil plane of a depth+stencil texture
smoov resizing required basically 0 lines of code to implement
only problem is that it revealed a leak I have in my fbo cache 
fun fact: you know how your cursor "sticks" to the edge of your screen when you're resizing a window? that behavior persists if the app crashes while you're resizing the window
lel my cache wasn't calling glDeleteFramebuffers on old entries. it was just removing the item from the map
If only it was a RAII handle 
or RAIII
resource acquisition is leaking (RAIl)

windows bug?
ye probably
btw the fps goes up to infinity when resizing the window :^)
@shell inlet does this tonemapping operator look familiar to you? do you know its name?
1-exp(-color)
I compared it to reinhard and they are pretty similar
https://www.desmos.com/calculator/5linvlxtyd
it saturates more quickly than reinhard which is nice
no I don't know this one
maybe it's bespoke
when I google "exponential tone mapper" I get some formula that does not look like the one I just showed (which is what teardown uses btw)
what's nice about that
reinhard looks washed out/desaturated in my objective opinion
use luminance based version
it preserves chroma
I've sent you one, you said it had moar color
^
extended reinhard with arbitrary white point may also be made to work on luminance
let's see how teardown looks with reinhard 2
bespoke vs reinhard1 vs reinhard2
idk what value to select for the white point in reinhard3 so I didn't test that
not enough intensity to test desaturation imo
yeah the only bright thing in this scene is the lämp
but I can see that the luma rh looks way too saturated
ye I was surprised
looks nice
here for lulz I put the tanh which is a standard audio limiter in DSP
used in audio that is
TIL
it compresses even less than the bespoked
hmm it seems like it's getting compressed more quickly
and therefore the rate of desaturation should be smaller as well, I think
but more bright parts on the image too
I think it's possible to extend the luma based operator and add controlled desaturation if you still want it
as a separate curve
luma based one just doesn't desaturate whatsoever because chroma is left out of the equation
btw white point in extended reinhard is usually max luminance on the image
but if you want to leave some more white parts on the image with extreme luminance differences (like some dark room with sunlight coming in) you can use some heuristic to clamp it so that you don't compress it all and be left with a dark room as a result
usually determine the upper bound of luminance based on screen coverage
yeah maybe using some upper %ile luminance instead of just the max
yeah building a histogram out of binned screen tiles is a good starting point
but can be approximated with different means of whole screen
by using two means from power(generalized) mean
I wonder how well a temporally-accumulated monte carlo sampling scheme would work for this
probably terribly, but it'd be funny
e.g. geometric mean for lower bound (used for autoexposure) and cubic or quadratic mean for upper bound for the white point
what is g? your test "image"?
i like the first one out of the 3
hehe that's the one already in the game 
normalized gaussian
the "image" is f
those means are all mostly special cases of power mean btw
also I've said it once before but min and max functions are also, in fact, special cases of power mean
for when power is negative and positive infinity
@long robin can you try this out with white = 2 to see if it preserves whites? I think it should
In Teardown?
yeah
!remindme 15 hours aaaaa
Alright Jaker, I'll remind you about aaaaa in 15 hours. ID: 54062978
but I mean if there's a different way for you it'll work, but you have the others from teardown already to compare against
success
ok I think I see why it's not very HDR
autoexposure?
it seems like the image is clamped to 1 before bloom
kinda weird b/c the diffuse light behind the wall is >4
also I went over different tonemapping sources and found one on shadertoy that resembles the one in teardown
it's called rombindahouse tonemapper
it's similar because it uses exp
but it's not exactly just exp
vec3 RomBinDaHouseToneMapping(vec3 color)
{
color = exp( -1.0 / ( 2.72*color + 0.15 ) );
return color;
}
RomBinDaHouseToneMapping
that name has to be a shitpost
Rom B.?
I hate that shader btw
some tonemappers have srgb conversion in them and some don't
and ones based on extended reinhard called white preserving
but it's just the version with white point beyond which the image is clamped
that was a good one ❤️
https://github.com/yusuketokuyoshi/VSGL
Jaker check this out looks like extension of RSM
or maybe don't
it's kinda heavy on maths, not as much of a quick read as I initially thought
I wish I knew what a spherical gaussian is
I think maybe instead of doing VXGI next, I'll just skip straight to DDGI
VXGI has some weird stuff like needing geometry shaders or having to render the world 3 times
plus it needs float vector atomics or you have to use some fixed-point yuckiness
that being said, I need a whole RT setup for DDGI 
could be my excuse to start using vulkan so I can get those ez BVH gainz
and make a new vk wrapper?
probably what you think it is
it has a very self explanatory name
gaussian on the surface of a sphere 😳
lmao
notices bulge 😳
when you draw it like that it looks silly
I prefer the colormap version
but the displacement version is better if you have a big range of values on a sphere
I wonder if amending a commit in VS with no message will apply --no-edit
context: I messed up a commit (not pushed yet) and want to fix it, but without changing the message
ah, it autofills the previous commit message when you check the amend button
nice
finally, society has advanced to the point where we can write
Fwog::Cmd::BindUniformBuffer(0, reprojectionUniformBuffer);
instead of
Fwog::Cmd::BindUniformBuffer(0, reprojectionUniformBuffer, 0, reprojectionUniformBuffer.Size());
default argument magic?
yeah I just introduced a constant called WHOLE_BUFFER (which totally isn't a copy of VK_WHOLE_SIZE) and then added default args
it's a constexpr variable
yeah
makes sense then
but you just made me realize it was in a slightly wrong namespace
sad
can't make C folk sad either
even if their choice of language is not universally the best
what about the cluster volumeisms?
time for the daily vulkan shilling
what are those clustered volumeisms anyway
deccer wants me to implement clustered rendering because I said I'd do it at one point
any kind of punctual light actually, but yeah
efficiently culling spot lights is hell though
reminds me of your volumetric exshrimple 🙂
just trace them cones
noo
fyi i tried out the thing I mentioned in #opengl - just fetching the entire triangle in the vertex shader (even if that means a bunch of redundant loads) and it turned out to be slightly faster than geometry shader
so first excuse doesnt count
how much DDGI is actually more memory efficient than VXGI is the question I am wondering about
from my understanding DDGI is a probe based solution on steroids
which also brings about the question of how you utilize it in a big open world environment
not only you have all these accel structs hanging out in memory you also have dense probe arrays there too
VXGI at least perhaps can be made to work with clipmaps
even though I'm skeptical about how good it would perform visual quality wise
You can make DDGI or any other probe method work with clipmaps
In one demo, they had a few MBs of probes covering a 1km^2 scene and it looked pretty good
One of the main things going for DDGI is that you can practically reuse any existing probe data structure that your engine has, but then upgrade it with the DDGI stuff (vsm per probe and ray tracing)
can it handle specular reflections
uh I think Morgan McGuire talked about specular reflections at the beginning of his DDGI talk
Since you have actual RT, you can use another method like tracing at a low res and blurring based on surface roughness
So DDGI doesn't handle specular itself, but specular can be easily handled some other way
thanks i'll have a look. don't know anything about ddgi except funny balls in space
make sure to read the relevant academic papers on morgan mcguire's balls
btw the teardown post is finally live (as in you don't need a secret link to find it)
https://juandiegomontoya.github.io/index.html
where's the animation section ||/s
||
very cool though, i thought about posting this in my work's slack graphics channel but then i realized that may somehow trace back to this discord/me
(imagine this in meme format):
letting people online know my real identity :drake_yes:
letting people irl know my online identity :drake_no:
one sec, gaming
do ya mean like on reddit
it gets a few posts a day
r/gamedev is trash but maybe it's worth it for da updoots
and actually active community
yeah but it's also 15% odds of not being deleted and banned
their moderators are mentally ill
they have a no self-promotion rule iirc
which imo this doesn't fall under because I'm not shilling my own product
I'll crosspost to VoxelGameDev too
gotta get the word out

well damn, thanks for the mention
it's not like I literally didn't do anything 
the court jester build
I think I just looked at the people who talked about it in some way from the last time I posted it
kinda hard to keep track of shoutouts so I just made sure y'all were in there 
wait you actually shouted out a guy called void lmao
how else am I supposed to mention you 
why am I there to begin with
cuz you were here
you're a good lad
+1 rep
okay it's not like people would look at it and know it was me anyways
btw was live presentation given before the other breakdown
subtle way to say you were first
yeah, it was 
teardown uses threshold bloom the bad kind of bloom
but at least it doesn't do a single gaussian filter like learnopengl bloom 
the learnopengl is truly a message to the creator
rather than description of the resource
k that was rude
r00d
I will reuse the joke in a different context some time later
done
you have mvp, i fink its worthy to be placed in #graphics-news
post also on /r/tifu "TIFU by starting work on a blog post 2 weeks late"
your post was already featured on Sunday in the Graphics Programming weekly, what is this sorcery
what is this gp weekly
3D Programmer
I look at that every week, but I thought you had to submit articles to the author 😄
(also congrats of course 🙂 )
Submitted it to gamedev and it has gotten no traffic so far lol
https://www.reddit.com/r/gamedev/comments/118trip/teardown_teardown/
you think the average r/gamedev user will even understand what you're talking about?
O ye of too much faith
yeah the other frame breakdowns that I've seen posted there got a small amount of attention
I wasn't expecting much tbh, judging by the subreddit's contents
/r/opengl perhamps
90% of posts are from absolute beginners, and not all of the remaining 10% are technically inclined
what if r/TeardownGame/
Mayb
you can also consider /r/programming
just spam it a bit more
just a spoonful of posts
I posted it there, but I wonder what the users will think
The users obviously like the game, but I wonder if they care for what my post has to offer
maybe you could make a mod where you can destroy individual opengl calls
r/opengl and r/programming sound like places where people go to ask why their glVertex2f doesn't work
imo
- r/opengl isn't ideal because it has a) lots of noobs and b) the fact that teardown uses opengl is the only relevant thing (I don't show any actual GL calls in the entire breakdown)
- r/programming isn't ideal because there is barely any actual code in the article, and the topic isn't about programming itself, but idk
imagine the amount of interactions you'll get from people pointing out you posted in the wrong place
maybe I should've posted in r/programminghorror then
r/programming is just an aggregator for programming related topics
hmm you are right
however, I'm out of posting credits for the month, so someone else will have to do it on my behalf if they really want to
is that a legit thing, I haven't touched reddit in years
I'm cappin', I just don't feel like posting it more
if elon buys reddit it might become a thing
-1000 elonbucks
elonbucks lol
upvotes renamed to elong
the problem is you just posted a link
rather than introducing the thing with a paragraph 😛
but i couldnt care less about reddit, so, disregard what i said
this is the correct answer tbh
hehe I thought about writing a little paragraph to introduce it to each community, but idc
cover letter vibes
much easier to just post a link and let people form their own thoughts
nah cover letter vibes is a different thing
the vibe I get is that it's effort and isn't worth it
fair
I'm not trying to minmax karma, but rather post to communities that might find the thingy interesting 😄
its all good : )
some fucked up ray traced shadow maps bruh
not really getting that contact hardening atm
I'm ray tracing inside of a shadow map, like SSR
so it's not using any of the stuff that makes real ray tracing hard
i am
ye
I'm trying to copy it, but I think I'm missing the crucial "virtual shadow maps" component of it, which seems extremely complicated to implement
well I'm seeing how crucial it really is
so far, my implementation of SMRT is about 30 loc
And why not real ray tracing?
because I'm not trying to implement that
I am curious why you are not trying?
I'm explicitly trying to implement something like UE5's SMRT to see how it is
perhaps more work on the host than in the shaders
rt is cooler than whatever hack ue5 has tho
might try RT when™️ I switch to vulkan
that way all the boring parts are done automatically
even software rt shadows should work fine on as low as gtx1050
replaced with a bunch of other boring vulkan stuff I have to do 
in fact shadows is the possibly fastest type of ray, given that you terminate on any hit (as opposed to closest)
the fastest ray is the one not cast 
the best rendering technique is the not implemented one 
it's an odd game, to be sure
the best graphics are not rendered on our computers 🧠
deep
btw the reason I'm skeptical about the UE5 technique is that it looks overly complicated
can't quite put it into words
like a hack on a hack or something
those kinds of algorithms always become a pita in unpredictable ways
my rule of thumb is that the less knobs the algorithm has the better it is
I think the main problem my impl will have is not having a high enough shadow map resolution
virtual shadow maps basically lets UE increase the shadow map resolution by a huge amount with the same perf
the shadow map is still only a heightmap, which they seem to somewhat deal with by limiting the max shadow angle
UE's impl doesn't seem to exhibit bad artifacts, and it works basically as you would expect
I've almost totally stopped trying to do "better" shadows with rasterization. Why bother, in a few years raytracing will be the solution anyway
looking forward to nvidia either reducing rasterization capabilities, or buying a case with the size of an average kitchen refrigerator
ray tracing is already a solution for shadows on current GPUs
the question is when are shadow maps going to be slower
the shrimple solution is always to implement both things and blend them in a clever way
you mean the unshrimple solution
double plus unshrimple
@shell inlet I was reading mjp's blog and stumbled upon this article 😄
https://therealmjp.github.io/posts/sg-series-part-2-spherical-gaussians-101/
perfect for me
a potentially interesting idea for fwog is to have it run and make gl calls on another thread
would be sort of a massive butt pain making the infrastructure to defer calls and whatnot, just to potentially move the driver overhead to a thread
would you really want to do that instead of vk?
(not meming this time, pinky swear)
honestly it's probably less effort than moving to vk
but vk still offers a million other things that makes it nice
and it's not like I'm drowning in driver overhead rn. I just thought of it because it was brought up in #opengl
#opengl
I look at that channel to feel something, anything at all. Ya feel?
did i not suggest such an endeavor some time ago already
bet
streaming verticles and textures via freds should be intermeresting
Thats very doable because you can shrimply write to a mapped buffer
yep, but the infrastructure around it is what makes the thing interesting
@golden schooner I see you are utilizing the handy inverted rainbow emoji from the voxel server 😄
btw a discussion with dethraid made me realize that I forgor to load textures as srgb in the fwog examples 💀
: )
i load them as srgb in enginekit since we last schpoke abou it
3 or 4 weeks ago
you should also port that mc clone to fwog 🙂
mayb
now I need a tonemapper because I cranked the sunlight
the colors feel so saturated now 😄 (with reinhard_luminance)
wow this scene has actual color
I feel like a colorblind person seeing color for the first time in this 😄
xD
i must admit this one looks the best out of the ones ive seen so far
"colorful" indeed
also I think I had a revelation
storing srgb albedo in your gbuffer is probably a good thing
teardown didn't need to have an RGBA16_UNORM albedo buffer, but instead RGBA8_SRGB
are you adding that thought to your publication?
perhaps
I don't have any plans to do so
why not
my fork has some "jaker" comments in it so I can quickly search for my changes 😄
in case something broke
it also moves the include to a different folder because that's how I like it
therefore idk if it's ideal to submit as a PR
that one should just be a CMakeLists.txt ism
you could PR just the actual fixes without the folder changes?
the fixes are kinda meh
see for yourself if you think it's PR-worthy (just look at the most recent 4 commits)
https://github.com/JuanDiegoMontoya/enet/commits/master
i thought WIN32_LEAN_AND_MEAN defines all the NOXXXs
there is also a VC_XXX_LEAN_XXX thing
hmm the last commit probably makes the most sense
but i see why you dont feel its worth the hassle
idk
but it looks funny when you have that big list of defines
its more exschleppicite
back to the original topic: teardown is failing to use srgb images anywhere, so it has to 1) do pow(color, 2.2) on materials to convert to linear, and 2) use an extra-wide albedo buffer to account for storing gbuffer albedo in linear
anyways, I wonder if gltf textures declare their usage
or if I have to create srgb views of color textures after they are uploaded and I can see that they are being used for color
could it be in sampler?
looks like it's only implicitly specified in the material
so once I see that an image is used for color, I can make an srgb view of it and throw the texture away
The base color texture MUST contain 8-bit values encoded with the sRGB opto-electronic transfer function so RGB values MUST be decoded to real linear values before they are used for any computations. To achieve correct filtering, the transfer function SHOULD be decoded before performing linear interpolation.
this spec is nice because it doesn't have a memory model section
hmm
I did a temporary hack to fix srgb
since my ex🦐les only support albedo texture, I just load all textures as srgb
you could invest another 2 minutes and make it proper
during material load time you pretty much know what texture is what... albedo/normal/ARM
and then do the thing you did there
fine, I'll do it properly 😄
then i can finally go dodo in peace 🙂
gn my prince
making a new member function of texture for creating a view of it with a different format 👀
[[nodiscard]] TextureView CreateFormatView(Format newFormat) const;
Formatted sounds weird, so I'll do WithFormat
you won't like these other ones
[[nodiscard]] TextureView CreateMipView(uint32_t level) const;
[[nodiscard]] TextureView CreateLayerView(uint32_t layer) const;
oh god
CreateViewForMipLevel
CreateViewForLayer
ideally CreateTextureViewFor..Ism..
erm actually
explicit TextureView(const TextureViewCreateInfo& viewInfo, const Texture& texture, std::string_view name = "");
i like void's interjection more than CreateMipView/LayerView
you are already vulkan all along
CreateLayeredView/CreateMippedView
sometimes I question how certain emojis get put into unicode
jaker i understand you are american, struggling with your language is a natural thing
I've seen CreateMipView in other code and it was instantly obvious to me what it meant
it creates a view of a mip
a mip view
so you're making shortcut methods basically
because the CreateInfo struct is quite verbose
good design
I would use Of instead of For if I wanted it to read like a sentence
CreateView(CreateViewForMipInfo info)
CreateViewOfMip
alternatively you could make a class that would spit out structs with defaults based on enum
but if there are fields that are automatically filled in based on the object's state then that solution falls off
naming things are hard
and i will support any decision you take, naturally
but you will not hear the end of it 😄
naturally
I can't tell if that fella is supposed to animate at a variable rate
probably just a classic gif rendering bug
methinks its on purpose
some of the gifs that loop at full speed get pretty messed up
first time i hear that
clep sometimes sends a : hype : gif that has broken looping
you can set a frametime between individual frames in jiffs
maybe it's because my monitor is 60hz and gifs can only do 50hz
i will keep an eye on it
oh gif can actually go up to 100hz
but I remembered that 50hz is the ideal target 
https://wunkolo.github.io/post/2020/02/buttery-smooth-10fps/
y tho
srgbisms
single mip is useful for bloomisms
single layer is useful for debuggling arrays
mayhaps I can make that be the base layer/mip
not trusting the user with two values is a bit silly
can you actually create a textureview for more than 1isms in gl?
ye
besides calling CreateViewXXX more than 1ce 🙂
that doesn't make no sense
you explicitly choose the number of levels and mips in glTextureView
ah i thought it was the actual level or mip in glTV, my B
@heavy cipher these are just convenience functions, the constructor for TextureView lets you specify everything
can you make a textureview from a textureview
yeah
like many small utility functions, the user could just define em themselves
but I find them handy from time to time, so I'm putting them in so I don't have a bunch of redundant definitions for this stuff lying around
I'd probably make the name more shouty then, CreateSingleMipView or smth
@golden schooner this "2-minute change" to properly load materials is turning out to be an entire overhaul
I also learned about std::ranges::move recently, which is pretty cool
classic
indeed, this is not bad either
oh yeah, now it runs and everything looks exactly the same as before
the factor has been ree'd
at least the code base reeds (read reads) better now 🙂
what did u change?
previously, I just had a big array of textures and each material would hold an index (or indices) into that
now, each material holds its own texture view(s)
the problem was that the usage of a texture wasn't known until a material referenced it
but now, materials hold their own sRGB view(s) of color textures
neat
basically it is the classic separation of storage vs usage
yeah
at one point I used only texture views, but it was painful
I "had" to store both textures and their views, or create views on demand
both of which feel like writing extra code for no gain
the great srgb disaster of 2023
frrrrrrrrrrr
it never ended
srgb and its consequences
fwog is going places
#ad
@long robin what if we tonemap in okhsl space
wanna try it
?
if I get you the code
it's a perceptually uniform hsl
so no hue shifts when lerp two colors
Sure
Never heard of okhsl, but it sounds similar to things I have heard of
ok honestly tinkered with it and couldn't make it noticeably better than luma reinhard 🫤
unhype
there might be some slight advantage that it doesn't shift hue though
but I'd need a real HDR image to test everything which shadertoy doesn't have
so all in all more effort than I can afford to put currently
you should add a bunch of Create____ functions, but randomize the name of them between Create_, Make_, Generate_, Build_, Construct_
Why do you need HDR images to test it? Don't you just need floats in the shader?
lack of natural contrast in intensity from multiple light sources, I can scale whole image by some huge factor but that's fake as hell and rip precision
you can do fake (or real) lighting math in the shader
I can also test on the color gradient by mapping hue and lightness to uv
lol
Loading took 22.153 ms
Node: 对象409
Node: 对象393
Node: 对象392
Node: 对象391
Node: 对象388
Node: 对象389
Node: 对象390
Node: 对象387
Node: 对象027
Node: Plane062
Node: 图形001
Node: Rectangle001
Node: Plane031
Node: 对象353
Node: 组019
Node: 组020
Node: 组018
Node: 组015
Node: 对象311
Node: 组013
Node: 对象352
Loaded glTF: H:/Repositories/glTF-Sample-Models/downloaded schtuff/shadow_test.glb
uh
I wonder if this is a bug in tinygltf or if these strings are not ascii encoded
I guess it's not actually a wstring 
I have decided that I don't care about this
string but for webgpu
Some of them pake sense or partial sense
glTF JSON data SHOULD be written with UTF-8 encoding without BOM. This requirement is not applied when a glTF implementation does not control string encoding. glTF implementations SHOULD adhere to RFC 8259, Section 8.1. with regards to treating BOM presence.
perhaps I was reading them correctly all along

!! attention citizen 注意公民 this mesh 这个网格 has been confiscated by the CCP 被中共没收 !! Do not render this incorrectly 不要错误地渲染它 Or 1000 social credits will be deducted from your account 否则将从您的帐户中扣除 1000 社会信用
you can actually tell which parts of the mesh are an aftermarket addition
CCP is eve online, what kind of model do you load there jaker?
It's the shadow test scene that someone gave me in #general
I posted a pic or two of it in here some days ago
It's the little gray market stall thingy
ah
i started to yeet wonky models from my local asset store
ther were a bit of chinese characterisms involved too
kaput materials
or not even what was shown in the preview
rendering with chinese characteristics
ed too