clarifies some names

This commit is contained in:
tosh 2013-05-18 13:33:01 +02:00
parent 2cc5f732ce
commit 989256aad0
3 changed files with 17 additions and 17 deletions

View file

@ -70,7 +70,7 @@ namespace starfield {
double _valLodHighWaterMark; double _valLodHighWaterMark;
double _valLodOveralloc; double _valLodOveralloc;
size_t _valLodNalloc; size_t _valLodNalloc;
size_t _valLodNrender; size_t _valLodNRender;
BrightnessLevels _seqLodBrightness; BrightnessLevels _seqLodBrightness;
#if STARFIELD_MULTITHREADING #if STARFIELD_MULTITHREADING
@ -103,7 +103,7 @@ namespace starfield {
_valLodHighWaterMark(1.0), _valLodHighWaterMark(1.0),
_valLodOveralloc(1.2), _valLodOveralloc(1.2),
_valLodNalloc(0), _valLodNalloc(0),
_valLodNrender(0), _valLodNRender(0),
_valLodBrightness(0), _valLodBrightness(0),
_valLodAllocBrightness(0), _valLodAllocBrightness(0),
_ptrRenderer(0l) { _ptrRenderer(0l) {
@ -156,7 +156,7 @@ namespace starfield {
// cannot allocate or render more than we have // cannot allocate or render more than we have
n = min(newLast, _valLodNalloc); n = min(newLast, _valLodNalloc);
nRender = min(newLast, _valLodNrender); nRender = min(newLast, _valLodNRender);
} }
// determine new minimum brightness levels // determine new minimum brightness levels
@ -192,7 +192,7 @@ namespace starfield {
_valLodHighWaterMark *= rcpChange; _valLodHighWaterMark *= rcpChange;
_valLodOveralloc *= rcpChange; _valLodOveralloc *= rcpChange;
_valLodNalloc = n; _valLodNalloc = n;
_valLodNrender = nRender; _valLodNRender = nRender;
_valLodAllocBrightness = bMin; _valLodAllocBrightness = bMin;
#if STARFIELD_MULTITHREADING #if STARFIELD_MULTITHREADING
_valLodBrightness.store(b, memory_order_relaxed); _valLodBrightness.store(b, memory_order_relaxed);
@ -334,7 +334,7 @@ namespace starfield {
{ lock _(_mtxLodState); { lock _(_mtxLodState);
_valLodNalloc = n; _valLodNalloc = n;
_valLodNrender = nRender; _valLodNRender = nRender;
_valLodFraction = fraction; _valLodFraction = fraction;
_valLodLowWaterMark = fraction * (1.0 - realloc); _valLodLowWaterMark = fraction * (1.0 - realloc);

View file

@ -71,13 +71,13 @@ namespace starfield {
GLsizei* _arrBatchCount; GLsizei* _arrBatchCount;
GLuint _hndVertexArray; GLuint _hndVertexArray;
ProgramObject _objProgram; ProgramObject _objProgram;
int _alphaLocation; int _alphaLocationHandle;
Tiling _objTiling; Tiling _objTiling;
unsigned* _itrOutIndex; unsigned* _itrOutIndex;
vec3 _vecWxform; vec3 _vecWRow;
float _valHalfPersp; float _valHalfPerspectiveAngle;
BrightnessLevel _valMinBright; BrightnessLevel _valMinBright;
public: public:
@ -173,8 +173,8 @@ namespace starfield {
matrix = glm::frustum(-hw,hw, -hh,hh, nearClip,10.0f) * glm::affineInverse(matrix); matrix = glm::frustum(-hw,hw, -hh,hh, nearClip,10.0f) * glm::affineInverse(matrix);
this->_itrOutIndex = (unsigned*) _arrBatchOffs; this->_itrOutIndex = (unsigned*) _arrBatchOffs;
this->_vecWxform = vec3(row(matrix, 3)); this->_vecWRow = vec3(row(matrix, 3));
this->_valHalfPersp = halfPersp; this->_valHalfPerspectiveAngle = halfPersp;
this->_valMinBright = minBright; this->_valMinBright = minBright;
TileSelection::Cursor cursor; TileSelection::Cursor cursor;
@ -397,11 +397,11 @@ namespace starfield {
float gz = -cos(azimuth); float gz = -cos(azimuth);
float exz = cos(altitude); float exz = cos(altitude);
vec3 tileCenter = vec3(gx * exz, sin(altitude), gz * exz); vec3 tileCenter = vec3(gx * exz, sin(altitude), gz * exz);
float w = dot(_vecWxform, tileCenter); float w = dot(_vecWRow, tileCenter);
float daz = halfSlice * cos(std::max(0.0f, abs(altitude) - halfSlice)); float daz = halfSlice * cos(std::max(0.0f, abs(altitude) - halfSlice));
float dal = halfSlice; float dal = halfSlice;
float adjustedNear = cos(_valHalfPersp + sqrt(daz * daz + dal * dal)); float adjustedNear = cos(_valHalfPerspectiveAngle + sqrt(daz * daz + dal * dal));
// printLog("Stars.cpp: checking tile #%d, w = %f, near = %f\n", i, w, nearClip); // printLog("Stars.cpp: checking tile #%d, w = %f, near = %f\n", i, w, nearClip);
@ -484,7 +484,7 @@ namespace starfield {
"}\n"; "}\n";
_objProgram.addShaderFromSourceCode(QGLShader::Fragment, FRAGMENT_SHADER); _objProgram.addShaderFromSourceCode(QGLShader::Fragment, FRAGMENT_SHADER);
_objProgram.link(); _objProgram.link();
_alphaLocation = _objProgram.uniformLocation("alpha"); _alphaLocationHandle = _objProgram.uniformLocation("alpha");
glGenBuffersARB(1, & _hndVertexArray); glGenBuffersARB(1, & _hndVertexArray);
} }
@ -532,7 +532,7 @@ namespace starfield {
// select shader and vertex array // select shader and vertex array
_objProgram.bind(); _objProgram.bind();
_objProgram.setUniformValue(_alphaLocation, alpha); _objProgram.setUniformValue(_alphaLocationHandle, alpha);
glBindBufferARB(GL_ARRAY_BUFFER, _hndVertexArray); glBindBufferARB(GL_ARRAY_BUFFER, _hndVertexArray);
glInterleavedArrays(GL_C4UB_V3F, sizeof(GpuVertex), 0l); glInterleavedArrays(GL_C4UB_V3F, sizeof(GpuVertex), 0l);

View file

@ -21,19 +21,19 @@ namespace starfield {
unsigned _valK; unsigned _valK;
float _valRcpSlice; float _valRcpSlice;
unsigned _valBits; unsigned _valNBits;
public: public:
Tiling(unsigned k) : Tiling(unsigned k) :
_valK(k), _valK(k),
_valRcpSlice(k / Radians::twicePi()) { _valRcpSlice(k / Radians::twicePi()) {
_valBits = ceil(log(getTileCount()) * 1.4426950408889634); // log2 _valNBits = ceil(log(getTileCount()) * 1.4426950408889634); // log2
} }
unsigned getAzimuthalTiles() const { return _valK; } unsigned getAzimuthalTiles() const { return _valK; }
unsigned getAltitudinalTiles() const { return _valK / 2 + 1; } unsigned getAltitudinalTiles() const { return _valK / 2 + 1; }
unsigned getTileIndexBits() const { return _valBits; } unsigned getTileIndexBits() const { return _valNBits; }
unsigned getTileCount() const { unsigned getTileCount() const {
return getAzimuthalTiles() * getAltitudinalTiles(); return getAzimuthalTiles() * getAltitudinalTiles();