Coder Social home page Coder Social logo

stephensmitchell-forks / safegi Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ouj/safegi

0.0 2.0 0.0 12.9 MB

implementation of safegi: an rendering system with dimensional analysis.

Home Page: https://jiawei.ooo/safegi/

CMake 0.42% C++ 89.73% C 3.33% Shell 0.01% Batchfile 0.01% Yacc 1.07% Lex 0.14% M4 4.20% XSLT 1.10%

safegi's Introduction

overview

This package contains the source code implementation of our safegi paper.

build

MacOSX

cd src
./cmake-xcode.sh

Linux

cd src
./cmake-mk.sh

execution

run the executable directly, the images will be generated in the same folder. Image files are ppm format, it can be convert to other formats using ImageMagick.

folder structure

README.md

This file

###[libs]### Library source code folder.

####[libs\tsafegi]#### typed SafeGI library

  • dimensions.h -- contains the dimension definition and dimension analysis implementation mentioned in section 3.1.1 Dimensional Analysis.

  • real.h -- basic real number and tuple type without dimension.

  • m_real.h -- real number type and tuple types with dimensional constraint.

  • m_units.h -- units definition, such as meters, seconds, degrees..

  • m_spectrum.h -- spectrum type with dimensional analysis

  • spaces.h -- basic space definition, such as shape_s, world_s, local_s, mentioned in section 3.1.1 Space Analysis

  • m_geom.h -- geometry type with space analysis implementation mentioned in section 3.2 Geometric Space Analysis.

    • point. contains x,y,z components stores Cartesian coordinates in length dimension.
    • vector. contains x,y,z components in length dimension.
    • direction. directional vector, which is normalized to length 1. Contains x,y,z components in unit dimension.
    • normal. specific direction type represent surface normal
    • rigidmap. rigid mapping type used to transform point, vector, direction and normal from one space to another.
  • xform.h -- transform class definition

  • linalg.h -- basic linear algebra operation definitions.

  • lens.h -- lens class used to generate ray samples.

  • m_sampling.h -- different sample types, such as shadow sample, lens sample direction sample and brdf sample.

  • direct.h -- direct lighting integrator.

    • spectrum<radiance_d> l(..) compute radiance spectrum for lens sample point p and direction w.
    • spectrum<radiance_d> le(..) compute emission radiance spectrum of the surface.
    • spectrum<radiance_d> ld(..) compute direct illumination radiance spectrum of the surface.
  • path.h -- path tracer integrator.

    • spectrum<radiance_d> li(..) compute indirect illumination radiance spectrum of the surface
  • brdf.h -- brdf for materials, including Lambert, Phong and mirror. The brdf class is defined similar to BxDF class in PBRT.

    • spectrum<brdf_d> f(..) return the brdf spectrum according of the brdf.
    • spectrum<rho_d> rho(..) return the rho spectrum of the brdf
    • brdfSample<local_s> sample(..) return the brdf sample of the brdf.
    • mreal<invsolidangle_d> pdf(..) return the pdf.
  • scene.h -- definitions for scene objects, such camera, light and materials.

  • source.h -- point light source and area light source.

  • shape.h -- base shapes, including sphere, quad and triangle.

  • mesh.h -- triangle mesh shape.

  • bbox.h -- bounding box class.

  • tracer.h -- ray tracer class

  • tracerutils.h -- utility class for ray tracing.

  • type_trait.h -- type trait deduction facilities used to impose type constraint between CPU-end and GPU-end of the SafeGI GPU renderer.

  • safe_gl.h -- typed OpenGL wrapper functions used by SafeGI GPU renderer.

  • common.h -- common header

  • image.h -- image class for rendering outputs.

  • std.h -- standard C++ STL header

  • stub.cpp -- an empty cpp file

####[ libs/gi_aux ]#### SafeGI auxiliary classes.

  • bunny.cpp -- bunny data
  • fileio_t.h -- image I/O functions
  • test_scene_t.h -- test scene generation utilities
  • timer.h -- timer class.

####[ libs/sparser ]#### SafeGI GLSL parser for type checking.

  • aux_data.cpp -- parser auxiliary data structures.
  • aux_data.h -- parser auxiliary data structures.
  • context.cpp -- parsing context
  • context.h -- parsing context
  • parser.y -- bison file for parser.
  • predef_symbols.h -- pre-define file for dimensions, spaces and built-in functions mentioned in section 3.1.2 in the paper.
  • scanner.l -- flex file for scanner.
  • type_checker.cpp -- SafeGI GLSL type check interface
  • type_checker.h -- type check interface
  • unistd.h -- unix header

###[ apps ]### Application source code folder.

####[ apps/tsafegi_gl ]#### Source code folder for typed SafeGI GPU renderer.

  • gl_renderer.cpp -- Source file for GPU renderer class. This class demonstrate how our SafeGI interface is used to create type safe GPU rendering program.
  • gl_renderer.h -- GPU renderer class header
  • shader_src.cpp -- Typed GLSL source code for point light, area light and shadow mapping.
  • shader_src.h -- Typed GLSL source code header
  • main.cpp -- Main entry point of the typed SafeGI GPU renderer the program.

####[ apps/tsafegi_ray ]#### Source code folder for SafeGI CPU renderer.

  • main.cpp -- Main entry point of the typed SafeGI CPU ray tracer program.

safegi's People

Contributors

ouj 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.