Decided to try implementing camera-roll when strafing without relying on broken physics. It works reasonably well, using the same quaternion spring damping as my weapon-recoil camera shake. This is more camera shake than you'd want for a casual FPS, but might suit a tactical one.
Turns out if you accidentally break some player rigidbody interpolation logic, your game ends up feeling like the game Bodycam. Maybe this was their trick all along. The accidental lean is cool tho.
Windows having bad HDR capture making the game look super overexposed also helps
12
1,705
Turns out if you accidentally break some player rigidbody interpolation logic, your game ends up feeling like the game Bodycam. Maybe this was their trick all along. The accidental lean is cool tho.
Windows having bad HDR capture making the game look super overexposed also helps
I often see "Use a PID controller" in response to "How do I achieve a given rotation using physics/torque?"
If you know how the physics engine updates rotation, you can derive an exact torque.
This is the code for Unity/PhysX, and an example rotating in a single frame.
1
10
925
Just some mildly moody screenshots from the thing that I'm trying to make into a thing. Also pictured: rewritten gpu driven foliage, terrain and grass renderers. Writing a device radix sort was fun-ish.
Currently reworking the terrain shader, needs better height blending.
I've been seeing some 'branchless code' posts making the rounds again. The posts are aimed at CPU, but the same approach seems to be common for shaders too. Replacing conditionals with math is generally always going to be bad. If it helps, your code is probably compiling badly.
Hey, don't "optimize" conditional moves with mix()+step(). Please stop advising that. Why: iquilezles.org/articles/gpuc…
Every time I implement volumetric lighting (Using froxels) I end up having a huge performance hit from the final raymarch/integration stage. At 1440p and 8x8 tiles I'm seeing nearly 5ms on an RTX 3070 yet the technique was used as early as Assasins Creed 4. What am I missing here
Experiments with micro-shadowed terrain based on precomputed GTAO+bent normals, approximating sun as a disk light. Needs an artifically large sun diameter for smooth results, but works reasonably well otherwise. Technique should work equally well for local lights too.
Anyone know how to calculate area lighting from a distant light source (eg the sun) treating it as a disc with an angular diameter? All the area light resources I can find deal with a distance and radius, but since the numbers are huge for the sun, angular diameter should be fine
2
12
1,565
Saw a cool light show tonight for the Illuminate festival at Adelaide's Botanic Gardens, but how do they make irl volumetrics without any ghosting? I guess this wasn't using Unreal. Some pretty fancy area lights too.
Guess I need to up my shader game.
How are games handling volumetric lighting for moving sources? The froxel approach seems like the most common technique but relies on temporal so you get bad ghosting with moving lights. Anisotropic fog also causes aliasing as camera moves.
Neighbor clamp seems expensive for 3D.
1
15
1,594
How are games handling volumetric lighting for moving sources? The froxel approach seems like the most common technique but relies on temporal so you get bad ghosting with moving lights. Anisotropic fog also causes aliasing as camera moves.
Neighbor clamp seems expensive for 3D.
Am I missing something or is detail texturing impossible in substance painter? Eg a unique UV0 set textured the usual, plus a tiled UV1 set containing repeated fine details combined with the base texture?
None of substance's shaders support it and there are no detail channels and
2
2
893
Making games is hard because sometimes you just want to take screenshots of your sky/clouds all day.
How to PBR:
n1(air ior): ~1
n2(dielectric ior): 1.5
f0(specCol) = ((n1-n2)/(n1+n2))^2 == 0.04
f0 = lerp(f0, albedo, metallic)
fresnel = lerp(f0, 1, pow(1-LdotH, 5))
spec = GgxDv(roughness)*f0
diffuse = lerp(albedo, 0, metallic)
return (specular + diffuse)/Pi * NdotL * lightColor
Does it make sense to store display nits in a framebuffer instead of camera-normalized values? (350-1000 corresponding to max luminance on a HDR monitor instead of 1: paperWhite, 0.18 mid grey)
Seems like a larger range might maximize precision with smaller formats, eg R11B11G10
So turns out if you try to compile XR shaders in Unity without this #ifdef, it silently fails and doesn't tell you why. Only took me a whole afternoon to figure out:
I figured since stereo instancing is always on, I wouldn't need it. (And can simply just output 0) but nope.
GTAO working quite well now with the projected normal angle fix. No darkening on non-view aligned slopes anymore. Also works nicer with temporal reprojection since the results are more stable. No spatial denosing yet, but works quite well with diffuse and specular IBL occlusion.
Turns out there is a correction factor required for GTAO, here it is visualised (raised to a power for better visualisation)
Integrating the projected normal over all slices of the hemisphere only equals 1 for perfect view-aligned normals. As normals become less-aligned, their
I still can't help but feel there is an error in the GTAO paper's weighting term. They divide the final result by the number of direction samples, however I feel like it should be normalized by the weightSum, as every sample is weighted by the projected normal length.
Is this actually an issue? It depends how you use your AO maps. I use them with bent normals to derive a physically-plausible micro shadowing term from AO+bent normal textures. Incorrect filtering causes significant overshadowing at lower mips. Correct filtering works much nicer!
Ambient Occlusion maps are stored+filtered wrong.
Cosine-weighted AO is a visibility cone with angle acos(sqrt(1 - ao)). GPUs filter textures linearly, but interpolating AO is not equivalent to filtering cone angles directly. Store AO as acos(sqrt(1-ao)) for correct filtering.


































