Path-tracing in BabylonJS

I guess I’m not following what you’re asking here – when the <script> tag with ShadersStoreInclude.js is loaded, the statements in it are executed. The three statements in there define the screenCopyFragmentShader, screenOutputFragmentShader, and pathTracingFragmentShader to be part of the global BABYLON.Effect.ShadersStore – what I think you’re talking about is breaking it down a step further, like in the pathTracingFragmentShader:


// common defines, will eventually be placed in BABYLON.Effect.ShadersStore[]
#define PI               3.14159265358979323
#define TWO_PI           6.28318530717958648

The goal being to make separate includes files for each of those types of reusable pieces of functionality?
@PichouPichou - Regarding TS and modules – Having played with the code and poked around with some refactoring approaches, I think that there’s a bunch of foundational refactoring that will need to happen in order to begin that process, but getting the code to be ES6-friendly without involving webpack or other types of transpilation would be where I would want to start. It’s a tough call because in order to continue to make progress sort of precludes that type of work at the moment, but in order to be able to effectively accept and manage other contributions that kind of thing is necessary!

Ed: that said, if we can get this code into a place where it’s runnable in the PG I think it would really open the doors for community contribution

2 Likes