It depends on how the shader file (./shader/fxaa
, in your example) is written. If you are writing this shader file yourself, you could do something like this:
const fxaa = 'my shader code here';
export { fxaa };
And then use this shader code:
import { fxaa } from './shader/fxaa';
const fxaaShader = new fxaaShader(fxaa);
Alternatively, you could write the shader file (./shader/fxaa.json
) like this:
"my shader code here"
And require this file as a JSON object:
const fxaa = require('./shader/fxaa.json');
const fxaaShader = new fxaaShader(fxaa);
./shaders/fxaa
) looks like? – Zoom