Giter Club home page Giter Club 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.

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 for mode 13h and mode X assembled and linked separately (32-bit).
  • 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).

  • Sprite drawing with texturing (via video memory in mode X) and alpha test, text rendering with custom fonts.

  • Keyboard interrupt handler for smooth multi-key input.

  • Mouse support via interrupt 33h.

Controls

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

Building

Compiled using Turbo C++ 3 in DOS, Borland C++ 4 or Microsoft Visual C++ 1 in Windows or equivalent. Assembled using Turbo Assembler 5 or Microsoft Macro Assembler 6. File paths in projects may need to be adjusted depending on where the project is placed.

Turbo C++

Building requires Turbo Assembler. The project can also be completely built using the given batch files.

Project file: REND13X.PRJ

Build Mode 13: BUILD13.BAT

Build Mode X: BUILDX.BAT

Borland C++

Building requires Turbo Assembler. Include either R13.ASM or RX.ASM in the project (not both).

Project file: REND13X.IDE

Visual C++

Building requires Microsoft Macro Assembler. Visual C++ won't assemble the .ASM files for you, so they need to be assembled separately before building the project. Include the object files IN.OBJ and either R13.OBJ or RX.OBJ.

Project file: REND13X.MAK

Assemble Mode 13: MASM13.BAT

Assemble Mode X: MASMX.BAT

TODO

  • Improve mode X fills for better plane handling.

  • Clip geometry partially behind the camera.

  • Set custom color palette.

  • Wish list:

    • Geometry loading
    • Bespoke wall/floor/ceiling/sky draw routines
    • Sound
    • Triangle texture mapping
    • 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  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.