Coder Social home page Coder Social logo

sejja / 2d-software-rasterizer Goto Github PK

View Code? Open in Web Editor NEW
3.0 1.0 0.0 4.99 MB

Implementation of a CPU-based 2D shading rendering engine

License: MIT License

Tcl 0.36% C++ 99.46% C 0.18%
cplusplus rendering rendering-2d-graphics shading software-rendering

2d-software-rasterizer's Introduction

2D Software Rasterizer

Ask Me Anything ! License

Project Preview

Features

⚡️ Line, Sphere and Triangle Rasterizations ⚡️ Space Transformations ⚡️ Shading ⚡️ Sampling ⚡️ Viewports ⚡️ Blending ⚡️ Cameras ⚡️ Clipping and Culling

Demo Stages

				    Sprite Sheet Animation

You can adjust the tileset rendering options using the GUI provided, such as: -Number of Rows -Number of Columns -Playback speed -Loop -Animation Tileset

You are also allowed to pause and reset the animation at any time.

				    Texture Transformation

You can adjust the rendering options using the GUI provided, when tiling, you can change: -Tiling Options -Horizontal Tiles -Vertical Tiles -Size of Image

When Cropping you can: -Adjust the cropping edges via GUI -Crop using the mouse (Left click to select starting point, then move the mouse to cover the desired area and left click again)

In all instances, you can change the sprite used. Disclaimer: Cropping a Tiled image was not implemented.

				     	 Tile Map

You may adjust the rendering optimizations of the tilemap with the presets shown on the GUI. You are also able to Save and Load Tilemaps (A sample tilemap is provided in Data/Sample Tilemaps/). The camera is movable through the ASDW keys.

				      Polygon Editor

Create a new polygon by Clicking "Create new polygon" and add Vertices by cliking into the window. Once you have created a Polygon, you will be able to select it from the palete and: -Change it's name. -Delete it. -Change it's vertex position values. Disclaimer: UV's do have bugs.

				       Image Ereaser

You may place images on the screen with Right Click while holding SHIFT You can erease the image by pressing CTRL and moving the mouse around the window while you keep the right mouse button pressed More options are available through the GUI, such as: -Change the Object name. -Make the Object Rotate over time -Change Background Color. -Select a new Sprite (which will be applied to the new objects) -Reset the Scene.

				      	   Culling

Objects will be randomly generate a scene. You will be able to move the camera through the WASD keys. The GUI will allow you to toogle Culling on and off. If culling is activated, you will also be able to activate Forward culling for an even more noticeable performance boost. You can change the sprite of the objects with the "Change sprite button" You can right click on the window to place new objects. The number of rendered objects will be displayed on the screen and updated real-time.

					   Lighting

Disclaimer: This Demo is partially implemented You can move the mouse over the scene to see how the light casting works in a 2D scene. You can Press CTRL to light the scene using Polygon Drawing (contains some bugs).

Installation & Deployment 📦

  • Clone the repository
  • Open and build using Visual Studio 2023

Tools Used 🛠️

  • Alpha Engine - Minimal API to display framebuffers onto the screen. We also use it's math library, and window creating utilities.

License

License

NOTE: All images used in this project are copyright-free and available for non-commercial use

2d-software-rasterizer's People

Contributors

sejja avatar

Stargazers

 avatar  avatar

Watchers

 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.