Skip to main content
gamedev.net
🔒 Locked

Software based rendering?

Started by DevLiquidKnight 5 replies 500+ views
Original Post
DevLiquidKnight
DevLiquidKnight
I was wondering how do people create there own software rending devices without the usage of OpenGL or DirectX? Anyone know how this is done? I mean the thought of a rending device using just basic 2d graphic functions to perform the creation of 3d worlds kinda makes me feel lost? How is this done?
falkone
falkone
There are a number of ways to do it. You can learn how to render in software by picking up nearly any (moreso games) graphics programming book written before 1996. Andre LaMothe''s new Tricks of the Game Programming Gurus 2 book teaches how to render in software from the ground up. If you''re really feeling adventerous, you could figure out how to write your own simple renderer. Advanced topics such as perspective-mapped textures can quite excusibly require some help, but i''ve seen working renderers made by rather average 14 year olds.
Disclaimer: "I am in no way qualified to present advice n any topic concerning anything and can not be held responsible for any damages that my advice may incurr (due to neither my negligence nor yours)" o
nonnus29
nonnus29
A software renderer (and 3d gfx apps in general) consists of a few basic parts:

1. A library of vector functions
2. A library of matrix functions
3. A library to draw triangles on your buffer.
4. A higher system of abstraction, minimally objects and meshes up to bsp, quad, or oct trees.

The very basic process is:

load your vertices
transform your vertices
clip the vertices in 3d space now
or clip when you draw them
project the vertices to the screen
draw the polygons from the projected vertices
repeat

Its not simple by any stretch of the imagination. There are ALOT of tutorials around the net if you look hard enough. Oh yeah, get used to reading other peoples code:

Mesa is a good place to start (a software implementation of opengl with freely available source).

falkone
falkone
quote:
Original post by nonnus29
1. A library of vector functions
2. A library of matrix functions
3. A library to draw triangles on your buffer.
4. A higher system of abstraction, minimally objects and meshes up to bsp, quad, or oct trees.



These listed items are irrelevant to a renderer, though they are most desireable for the rest of the graphics engine. All a renderer needs is an atomic shape (assuming that you''re doing a polygon-based engine) and the means to display that on the screen (with the other things you have mentioned, such as clipping and projection). I don''t think that I would bother implementing all those features were I just making a renderer for the pure fun of it.

Disclaimer: "I am in no way qualified to present advice n any topic concerning anything and can not be held responsible for any damages that my advice may incurr (due to neither my negligence nor yours)" o
YoshiN
YoshiN
quote:
Original post by Anonymous Poster
quote:
Original post by falkone
quote:
Original post by nonnus29
1. A library of vector functions
2. A library of matrix functions
3. A library to draw triangles on your buffer.
4. A higher system of abstraction, minimally objects and meshes up to bsp, quad, or oct trees.



These listed items are irrelevant to a renderer, though they are most desireable for the rest of the graphics engine. All a renderer needs is an atomic shape (assuming that you''re doing a polygon-based engine) and the means to display that on the screen (with the other things you have mentioned, such as clipping and projection). I don''t think that I would bother implementing all those features were I just making a renderer for the pure fun of it.



Umm if you can''t tranform points and you dont'' have vectors to represent a vertex then your going draw what? how?



You don''t need vectors or matrices to render 3D objects. Matrices are used a lot because they a) simplify some of the math (although it''s more complicated for the computer often) and b) you can concatenate matrices. You can just as easily do:

x = d*x/z;
y = d*y/z;

instead of using a projection matrix.
-YoshiXGXCX ''99
nonnus29
nonnus29
quote:
Original post by falkone
These listed items are irrelevant to a renderer, though they are most desireable for the rest of the graphics engine. All a renderer needs is an atomic shape (assuming that you're doing a polygon-based engine) and the means to display that on the screen (with the other things you have mentioned, such as clipping and projection). I don't think that I would bother implementing all those features were I just making a renderer for the pure fun of it.



Drawing flat shaded polygons is trivial; in fact I think windows gdi has a draw_filled_polygon() function. If someone wants to create an interactive software renderer then they can of course use straight trig functions.

However matrix and vector tutorials and example code are abundant and easily implemented so to me it seems a bit of a waste not to use them. Same goes for drawing gauraud shaded polys, affine, and perspective correct textured polys. Besides one must use vertex normals to implement gauraud shading.

[edited by - nonnus29 on January 9, 2004 12:48:01 AM]

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.