6 ms·
Reverse engineering the rendering of The Witcher 3 (2018)
- m3kw9 7y agoThis is some crazy sht, I’m surprised the expertise people have and to be able to do this
- shmerl 7y agoThat's impressive indeed. I'm even more impressed at developers of DXVK, who implemented the whole translation of D3D11 into Vulkan, including for shaders (enabling playing TW3 on Linux).
- dan00 7y agoThe dolphin (Nintendo GameCube emulator) developers have written[1] (nice read!) an interpreter of the GameCube shader code inside of the host graphics card shader. [1] https://dolphin-emu.org/blog/2017/07/30/ubershaders/ https://dolphin-emu.org/blog/2017/07/30/ubershaders/
- shmerl 7y agoThat's a very cool idea indeed!
- p1necone 7y agoIt is a big bucket of different techniques that have been developed by many different people over the years. Very much a standing on the shoulders of giants (and then also putting in a lot of regular sized human research and hard work too) kind of situation I think.
- non-entity 7y agoThis is indeed very cool content! The type that keeps me on this site. I too am constantly shocked by how many reverse engineering articles. The patience and knowledge required is insane
- pengaru 7y agoNeat writeup, I haven't played the game but was surprised to see so much aliasing around objects in his screenshots considering everything was on "max settings". Does TW3 predate ubiquitous use of MSAA or FXAA techniques?
- badsectoracula 7y agoIIRC it doesn't use MSAA (to do MSAA on a deferred renderer you need to take it into account in your pixel shaders, which in practice means that basically nobody does it) but it does have post-processing antialiasing (including, IIRC, FXAA and TAA). However since these are post-processing solutions they can mess up with the frame reverse engineering going in the article and most likely the author simply disabled them.
- account42 7y ago> to do MSAA on a deferred renderer you need to take it into account in your pixel shaders, which in practice means that basically nobody does it I think the bigger problem with doing MSAA with deferred rendering is that your G buffer gets even bigger since you now need to store information for each sample.
- shmerl 7y agoI think it's off by default, but it has a config option: AllowMSAA
- 4cao 7y agoStandard anti-aliasing enabled through the settings menu is FXAA-based, with some temporal processing. MSAA can be switched on by editing the file bin\config\base\rendering.ini in the game directory and setting AllowMSAA=true and MsaaLevel=2|4|8 but the consensus seems to be this doesn't improve things much, while the performance impact is significant. Another setting in the same file, UberSampling=1, could offer a bigger improvement but with an even larger performance hit. The most practical solution, given sufficiently powerful hardware, is probably to enable Dynamic Super Resolution (DSR) via the nVidia Control Panel. Witcher 3 graphics is quite amazing and can get even better with community-created mods. It might take some tweaking to get there but the result can be like this: https://www.youtube.com/watch?v=28lGfkdkJHI https://www.youtube.com/watch?v=28lGfkdkJHI
- corysama 7y agoIf you like this, you'll also like the "Graphics Study" articles of https://www.adriancourreges.com/blog/ https://www.adriancourreges.com/blog/
- fxtentacle 7y agoThank you for sharing this :)
- nhggfu 7y agoamazing work OP.
- rebuilder 7y agoAs a movie compositor, I'm surprised to see so much compositing being done in sRGB space ("gamma space"). I'm used to doing all operations in linear space and only converting to sRGB for display purposes. Here, they seem to employ tricks to work around the issues of non-linear compositing, like making an exclusion mask of the brighter pixels so vignetting doesn't look bad. What kinds of tradeoffs go into deciding to composite in sRGB instead of linear in a game engine? I assume there are good reasons to do so.
- fxtentacle 7y agoMemory bandwidth. Typically linear is using 32 bit float while srgb is using 8 bit integers. So going linear needs 4x more data transfer. There exists 16 bit float, too, but since it became popular with AI, NVIDIA has limited it's performance on gaming cards.
- himinlomax 7y agoThere was the problem of that SGI patent that prevented using floats for framebuffers ... floats make a lot more sense rather than using this gamma nonsense.
- ansgri 7y agoAFAIK in HDR photography they often use linear uint16. I understand that it could be not enough for strong highlight modeling, but for general purpose compositing that should be ok. With an additional layer with like +8 bits of highlight resolution.
- Jasper_ 7y ago32-bit float per color channel would be 128bpp, which is really expensive. You rarely have the bandwidth to afford that.
- lrem 7y agoAh, dear old Nvidia, never fails to extort you.
- redisman 7y agoIs the lighting model of vegetation and trees mentioned in any of the chapters? The sunset lighting up the edges of decals was really what sold me, that and just the stylized graphics - not trying to jump into the uncanny valley. To me it's the best looking environments in a game I have seen.
- HugoDaniel 7y agoblogspot!
- warpech 7y agoNoClip has a nice documentary series on YT about making of The Witcher 3: https://www.youtube.com/watch?v=hWDaiox6QqE&list=PL-THgg8QnvU6WuPJmh19U8cAFjzXHCgvk https://www.youtube.com/watch?v=hWDaiox6QqE&list=PL-THgg8Qnv...