Programmer: Graphics, C++, C#, Shaders, Render Pipelines, Performance, Unity, Unreal, PC, Console, cats. https://xitter.cf/t.co/ZVhM7nzRvf https://xitter.cf/t.co/L6p2GNXesk

Adelaide, South Australia
Joined June 2016
My favourite meme picture :)
20
152
6
3,061
89,071
Ben Sims retweeted
DX12 Bindless Plugin for Unity3D is now open source, and you can use it in your projects! Can be useful for writing a custom GPU Driven Renderer. (github below)
4
25
191
14,120
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,681
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
1
1
7
2,702
(Here is the less broken version for completion. Trying to find a nice balance between root-motion/animation-driven camera/player movement, procedural effects, and control. Making it framerate+physics framerate independent is a fun challenge, this is for multiplayer+perf reasons)
1
2
665
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
914
The video is running with a very slow fixed timestep of 200ms to show that the technique is stable even for large delta time values. It also compensates for drag. PID controllers don't make sense when you know the actual calculations involved. Stop using them.
3
511
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.
3
2
46
2,248
A few other interesting highlights, uses my improved GTAO with the fix for the darkening issue, reworked screen space GI which helps significantly for foliage, especially after darkening introduced by GTAO. Finally, is also using the GT7 HDR tonemapper from a recent presentation.
5
763
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…
13
11
1
224
16,457
On a GPU mul/mad/select are full rate, eg the fastest op you can do. On a CPU fp32 mul is fast but it's not going to be faster than a conditional move or select which are single instructions, not branches. If you keep branches simple, compiler will optimise them into conditionals
2
20
1,548
FP muls also add a bunch of issues the compiler has to deal with such as the possibility of nans, inf, which can prevent compiler optimisations. Precision issues can also occur when accumulating lots of very small or large values. The less ops you do (including muls) the better.
15
1,353
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
6
2
71
9,446
I'm also using a logarithmic depth partition, but afaik this is pretty common, and simplifies to a mad and an exp2, so nowhere near enough ALU to cause concern on a modern GPU. I'm guessing maybe there's less coalescing in the reads/writes, or something related to thread layout.
1
7
1,851
AC4 used 12x12 tiles (190x60 @ 1080p) with 64 or 128 depth tiels and reports 0.116ms on an XboxOne for the final scattering integration pass. They also mention that brute force was the way to go. bartwronski.com/wp-content/u… So something definitely isn't adding up.
1
8
1,758
Results without any shadow mapping. The technique can add plausible shadowing outside of the max shadowmap range. Nice for reducing light leaking, and most of the work is done in the precomputation stage.
1
1
6
1,156
To avoid needing to set the sun to very large angular diameters for soft transitions, I'll probably add a transition region based on angle between light and normal. Since visibility cones are only an approximation and likely to over-occlude, this seems like a reasonable tradeoff.
1
1
892
A close-up example. Due to insufficient terrain tessellation, some gaps in the shadowmap appear. Combining with the terrain micro-shadows reduces this. (Will fix properly with better terrain soon, once I rip out Unity's ancient heightmap rendering system)
2
763