Another weird raytracing bug! The black patches on the border are expected - these are artifacts due to having an extremely low-poly metallic surface with interpolated normals.
The white circles, however, are probably some funny floating-point business
@lisyarus
Does changing the roughness improve or worsen the effect? If so, it would suggest precision loss somewhere in the BSDF.
Dividing by a variable less than 2^-23 is the usual suspect.
An rng bug could maybe introduce patterns, too, but most likely the BSDF.
I tend to reject sampling pdfs below 1e-6 since it will likely introduce either a firefly or +inf
Suppose you have a cellular space like a grid or a quad tree or such. Each cell intersecting a shape (say, a triangle) records relative surface feature (say, a plane) that might be useful for recovering or extrapolating a nearest point on surface. Maybe a cell stores an authoritative surface feature, or maybe it can have several, doesn't really matter for this post.
Then, empty neighbors use that data to generate their own (non-overlapping) relative surface features.
Say I have a Unity shader, where in vertex stage, it offsets mesh in world space, to be further away from camera in the view direction, then convert the final position into clip space and pass onto fragment stage.
It works perfectly on D3D, Vulkan and Metal platform, but OpenGL want the offset to be much smaller, almost 1/20~1/100 of the value, in order to produce the same look.
RenderDoc shows used inputs are the same across platforms.
@bitinn that looks a lot like Z projection to me, among those backends GL has the weird Z clip space, and the view direction in worldspace is the Z axis of clip space.
A while ago I started to wonder why "bicubic" image filter inside #blender is exactly like that. And that led into a rabbit hole of trying to figure out what apps mean by "cubic"/"bicubic", and of course everyone means a different thing.
C++ supports defining union types, which support most of the same things as classes and structs including but not limited to: access control specifiers, methods, statics, etc.
Does... does anyone actually use this? Like, the whole kit and caboodle, not the most basic possible usage?
@Specialist_Being_677@aeva
In C unions do not violate strict aliasing but in C++ the only option that doesn't violate it is memcpy. Pretty much any code casting between integer types violates it.
Can sometimes make sense to make parts private and add methods.
For instance if you need a CAS loop or something you could have methods to atomic load store or exchange on the packed part into local variable, then use anon struct to unpack info, to make sure it always acts atomic.
I would avoid mixing any inheritance or templates on it though. Wouldn't put a big class worth of methods in it since it could get confusing, but I have smol grug brain.
@thomastc@aeva It is UB in C++, in C it is legal.
The strict aliasing flag that would break it also breaks extremely common code like: ((char)&anything) = 0.
Very unlikely for a codebase of significant size to ever have strict aliasing enabled.
Tangerine currently renders the scene asynchronously by updating the vertex colors in a thread pool on the CPU. pages of updated colors are copied by the main thread into the vertex buffer to be rendered on the GPU. this works great, but if it gets backed up really bad you can sometimes see the stale pages in the final render as strips of the wrong color.
The original remedy I had in mind was to update the verts randomly, so that vertex interpolation softens it.
@aeva Have you looked into meshlets yet?
tldr: one absolute many-bit piece of data and N relative smol-bit pieces of data near it.
Might be handy for reducing the amount of memory you have to copy around.
I guess it would kinda be like vertex color 'block compression' in this case
I was reading some UX literature, and one of the design rules is essentially "don't make your users wait". In the aughts they used to say your website should be readable within about 5 to 8 seconds. Now they say your react App should load on broadband within ten minutes. The exact threshold varies depending by context of course, but it's usually under 10 seconds.
I agree, but you can do better! Go for 16.6 milliseconds! You can do it if you try! Or 8.3 ms if you're hot.
also making register machine interpreters is so easy. like, what's a register? well that's something that holds a value! how many registers can i have? well its a VM so as many as i like, so every named variable has its own register! where do i put these registers? well i have this nifty thing called a stack that grows and shrinks where i can simply allocate space for all the "registers" (read: variables) a function uses
and it works way faster than a stack machine because you're not constantly doing multiple pushes and pops just to do a simple addition
Does anyone have a favorite open source game middleware for creating player-facing GUIs? DearImGui is lovely for quick development interfaces, but I'd want something more flexible for game interfaces. Best I'm coming up with is maybe hacking together something with Cairo (but only if the license is compatible with distribution on proprietary consoles, which I need to double check).
@aeva Even when 'linear rgb', you are in a color space determined by the color primaries your data was authored in.
sRGB / rec709 has different basis vectors than rec2020 or ACES ap1.
The linear vs nonlinear part is the electrical to optical transform (EOTF) that exists to better use bits in textures since the human eye is more sensitive to darker colors.
art color space -> renderer color space -> display color space
ie: sRGB -> ap1 -> [rec2100, rec709]
I want to build a lighting system and a proper material system for 🍊 soon. Does anyone have any recommendations for reference material that would be useful for implementing PBR shading models in a new engine? I know the theory, so I'm mostly hoping to find permissively licensed BxDF implementations for common shading models that I can adapt to my own needs. That, and reference values for common materials.