35 ms·
Dear God, the solution is insane! That is mind-blowing... emulating the whole pipeline?!?! People who do emulation are, quite simply, the very, very best of us
by chris_wot 9y ago
Dear God, the solution is insane! That is mind-blowing... emulating the whole pipeline?!?!
People who do emulation are, quite simply, the very, very best of us.
My other take away is: just don't bother getting an Nvidia card if you can avoid it.
- sillysaurus3 9y agoNo, not really. It's not hard to write a graphics pipeline emulator. Those who believe a software rasterizer is difficult simply haven't spent much time trying to write one. Making it correct is much more difficult than making it at all. I'd be shocked if their emulator got the basics correct in every detail. Example: Texture wrapping occurs by taking the UV texcood modulo the texture size. But since a texcoord can be negative, your modulo operation has to account for that at the boundary between positive and negative, or else you end up with truncated texels. It doesn't sound like they were really writing a rasterizer, but it's the same concept.
- chris_wot 9y agoI guess I'm one of those :-) I still have massive respect for these guys.
- sillysaurus3 9y agoYeah, I didn't mean to minimize the achievement. I just meant if you're interested, you should try it! It's fun.
- mrspeaker 9y agoAnd if you do want to try it, I recommend this as a starting point: https://github.com/ssloy/tinyrenderer/ https://github.com/ssloy/tinyrenderer/ - straightforward and satisfying to get a 3D model up on screen. It really helped me start building an understanding of how the a pipeline might be implemented.
- TazeTSchnitzel 9y ago> But since a texcoord can be negative, your modulo operation has to account for that Is that the fmod(fmod(a, b) + b, b) thing, or something else? I still wish that was the default behaviour in more languages…
- sillysaurus3 9y agoIf you like this kind of thing, http://chrishecker.com/Miscellaneous_Technical_Articles http://chrishecker.com/Miscellaneous_Technical_Articles is an excellent resource. It points out all of the fiendish corner cases lurking in a standard rasterizer. http://chrishecker.com/images/9/97/Gdmtex2.pdf http://chrishecker.com/images/9/97/Gdmtex2.pdf page 21 has a correct FloorDivMod function.
- phire 9y agoIt doesn't quite emulate the whole 3D pipeline, but it emulates the entire pixel and vertex stages. If anyone is interested in checkout out the massive ubershdaers, I've stashed a copy here: https://gist.github.com/phire/25181a9bfd957ac68ea8c74afdd9e9e1 https://gist.github.com/phire/25181a9bfd957ac68ea8c74afdd9e9...
- chris_wot 9y agoSo if I read the article right, this shader emulates those parts of the rendering pipeline of the GameCube/Wii... which to my mind still just sounds absolutely amazing - does this mean you've had to implement any quirks of the devices into the shader? Also - does this generalise to other rendering pipelines for other devices do you think?
- phire 9y agoYeah, Though we had already implemented all those quirks in the old generated shaders. The main difference with ubershaders is skip the shader generation/compilation and directly interpret the raw shader binary . > Also - does this generalise to other rendering pipelines for other devices do you think? Modern shader cores are more or less Turing complete, so you should be able to do the same on any other rendering pipeline which fits into 'opengl pipeline model', including other modern GPUs. Though, while it might be possible to run modern shaders in this manor, it won't run fast enough, because you will have to spill some (or even a lot) of the shader's state to the host GPU's main memory. Ubershaders work well for dolphin because the entire mutable state of the GameCube's pixelshaders fit into the available registers, with plenty of space left over. I assume it will work well for other DirectX 8 or even DirectX 9 era GPUs.
- pzone 9y agoThis is utter insanity. Bravo.
- rasz 9y agoafaik MESS Sound Blaster subsystem emulates embedded 8051 responsible for handling ISA DMA requests.