Open vorg opened 5 months ago
One could as why do we even have to bother and why pex-context is not auto-upgrading it for us?
Another option build a online tool when we can upgrade our code by copy paste and stop using parser.
What do you think @dmnsgn
I think parser.patchES300
is purposely verbose as it should be a relic from the past by now and we are willing to remove it entirely.
The current solution (as of Jan 2024) is:
That works beautifully in pex-renderer v4 alpha and has the following pros:
And cons:
That's for current status.
We reached the conclusion that –now that Safari caught up– WebGL 2 has enough worldwide support so we should entirely drop WebGL1. In a soonish future that means:
PS: I still don't see any obvious GLSL -> WGSL bridge without DSL extracting shader variables and providing different body like I did in dgel:
Ok. I missed that defines SOTA. It kind of brings back the question of Shift from framework to library #9 as those defines are in final shaders that could be in pex-renderer instead of here.
Re. glsl/wgsl we could got further into thi.ng/umbrella and copy ThreeJS approach with DSL in JS/TS. https://github.com/thi-ng/umbrella/tree/develop/packages/shader-ast. There is no WGSL front end yet, only glsl.
const sinc = (x: FloatTerm, k: FloatTerm) =>
div(sin(mul(x,k)), mul(x, k));
Not sure how does it feel to write whole PBR shader in this though... Seems like 6 months project.
Current approach is verbose and error prone
The alternative approach is much more readable
Downsides:
But for comparision i don't think this is better
Maybe it should be the parser that is typed?
to
then you could switch language by switching import (in my dreams..)