float rand(float n){return fract(sin(n) * 43758.5453123);}
float noise(float p){
float fl = floor(p);
float fc = fract(p);
return mix(rand(fl), rand(fl + 1.0), fc);
}
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //compilation | |
| // kick the compilation | |
| pCompiler->Compile( | |
| pSource, // program text | |
| wshader, // file name, mostly for error messages | |
| shaderArgs.entryPoint, // entry point function | |
| shaderArgs.type, // target profile | |
| const_cast<LPCWSTR *>(finalFlags.data()), // compilation arguments | |
| flagsCount, // number of compilation arguments | |
| nullptr, 0, // name/value defines and their count |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #pragma once | |
| #include <limits> | |
| namespace cpp_tools { | |
| namespace numerical { | |
| template <typename T> using singleVariableFunction = float (*)(T xValue); | |
| struct ErrorReport {}; | |
| template <typename T> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <bitset> | |
| #include <iostream> | |
| #ifdef MSVC | |
| #include <intrin.h> | |
| #endif | |
| #ifdef CLANG | |
| #include <x86intrin.h> | |
| #endif | |
| #include <cmath> | |
| #include <cstdint> |