allen-cell-animated / volume-viewer

https://allen-cell-animated.github.io/volume-viewer/
Other
92 stars 7 forks source link

Refactor/Add GLSL file support #119

Closed ShrimpCryptid closed 1 year ago

ShrimpCryptid commented 1 year ago

This refactor adds support for GLSL shader files! .glsl, .frag, .vert, .fs, and .vs filetypes can be imported with the following syntax and will be treated as strings:

import rayMarchVertexShader from "./shaders/raymarch.vert";
import rayMarchFragmentShader from "./shaders/raymarch.frag";

Babel will also automatically import them as inline strings when building. This refactor should make it easier to write and debug shaders with existing linting tools.

This update also moves the shader definitions for path tracing and ray marching into their own separate files.