Skip to content

Latest commit

 

History

History
52 lines (40 loc) · 1.74 KB

README.md

File metadata and controls

52 lines (40 loc) · 1.74 KB

IESNA

TypeScript library for parsing and rendering the
IESNA LM-63 Photometric file format

About

This project is heavily based on the original publication "Parsing The IESNA LM-63 Photometric Data File" and its accompanying source code, which can be found here.

Usage

To render an IES document to an HTML canvas using this library:

import * as IESNA from "iesna";

IESNA.renderToCanvas({
  iesData: IESNA.parse("IES document goes here"),
  canvas: document.getElementsByTagName("canvas")[0],
});

In addition to IESNA.renderToCanvas(), light sampling can be done using IESNA.sample(). This function takes an IES data object and an x,y,z coordinate in light space and returns the light intensity at that position.

const iesData = IESNA.parse("IES document goes here");
const intensity = IESNA.sample({ iesData, x, y, z });

Demo

There is a demo of rendering IES documents in the browser available here.

To run it locally: npm install && npm run dev.