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
{{ message }}
This repository was archived by the owner on Jun 6, 2021. It is now read-only.
This issue tracks ideas and conversation about posibilities of testing in shaders
Assertions
Often times while developing shaders we want to be sure that our functions return values of a certain range when given input of a certain range, especially when converting from/to uv space into data (we encountered this while implementing procedural sky rendering).
let samples = from_distribution(PlanetHeight, AtmosphereHeight);
let results = samples.map(convert_from_height);
assert_range(results, 0.0, PI);
Where from_distribution returns a list of values within the range of its two parameters, map is your typical mapping function, assert_range asserts that a list of values is within the given range of parameters.
Interpreter
One idea is to build an interpreter for xshade, running xshade code on the CPU.
Compiling into another language, then execute
Another aproach can be to translate xshade code into another CPU language to run the tests.
Try to use compute shaders
It could also be possible to use compute shaders to test xshade code.
The text was updated successfully, but these errors were encountered:
This issue tracks ideas and conversation about posibilities of testing in shaders
Assertions
Often times while developing shaders we want to be sure that our functions return values of a certain range when given input of a certain range, especially when converting from/to uv space into data (we encountered this while implementing procedural sky rendering).
Where
from_distribution
returns a list of values within the range of its two parameters,map
is your typical mapping function,assert_range
asserts that a list of values is within the given range of parameters.Interpreter
One idea is to build an interpreter for xshade, running xshade code on the CPU.
Compiling into another language, then execute
Another aproach can be to translate xshade code into another CPU language to run the tests.
Try to use compute shaders
It could also be possible to use compute shaders to test xshade code.
The text was updated successfully, but these errors were encountered: