This file contains 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
template <class T> | |
class STLCompatibleGPUAllocator : public irr::core::AllocatorTrivialBase<T> | |
{ | |
public: | |
typedef size_t size_type; | |
typedef T* pointer; | |
template< class U> struct rebind { typedef STLCompatibleGPUAllocator<U> other; }; | |
STLCompatibleGPUAllocator() {} |
This file contains 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
///float tripleProductCoefficients[121][36][9]; | |
///bool tripleProductCoefficientSparsityMask[121][121][121]; | |
bool tripleProductCoefficientSparsityMask[121][36][9]; | |
/** | |
void calculateTripleProductCoefficients() | |
{ | |
float tripleComplexProductCoefficients[9][36][121]; | |
memset(tripleComplexProductCoefficients,0,sizeof(float)*9*36*121); |
This file contains 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
//!Warning does not model intersection with the Planet itself in the middle of the atmosphere | |
float calculateHazeFactor(in float fragDepth, in vec3 viewDir) | |
{ | |
//hazeHeight and camPos are heights above sea level | |
bool aboveHaze = camPos>hazeHeight; | |
if (aboveHaze&&viewDir.y>=0.0) | |
return 1.0; | |
float planetRadius = 6357.0; | |
float hazeRadius = planetRadius+hazeHeight; |
NewerOlder