@vethanis@mastodon.gamedev.place
@vethanis@mastodon.gamedev.place avatar

vethanis

@vethanis@mastodon.gamedev.place

she/her

#nobridge

This profile is from a federated server and may be incomplete. Browse more on the original instance.

lisyarus, to random
@lisyarus@mastodon.gamedev.place avatar

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

vethanis,
@vethanis@mastodon.gamedev.place avatar

@lisyarus Are you offsetting your ray start position by the (flat, non shaded) geometry normal * epsilon?

That's the usual solution to self shadowing acne artifacts at least.

For translucent materials you have to swap the sign of this bias based on the sign of dot(geomNormal, bsdfRay).

vethanis,
@vethanis@mastodon.gamedev.place avatar

@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

aeva, to random
@aeva@mastodon.gamedev.place avatar

random brain wandering:

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.

vethanis,
@vethanis@mastodon.gamedev.place avatar
aeva, (edited ) to random
@aeva@mastodon.gamedev.place avatar

what is your favorite rgba channel?

vethanis,
@vethanis@mastodon.gamedev.place avatar

@aeva g for the extra bit with 565 under bc1

aeva, to random
@aeva@mastodon.gamedev.place avatar

male-to-female, obviously, but world-to-local gets an honorable mention

vethanis,
@vethanis@mastodon.gamedev.place avatar

@aeva electrical to optical another good one

unormal, to random
@unormal@mastodon.social avatar

mfw trying to puzzle out the design for how best to engineer a 4-player qud-level simulation that's possible to actually develop and maintain

vethanis,
@vethanis@mastodon.gamedev.place avatar

@unormal

Somewhat common network model dating back to quake 3: low frequency snapshots, high frequency client inputs, client side prediction and rollback.

https://fabiensanglard.net/quake3/network.php

vethanis, to random
@vethanis@mastodon.gamedev.place avatar

One thing that ML is doing really well compared to computer graphics:

Creating huge complicated data pipelines that utilize the GPU and are (relatively) easy to build, use, share, extend.

There really should be a computer graphics equivalent of pytorch or tensorflow that exposes a render graph, shaders, etc and interops via numpy.

bitinn, to unity
@bitinn@mastodon.gamedev.place avatar

question again:

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.

What could be the problem?

vethanis,
@vethanis@mastodon.gamedev.place avatar

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

https://media.missing-deadlines.com/iolite/blog/reverse_z/graph-0.svg
https://iolite-engine.com/blog_posts/reverse_z_cheatsheet

aeva, to random
@aeva@mastodon.gamedev.place avatar

eee Mym surprised me with a rhombic dodecahedron :D

vethanis,
@vethanis@mastodon.gamedev.place avatar
aras, to blender
@aras@mastodon.gamedev.place avatar

A while ago I started to wonder why "bicubic" image filter inside 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.

So I made a small html page to compare them! https://aras-p.info/img/misc/upsample_filter_comp_2024/

vethanis, (edited )
@vethanis@mastodon.gamedev.place avatar

@aras imo, "lotsa blur" (looks like gaussian filter) column is the only one that looks like an actual resolved image rather than pixels.

Gaussian or windowed sinc filter with adjustable filter size is very versatile.

Relevant: https://pbr-book.org/3ed-2018/Sampling_and_Reconstruction/Image_Reconstruction#FilterFunctions

vethanis,
@vethanis@mastodon.gamedev.place avatar

@aras Right. nyquist sampling problem. pixels have to bleed into neighbors some to be continuous.

gaussian should really be the default for more things, rather than propagating aliasing and noise downstream.

aeva, to random
@aeva@mastodon.gamedev.place avatar

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?

Here's a contrived bad example:

vethanis,
@vethanis@mastodon.gamedev.place avatar

@aeva I use unions all the time, very handy for bitfield packing / unpacking.

union Handle  
{  
 struct   
 {  
 uint32_t version : 8;  
 uint32_t index : 20;  
 uint32_t type : 4;  
 };  
 uint32_t packed;  
 Handle() : packed(0) {}  
};  
static_assert(sizeof(Handle) == sizeof(uint32_t));  
vethanis,
@vethanis@mastodon.gamedev.place avatar

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

vethanis,
@vethanis@mastodon.gamedev.place avatar

@aeva Yep, acts like a class or struct.

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.

vethanis,
@vethanis@mastodon.gamedev.place avatar

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

vethanis,
@vethanis@mastodon.gamedev.place avatar
vethanis,
@vethanis@mastodon.gamedev.place avatar

@aeva hmm, github says its public in the settings. shrug

aeva, to random
@aeva@mastodon.gamedev.place avatar

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.

vethanis,
@vethanis@mastodon.gamedev.place avatar

@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

aeva, (edited ) to random
@aeva@mastodon.gamedev.place avatar

SDL2's joystick axis event is a signed 16-bit integer, which the header clarifies the range is -32768 to 32767.

Which is the correct way to convert this to a floating point number of range -1.0 to 1.0?

(assume reasonable type conversions in the poll options for brevity)

EDIT: also assume there's a * sign(v) at the end of these

vethanis,
@vethanis@mastodon.gamedev.place avatar

@aeva (uint16_t)(x) * (2.0f / 0xffff) - 1.0f;

aeva, to random
@aeva@mastodon.gamedev.place avatar

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.

vethanis,
@vethanis@mastodon.gamedev.place avatar
eniko, to random
@eniko@peoplemaking.games avatar

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

vethanis,
@vethanis@mastodon.gamedev.place avatar

@eniko sounds very similar to Static Single Assignment, especially if you create a new register for every intermediate value.

demofox, to random
@demofox@mastodon.gamedev.place avatar

There is a serious rabbit hole - er - black hole relating to generalizations of Latin squares that would take multiple lifetimes to explore. Ain't nobody got time for that!
https://en.m.wikipedia.org/wiki/Mutually_orthogonal_Latin_squares

vethanis,
@vethanis@mastodon.gamedev.place avatar

@demofox @vanderZwan
at 24 bits it looks like its nearly identical https://www.shadertoy.com/view/cscBDS

aeva, (edited ) to random
@aeva@mastodon.gamedev.place avatar

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

vethanis,
@vethanis@mastodon.gamedev.place avatar

@aeva replace UI with smell-o-vision

aeva, to random
@aeva@mastodon.gamedev.place avatar

Building a material system

vethanis,
@vethanis@mastodon.gamedev.place avatar

@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]

https://github.com/Vethanis/pim/blob/master/src/math/color.h

aeva, to random
@aeva@mastodon.gamedev.place avatar

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.

vethanis,
@vethanis@mastodon.gamedev.place avatar
  • All
  • Subscribed
  • Moderated
  • Favorites
  • provamag3
  • rosin
  • normalnudes
  • everett
  • DreamBathrooms
  • ethstaker
  • magazineikmin
  • thenastyranch
  • Youngstown
  • GTA5RPClips
  • slotface
  • khanakhh
  • vwfavf
  • kavyap
  • megavids
  • mdbf
  • Leos
  • Durango
  • tacticalgear
  • InstantRegret
  • cubers
  • osvaldo12
  • ngwrru68w68
  • anitta
  • tester
  • modclub
  • cisconetworking
  • JUstTest
  • All magazines