Giter Club home page Giter Club logo

hybridraytracing-unity's Introduction

HybridRayTracing-Unity

Hybrid Ray Tracer made in Unity.

alt text

Getting Started

Add HybridRayTracer.cs script to the main camera in the scene. The script has properties that can be changed from the Inspector. Use the example material to create metallic or glass materials. Unitys default material will be seen as diffuse material by the Hybrid Ray Tracer.

Introduction

Per-Pixel linked list

A Per-Pixel linked list is used to store fragment information that are calculated from Unitys rendering pipeline. The infromation stored in each element is:

  • color
  • normal
  • depth
  • next (pointer to next element)
  • v0 (Vertices of a triangle)
  • v1
  • v2
  • mat (Material property)
  • var (Variable to be used with metal or glass material)

Where v0/1/2 are obtained using a Geometry shader. When the the construction is done fragments that would normaly be discared are now stored in the Per-Pixel linked list to be used in the ray tracing step.

Ray Tracing

The ray tracing step uses screen space ray tracing (from kode80SSR) which visits pixels that are occupied by a given ray. Pixel position given by the screen space ray tracing is used to access the linked list for that pixel. Ray-Triangle intersection test is performed by iterating through the linked list using the vertices position stored in each element.

hybridraytracing-unity's People

Contributors

giskefisk avatar nepetre avatar

Stargazers

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

Watchers

 avatar  avatar  avatar

Forkers

nashnir samixalam

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.