stosb

wearer of programming socks

  • she/her

mid 20s | bisexual | programmer | european


profile pic: a picrew by Shirazu Yomi
picrew.me/en/image_maker/207297
i use arch btw
xenia the linux fox -> 🦊🏳️‍⚧️
the moon
🌙

rohit
@rohit

Far Cry's leaked source code has three renderers - D3D9, OpenGL and one the programmers called XRenderNULL. This "null" renderer, as the name implies, doesn't do any rendering to the screen - it doesn't even create a window. It uses the same API as the other renderers, but does the bare minimum setup so that the rest of the game will happily chug along - for example, the text rendering code will still load fonts in the data files and calculate texture coordinates that are ultimately discarded when it comes time to draw.

This obviously has no value to players, but it has been useful in porting the rest of the code to Linux and getting some binary to build and run. Most games are written for only one rendering API and will immediately exit if it fails to initialize, such as not being able to create a D3D render device or acquire an OpenGL context. Instead of worrying about that, I can fix other issues in the code, like finding the right path to load data files and shared libraries. Since the null renderer doesn't create a window, I can debug using SSH from my Windows machine, allowing me to move back and forth to make sure my changes in other parts of the code are doing the right thing.

Looking at the leaked code, it seems like CryTek made the null renderer so that they could release a Linux dedicated server, but I'm sure it would have been a useful starting point to write a renderer for different platforms like consoles. My own game has an unmaintained null renderer that doesn't build, but working with Far Cry is giving me the itch to fix it up.

I wonder what other game engines have a null renderer in their code. I know LithTech's does.


You must log in to comment.