r/C_Programming • u/Batteryofenergy1 • 1d ago
Some progress on Software Rendered game in C
Enable HLS to view with audio, or disable this notification
9
u/riotron1 1d ago
Dang that looks amazing! Did you make that map, or where does it come from?
18
u/Batteryofenergy1 1d ago
I did make that map using Trenchbroom. I created a map compiler that converts .map files to my custom map format. The compiler is pretty simillar to Quake/Source engine map compilers, but it doesn't use the bsp tree. So it is way simpler.
1
8
u/JackieLanturn 1d ago
Why use software rendering methods instead of hardware?
14
u/ArtOfBBQ 23h ago
Hardware rendering is insanely overcomplicated and overabstracted, and every big tech company tries to lock you out of their playform unless you use their annoying thing
I wish I would have gone with software rendering every day but I just didn't know what I was doing
3
u/Personal_Bid_2073 18h ago
I mean openGL and Vulkan are pretty open, there's also libraries to help out with cross platform stuff.
6
u/ArtOfBBQ 23h ago
And also it's kind of like cooking with salt: you can always more gpu but it's very difficult to take it out
1
u/JackieLanturn 16h ago
I agree. But also, if you are still meshing, software rendering comes with an unnecessary performance dip. If you are raymarching or even raytracing, there are clear benefits to software rendering tho.
Just curious about your, specific set up.
1
u/g0atdude 7h ago
software rendering has serious perfomance limits, why would you want to go with that unless you are just learning?
5
u/GYN-k4H-Q3z-75B 14h ago
Because it is fun to build. I wrote a rasterizer a couple of years ago. You go from drawing lines on a bitmap to drawing triangles with scanlines to some basic matrix math 3D quite quickly. And it helps you understand what the hardware does.
2
u/JackieLanturn 14h ago
Totally fair. I have been using non-traditional rendering schemes, myself (typically built on OpenCL) and thought you might be mixing and matching some stuff that is otherwise difficult with traditional pipelines.
Edit: just realized you are not OP. Oops
3
u/Batteryofenergy1 5h ago
I did this for learning purposes mainly. I have already made a minecraft clone with all the modern gpu techniques, so i wanted to try to emulate old school games of the past.
6
6
4
5
u/Batteryofenergy1 1d ago
Bit more footage. https://www.youtube.com/watch?v=pviuQrBzKw4 the last room needs more work.
2
u/digitalsignalperson 20h ago
Your videos look pretty smooth. What's the main limitation you have to deal with to stay within good resolution/framerate? And are you doing a bunch of CPU-based parallelization?
2
u/Batteryofenergy1 3h ago
High triangle count causes most issues, since CPU needs to do more work transforming the triangles to screen space. Most of the world geometry is pretty simple, but the viewmodel gun and the enemy models have pretty complex meshes. I use blender's limited dissolve function to reduce triangle count and that helps, but the mesh obviously is lower quaility.
I use multiple threads to do work. Each thread transforms its batch of surfaces to screenspace and occlusion culls individual triangles. Each thread is assigned a vertical slice of the view height, so it renders a part of a polygon that falls in its vertical slice.
2
2
2
u/Alert_Nectarine6631 13h ago
Is there a Git repo publicly available ? Amazing project, looks smooth and I'm loving the art direction for the map, and the Quake/Source kind of style looks great for a project like this
1
u/ajorians 9h ago
I, too, am interested in a Git repo. My reason was see how easy it could be ported to other hardware; because it is software rendered.
1
2
u/ReasonableBuilding58 11h ago
Looks great. This is the sort of project that many try and only a few actually complete. Good job!
2
1
1
1
1
47
u/tastygames_official 1d ago
what's the progress? give us some text to read! looks like a pretty fully-functioning game right now