Skip to content

sortofsleepy/parcel-plugin-glslify

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

parcel-plugin-glsl

Import .glsl files as strings with parcel. The shader contents are available as the default export of the file.

This expand's on @seep's version by adding support for other file types including

  • .vert
  • .frag
  • .vs
  • .fs

This also includes glslify support. You'll have to make sure to include that in your package.json as well.

Example

import { ShaderMaterial } from 'three';
import vertexShader from './vert-shader.glsl';
import fragmentShader from './frag-shader.glsl';

export function CustomShaderMaterial() {
  
  return new ShaderMaterial({
    uniforms: { ... },
    vertexShader,
    fragmentShader,
  });
  
}

About

A parcel plugin for GLSL files

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%