mikialex / artgl Goto Github PK
View Code? Open in Web Editor NEWTypeScript 3D framework
TypeScript 3D framework
Use per shader count instead of clamped uuid.
For webgpu backend integration, in 2020
Consider this case:
I have geometry with position, normal
first shader only use position, then the vao created is not include normal binding
the second shader use position and normal, when use vao, it cant get normal buffer. its a bug
pros: consistency, expressive, dynamic, code simplicity.
cons: extra overhead caused by dynamic created node GC, espacially in temporal pipeline
for convenience
Consider ship it with new rendergraph api
taaHistory = pingpong("taaHistory")
sounds good
Sometimes we need declare more than one function in one ShaderFuntion for convenient., or one shaderfunction can depend others. So ShaderFunction maybe renamed to ShaderComputation, for repersenting a kind of, a wrap of computation, not just the form of function.
PlanA:
All functions should be parserd, extract their meta info like before, this seems not difficult. We use the last declared function as computation entry. The function above can be used in bellow.
PlanB:
As before, we declare several shader-computation, add dependency resolve mechnsim: the other computation depends, or even const value depends.
In shader souce codegen, all function is convert to be unique with guid prefix, which maybe need add simple but not robust string repalce logic.
Seems PlanB is promisable.
rt
rt
Some post about how to use ts property decorator is wrong, the following posts issues this.
https://dev.to/angular/decorators-do-not-work-as-you-might-expect-3gmj
https://blog.wizardsoftheweb.pro/typescript-decorators-property-decorators/
support other renderer like threejs to use rendergraph freely
https://www.khronos.org/opengl/wiki/GLSL_:_common_mistakes
Uniform Names across shader stages
It is legal to have the same uniform defined in different shader stages.
When you call glGetUniformLocation, it will return one location. When you update the uniform with a call to glUniform, the driver takes care of sending the value for each stage (vertex shader, geometry shader, fragment shader).
This is because a GLSL program contains all of the shader stages at once. Programs do not consider uniforms in a vertex shader to be different from uniforms in a fragment shader.
Texture support is weak and unfinished. Even simplest webgl mipmap is not support. Some thing related to this may need overhaul
ShaderTexture is not a shader node, but create texture fetch node. This leads Its impossible fetch texel in shaderFunction directly. Some ShaderFunction compute need sample texture quite often, but we cant pass sampler object to it.
We should support ShaderTexture( sampler) as first class shader node in shader graph. This has one majoy issue to solve: If we allow user write texture2D in their shader function, this will affect glsl version switch impl. Another parser should add to extract texel fetch info in shader source and replace with desired.
Find a way that provide optional type check in functional node.
As we move to use webgl2 by default, the shader system is still use 1. Issue is: According to https://developer.mozilla.org/en-US/docs/Web/API/OES_standard_derivatives , this entension in webgl2 context is only avaliable in #version 300 es, and how to enable it is different.
We should make shadergraph and shader system target to es300 and figure out fall back solutions.
In multi pass render, the fbo rendered and used in pass before maybe could be used in following left pass. As render graph system can infer which fbo's content in which pass stage is not need be keep, and can also find what kind of target need in left pass, we can design a fbo memory optimzaition sys for auto handle this.
Some fbo's content need forced be keep such as temperal ping pong buffer. Additional api related to this need to consider.
Heap snapshot shows no memory leak in js, maybe deleteFBO must called before js object be GCed.
Obviously global uniform map in engine is a bad design. Engine hold a camera that maintain the global map is a bad design too. As we cant share the uniform input node between the uniform decorator, so Its a workaround.
Camera should be a shadergraph decorator that decorate the vertex graph with it s projection matrix. But the uniform should could be used by other decorator/ provider. Maybe a solution is design a shared uniform map in shadergraph, just like engine's, but not as global as that.
To decoupling the name resolve issues. We can just define the related name on their static porperty. KISS
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.