Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

peter_b

How can software rendering be fast?

This topic is 5277 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Somtimes i see these oldgames rendering in software, and iv been wondering how it is done? I recently reinstalled halflife on my laptop, and i almost didn''t notice that it ran in software by default. Locking the backbuffer and plotting 640x480 and even higher resolutions aint even fast on todays computers.. And the hardware blitter can only copy rectangles right? So how did games like halflife, tombraider and quake do it?

Share this post


Link to post
Share on other sites
Advertisement
For the most part, by writing hardware-specific functions.

Correct me if I''m wrong though, but didn''t half life use the quake 2 engine (which was OGL based?)

Share this post


Link to post
Share on other sites
Where have the ASM and optimization gurus gone ? *sigh* Sometimes I think that hardware accelerated 3D has finally eradicated this brilliant but oh so rare species (and spoiled the rest)...

Who here remembers the trick to address a texture as separate 4x4 patches, in order to save two opcodes in the rasterizer loop, and to keep it in the first level cache ? Who remembers the ADC trick, using the carry flag to avoid an additional instruction ? Damn, I feel old.

To answer your question: you would be surprised how fast and good software rendering can be, if written by a good coder. The key words are: efficient algorithms, efficient data organization, bloat removal, hand written ASM, and optimization, optimization, optimization. Long forgotten arts, if you ask me.

PS: Watch this, and you''ll know how good SW rendering (well, raytracing in this case) can be.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
it used the quake(1 or 2?)software renderer as well

Share this post


Link to post
Share on other sites
quote:
Original post by ALX
Where have the ASM and optimization gurus gone ? *sigh* Sometimes I think that hardware accelerated 3D has finally eradicated this brilliant but oh so rare species (and spoiled the rest)...

*cough**cough*friggin''awesome*cough*


"Sneftel is correct, if rather vulgar." --Flarelocke

Share this post


Link to post
Share on other sites
Oh, and being an "ASM Guru" may be great on paper, I''d personally rather not wait 10 years for a new game to come out.

Share this post


Link to post
Share on other sites
quote:
Original post by Etnu
For the most part, by writing hardware-specific functions.

Correct me if I''m wrong though, but didn''t half life use the quake 2 engine (which was OGL based?)

Half-Life used the Quake engine as a base, but they modified it very very much. As for Quake 2, it had a software renderer as well as a OpenGL renderer.

Share this post


Link to post
Share on other sites
quote:
Original post by peter_b
So how did games like halflife, tombraider and quake do it?

If you want to know how Quake did it you can download the source code. There''s also a series of articles by Michael Abrash (who wrote the Quake engine along with John Carmack) explaining many of the tricks. I believe they''re linked here somewhere. Quake was designed to run with decent performance in software on a 100MHz Pentium so it''s hardly surprising that you can get good performance in Half Life (based on a heavily modified Quake I engine) on today''s machines which are up to 40x faster.

Share this post


Link to post
Share on other sites
quote:
Original post by Etnu
Oh, and being an "ASM Guru" may be great on paper, I''d personally rather not wait 10 years for a new game to come out.

This is a most ignorant comment.

Share this post


Link to post
Share on other sites
quote:
Original post by Sneftel
*cough**cough*friggin''awesome*cough*


Nice. So they haven''t completely died out yet, good to know

quote:

Oh, and being an "ASM Guru" may be great on paper, I''d personally rather not wait 10 years for a new game to come out.


Noone would ever code a whole game in ASM. But knowing how to write good ASM will make you see your high level code with totally different eyes. It tends to make you avoid bloat, ridiculously inefficient constructs, and other algorithmic optimizations the compiler can''t catch (and those are often found in production quality code nowadays, unfortunately). Knowing ASM and the principles of writing efficient code can definitely make you a better C/C++/C#/Java/* programmer.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!