You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
And then it would be executed so that each test would write to a pixel in an output texture 0 or 1. And then you could read back that texture and see if all unit tests pass -- all 1s:
Adding this to Three.js would extend the robustness of Three to the shader level. It would also help identify GPU hardware / drivers that are misbehaving in a much faster way than we currently do. Basically you will see specific tests fail for GPU X and know exactly what you have to do to fix it.
Alternatives
Unsure of alternatives, maybe something new with TSL?
Additional context
We identified recently that some of our packing / unpacking code for GLSL is buggy and has been for many years: #28692
The text was updated successfully, but these errors were encountered:
Description
We have many many GLSL functions that use all over the place in our shaders.
These functions can have subtle bugs or problems with their extremes.
We really do not check if these functions operate correctly via unit tests because we do not have unit tests that work with shaders.
Solution
For threeify, I implemented a quick and dirty shader unit test system.
You could write tests in this fashion:
Another example here: https://github.com/bhouston/threeify/blob/main/packages/core/src/shaders/math/unitIntervalPacking.test.glsl
And then it would be executed so that each test would write to a pixel in an output texture 0 or 1. And then you could read back that texture and see if all unit tests pass -- all 1s:
Full source code here: https://github.com/bhouston/threeify/blob/main/examples/src/units/glsl/index.ts
Adding this to Three.js would extend the robustness of Three to the shader level. It would also help identify GPU hardware / drivers that are misbehaving in a much faster way than we currently do. Basically you will see specific tests fail for GPU X and know exactly what you have to do to fix it.
Alternatives
Unsure of alternatives, maybe something new with TSL?
Additional context
We identified recently that some of our packing / unpacking code for GLSL is buggy and has been for many years: #28692
The text was updated successfully, but these errors were encountered: