Code Monkey home page Code Monkey logo

rend13x's Introduction

REND13X software renderer

VGA software renderer written in C and x86 assembly. Mode 13h (320x200) or mode X (320x240), 256 colors.

The purpose of this project is to explore early game engine development and x86 assembly graphics programming.

Compiled using Turbo C++ 3 or equivalent (supporting inline assembly). Assembly versions assembled using Turbo Assembler 5. The program can be compiled using the project file REND13X.PRJ or batch file BUILDC.BAT (inline version). Assembly versions built using BUILD13.BAT and BUILDX.BAT. Runs on real hardware (DOS, i486 or equivalent) or in DOSBox.

FEATURES

  • "Fast" x86 assembly draw routines for line drawing and triangle fills.

    • Two video modes: mode 13h or mode X, define MODE13 or MODEX in RENDER.H to enable/disable.
    • Line drawing is implemented using Bresenham's algorithm (mode 13h line draw is faster).
    • Triangle filling is implemented in two ways: a non-clipped inaccurate fast fill (using fixed-point) and clipped accurate slow fill (using Bresenham's algorithm), define FASTFILL in RENDER.H to enable/disable.
    • Graphics routines written in assembly are available inline in C (16-bit) or assembled and linked separately (32-bit), define ASM in the corresponding C file.
  • 3D perspective projected triangle draw with z sorting, geometry clipping, face culling and wireframe rendering.

  • Simple vector/matrix math and transforms.

  • Page flipping in mode X (double buffering).

  • Keyboard interrupt handler for smooth multi-key input.

CONTROLS

Key Action
WASD Move
Arrows Rotate camera
R Fly up
F Fly down
Esc Exit to DOS

TODO

  • Improve mode X fills for better plane handling.

  • Clip geometry partially behind the camera.

  • Set custom color palette.

  • Wish list:

    • Sprite rendering
    • Text rendering
    • Bespoke floor/ceiling/sky draw routines
    • Sound
    • Texturing
    • Z-buffer

rend13x's People

Contributors

roninkoi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.