Giter Club home page Giter Club logo

fpga_ray_tracer's Introduction

FPGA Ray Tracer

A Simple Ray Tracing Engine implemented in hardware

render

arch

Project Organization

  • /software_model contains the software ray tracer model this GPU design is based on.
  • /fpga_ray_tracer_hw contains the SystemVerilog source files for the design and simulation sources

Design log

  • Started with figuring out what data types and arithmetic I'll need
    • floating point data type and arithmetic is vital. IEEE 754 32 bit floating point seems like a popular and straightfoward type. However, I'm not sure if the complexity is worth it. Let's go ahead with this for now, will contemplate later if optimization is necessary. Can look into separate data types for unit vectors and other vectors for efficiency later. Fixed point is probably a better idea.
    • Vivado provides ips for all kinds of floating point operations, how convenient! They use AXI Stream protocol.
    • On closer inspection, I cannot bear the amount of resources that floating point arithmetic will overall consume. Stuff like generating random floats and so on. Let's go head first into fixed point.
    • Going with Q18.14 fixed point for all arithmetic.
  • Ideated the architecture on paper. A ray generator that'll generate rays and assign it to one of the ray tracing cores, with a pixel accumulator storing the color for the pixel and outputting it or saving it in memory.
  • Let's start by building the ray generator, which will generate a random ray within each pixel for each sample.

    • Implemented psuedo rng for generating random rays within each pixel.
    • Runs very ineffecicient (area-wise) logic for now, will change later if required.
    • Generates a random ray for each pixel for each sample at each clock cycle.
    • Plotted the output using matplotlib to confirm they're actually how I expect them to be (uniformly distributed with correct ranges). Seems alright.

  • Now Working on the pixel accumulator that'll average out color values for each sample and convert it to 24 bit RGB format to be stored later

    • Also implemented a fix3 to RGB module that converts color data in a fixed (ranged 0 to 1) to 24 bit RGB color for storage/display.
  • Now let's implement a primitive ray core that just returns the background color and pixel accumulator and start working towards our first render!

    • Making a single core system for now, will worry about parallelization and pipelining later.

fpga_ray_tracer's People

Contributors

b-init avatar

Stargazers

 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.