GithubHelp home page GithubHelp logo

raytracer's Introduction

Raytracer

A faily traditional raytracer.

Functionality implemented so far.

Primitives

  • Spheres
  • Triangles
  • Planes
  • Meshes loaded from wavefront obj files. Supports mtl files
  • Multiple instances of those Meshes, independently transformed
  • Tori (Toruses, Donuts....Mmm Donuts!)
  • Cylinders
  • Cubes
  • Cones

Effects

  • Reflections
  • Refractions

Various Materials

  • Plain RGB materials defined with Ambient, Diffuse etc etc etc.
  • Checker Board of two submaterials.
  • Perlin Noise mix of two submaterials.
  • Texture material. UV coordinate calculations are specific to each primitive type. All common image file formats are supported via the .net framework.
  • Cubemaps, both vertical and horizontal crosses, are supported for scene backgrounds. When a ray misses all objects in the scene we render from the cubemap.

Lights

  • Point Light - Simple light at a point in space casting light in all directions. Obeys the inverse square law and can cause shadows.
  • Ambient Light - Has no position and contributes the same light to every point in space. Casts no shadows.
  • Spot Light - Like a point light but has a direction and width in addtion to position. It casts a cone of light along its direction. The width determines the angle of the cone. Casts shadows.
  • Distant Light - Has no position but does have a direction. Useful for simulating the sun for example. Casts shadows.
  • Projection Light - Like a spot light but projects a texture into the scene. Think overhead projector and you'll not be far off.
  • Area Lights. Currently just Spherical but I will expand to disc and quads. Custom sampling threshlold per light. Casts soft shadows.

Lights and most primitives take a Transform object instead of explicit positions, rotations etc. The new file format then has several methods of producing a Transform. Explicit translations and rotations, lookat matricies, axis angles etc and they could all be used where ever appropriate.

File Types

  • XML Based renderer and scene definition files.
  • Wavefront obj files.
  • Wavefront mtl files.

Antialiasing

  • Multiple antialiasing algorithms possible. Currently implemented are :
  • Non anti aliased,
  • Progressive rendering. 64px square regions followed by 32px etc.
  • NxN jittered samples per pixel
  • Greyscale Edge Detection Jittered Resampling.
  • Per Component (RGB) Edge Detection Jittered Resampling.

Accelleration Structures

  • Octree
  • Bounding Volume Hierarchy, AABBs in my case.
  • Multi Axis Midpoint Split Criteria
  • Multi Axis SAH Split Criteria

Sampling Stratigies

  • Random
  • Stratified

Still to come

Bump mapping, more area lights and a path tracer implementation and a BRDF system.

Examples

  • Refraction needs some work in this one Flawed refraction
  • Reflective sphere and cubemap Flawed refraction
  • Refractive sphere and cubemap Flawed refraction
  • Colourful room Flawed refraction
  • Mesh instances Flawed refraction
  • Texture mapped triangles Texture mapped triangles
  • Texture mapped sphere Flawed refraction
  • Perlin noise mixing base materials, red, yellow and texture. Flawed refraction
  • Mesh self shadowing. Flawed refraction
  • Torus. Mmm.Donuts
  • Refractive Torus. Mmm.Donuts
  • Transformed Tori. Mmm.Donuts
  • Mesh instancing and transformations. Cars
  • Mesh instancing and transformations. Companions
  • 280 interlinked tori with various levels of reflectivity and refraction. chain mail
  • Cylinders. They support all the usual materials. cylinders
  • Texture Coordinate Wrapping. texture coordinates
  • 1,087,474 triangle Happy Buddha. SAH BHV
  • Spot lights. spots
  • Projector light. projector light
  • Cryteks version of the Sponza Model. Still work to do projector light
  • Four Spherical Area Lights. 256 shadow rays per light. sphere area light
  • Soft Shadow from area light. shoftshadows
  • New cube primitive Supports arbitrary scaling. shoftshadows
  • Scaled Torus scaled torus
  • Cone primitive displaying reflection. scaled torus
  • Cylinders with soft shadows. Cylinders with soft shadows
  • Meshes from xml file format. XML File format loading meshes
  • Same mesh rendered with 512 shadow rays for a spherical area light. Total render time was 4hr 47min. XML File format loading meshes
  • Stanford Dragon model, 128 shadow rays. 1 hr 47 mins rendering time. XML File format loading meshes
  • Refractive Stanford Dragon model. Glass material. Two sphericsal area lights and 128 shadow rays each. 23 hr 58 mins rendering time! XML File format loading meshes

That's all for now.

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.