mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 08:21:24 +02:00
commit
8ea2b46264
4 changed files with 10 additions and 6 deletions
|
@ -1689,8 +1689,6 @@ void Application::init() {
|
||||||
_headMouseX = _mouseX = _glWidget->width() / 2;
|
_headMouseX = _mouseX = _glWidget->width() / 2;
|
||||||
_headMouseY = _mouseY = _glWidget->height() / 2;
|
_headMouseY = _mouseY = _glWidget->height() / 2;
|
||||||
|
|
||||||
_stars.readInput(STAR_FILE, STAR_CACHE_FILE, 0);
|
|
||||||
|
|
||||||
_myAvatar.init();
|
_myAvatar.init();
|
||||||
_myAvatar.setPosition(START_LOCATION);
|
_myAvatar.setPosition(START_LOCATION);
|
||||||
_myCamera.setMode(CAMERA_MODE_FIRST_PERSON);
|
_myCamera.setMode(CAMERA_MODE_FIRST_PERSON);
|
||||||
|
@ -1716,7 +1714,6 @@ void Application::init() {
|
||||||
|
|
||||||
printLog("Loaded settings.\n");
|
printLog("Loaded settings.\n");
|
||||||
|
|
||||||
|
|
||||||
sendAvatarVoxelURLMessage(_myAvatar.getVoxels()->getVoxelURL());
|
sendAvatarVoxelURLMessage(_myAvatar.getVoxels()->getVoxelURL());
|
||||||
|
|
||||||
_palette.init(_glWidget->width(), _glWidget->height());
|
_palette.init(_glWidget->width(), _glWidget->height());
|
||||||
|
@ -2290,6 +2287,9 @@ void Application::displaySide(Camera& whichCamera) {
|
||||||
glMateriali(GL_FRONT, GL_SHININESS, 96);
|
glMateriali(GL_FRONT, GL_SHININESS, 96);
|
||||||
|
|
||||||
if (_renderStarsOn->isChecked()) {
|
if (_renderStarsOn->isChecked()) {
|
||||||
|
if (!_stars.getFileLoaded()) {
|
||||||
|
_stars.readInput(STAR_FILE, STAR_CACHE_FILE, 0);
|
||||||
|
}
|
||||||
// should be the first rendering pass - w/o depth buffer / lighting
|
// should be the first rendering pass - w/o depth buffer / lighting
|
||||||
|
|
||||||
// compute starfield alpha based on distance from atmosphere
|
// compute starfield alpha based on distance from atmosphere
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
#undef __interface__Starfield_impl__
|
#undef __interface__Starfield_impl__
|
||||||
|
|
||||||
Stars::Stars() :
|
Stars::Stars() :
|
||||||
_controller(0l) {
|
_controller(0l), _fileLoaded(false) {
|
||||||
_controller = new starfield::Controller;
|
_controller = new starfield::Controller;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -23,7 +23,8 @@ Stars::~Stars() {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Stars::readInput(const char* url, const char* cacheFile, unsigned limit) {
|
bool Stars::readInput(const char* url, const char* cacheFile, unsigned limit) {
|
||||||
return _controller->readInput(url, cacheFile, limit);
|
_fileLoaded = _controller->readInput(url, cacheFile, limit);
|
||||||
|
return _fileLoaded;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Stars::setResolution(unsigned k) {
|
bool Stars::setResolution(unsigned k) {
|
||||||
|
|
|
@ -65,6 +65,7 @@ class Stars {
|
||||||
float changeLOD(float factor,
|
float changeLOD(float factor,
|
||||||
float overalloc = 0.25, float realloc = 0.15);
|
float overalloc = 0.25, float realloc = 0.15);
|
||||||
|
|
||||||
|
bool getFileLoaded() const { return _fileLoaded; };
|
||||||
private:
|
private:
|
||||||
// don't copy/assign
|
// don't copy/assign
|
||||||
Stars(Stars const&); // = delete;
|
Stars(Stars const&); // = delete;
|
||||||
|
@ -73,6 +74,8 @@ class Stars {
|
||||||
// variables
|
// variables
|
||||||
|
|
||||||
starfield::Controller* _controller;
|
starfield::Controller* _controller;
|
||||||
|
|
||||||
|
bool _fileLoaded;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1284,6 +1284,7 @@ int VoxelTree::encodeTreeBitstreamRecursion(VoxelNode* node, unsigned char* outp
|
||||||
if (params.viewFrustum && childNode->isColored() && !childNode->isLeaf()) {
|
if (params.viewFrustum && childNode->isColored() && !childNode->isLeaf()) {
|
||||||
int grandChildrenInView = 0;
|
int grandChildrenInView = 0;
|
||||||
int grandChildrenInLOD = 0;
|
int grandChildrenInLOD = 0;
|
||||||
|
float grandChildBoundaryDistance = boundaryDistanceForRenderLevel(childNode->getLevel() + 2);
|
||||||
for (int grandChildIndex = 0; grandChildIndex < NUMBER_OF_CHILDREN; grandChildIndex++) {
|
for (int grandChildIndex = 0; grandChildIndex < NUMBER_OF_CHILDREN; grandChildIndex++) {
|
||||||
VoxelNode* grandChild = childNode->getChildAtIndex(grandChildIndex);
|
VoxelNode* grandChild = childNode->getChildAtIndex(grandChildIndex);
|
||||||
|
|
||||||
|
@ -1291,7 +1292,6 @@ int VoxelTree::encodeTreeBitstreamRecursion(VoxelNode* node, unsigned char* outp
|
||||||
grandChildrenInView++;
|
grandChildrenInView++;
|
||||||
|
|
||||||
float grandChildDistance = grandChild->distanceToCamera(*params.viewFrustum);
|
float grandChildDistance = grandChild->distanceToCamera(*params.viewFrustum);
|
||||||
float grandChildBoundaryDistance = boundaryDistanceForRenderLevel(grandChild->getLevel() + 1);
|
|
||||||
if (grandChildDistance < grandChildBoundaryDistance) {
|
if (grandChildDistance < grandChildBoundaryDistance) {
|
||||||
grandChildrenInLOD++;
|
grandChildrenInLOD++;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue