mirror of
https://github.com/lubosz/overte.git
synced 2025-04-12 18:52:33 +02:00
Tweaking to match master
This commit is contained in:
parent
9974eb0357
commit
5f12af75bd
5 changed files with 53 additions and 59 deletions
|
@ -13,12 +13,9 @@
|
|||
# See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||
#
|
||||
|
||||
|
||||
if (NOT ANDROID)
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(OPENVR DEFAULT_MSG OPENVR_INCLUDE_DIRS OPENVR_LIBRARIES)
|
||||
|
||||
endif (NOT ANDROID)
|
||||
endif()
|
||||
|
||||
mark_as_advanced(OPENVR_INCLUDE_DIRS OPENVR_LIBRARIES OPENVR_SEARCH_DIRS)
|
||||
|
|
|
@ -73,7 +73,6 @@ find_package(Qt5 COMPONENTS Gui Multimedia Network OpenGL Qml Quick Script Svg W
|
|||
# grab the ui files in resources/ui
|
||||
file (GLOB_RECURSE QT_UI_FILES ui/*.ui)
|
||||
source_group("UI Files" FILES ${QT_UI_FILES})
|
||||
|
||||
# have qt5 wrap them and generate the appropriate header files
|
||||
qt5_wrap_ui(QT_UI_HEADERS "${QT_UI_FILES}")
|
||||
|
||||
|
|
|
@ -111,4 +111,4 @@ void AudioToolBox::render(int x, int y, int padding, bool boxed) {
|
|||
DependencyManager::get<GeometryCache>()->renderQuad(topLeft, bottomRight, texCoordTopLeft, texCoordBottomRight, quadColor, _boxQuadID);
|
||||
glBindTexture(GL_TEXTURE_2D, 0);
|
||||
glDisable(GL_TEXTURE_2D);
|
||||
}
|
||||
}
|
|
@ -33,4 +33,4 @@ private:
|
|||
qint64 _iconPulseTimeReference = 0;
|
||||
};
|
||||
|
||||
#endif // hifi_AudioToolBox_h
|
||||
#endif // hifi_AudioToolBox_h
|
|
@ -268,16 +268,16 @@ void DeferredLightingEffect::render() {
|
|||
program->setUniformValue(locations->ambientSphere + i, *(((QVector4D*) &sh) + i));
|
||||
}
|
||||
}
|
||||
|
||||
if (locations->lightBufferUnit >= 0) {
|
||||
gpu::Batch batch;
|
||||
batch.setUniformBuffer(locations->lightBufferUnit, globalLight->getSchemaBuffer());
|
||||
gpu::GLBackend::renderBatch(batch);
|
||||
|
||||
if (locations->lightBufferUnit >= 0) {
|
||||
gpu::Batch batch;
|
||||
batch.setUniformBuffer(locations->lightBufferUnit, globalLight->getSchemaBuffer());
|
||||
gpu::GLBackend::renderBatch(batch);
|
||||
}
|
||||
|
||||
if (_atmosphere && (locations->atmosphereBufferUnit >= 0)) {
|
||||
gpu::Batch batch;
|
||||
batch.setUniformBuffer(locations->atmosphereBufferUnit, _atmosphere->getDataBuffer());
|
||||
gpu::Batch batch;
|
||||
batch.setUniformBuffer(locations->atmosphereBufferUnit, _atmosphere->getDataBuffer());
|
||||
gpu::GLBackend::renderBatch(batch);
|
||||
}
|
||||
glUniformMatrix4fv(locations->invViewMat, 1, false, reinterpret_cast< const GLfloat* >(&invViewMat));
|
||||
|
@ -334,11 +334,11 @@ void DeferredLightingEffect::render() {
|
|||
|
||||
for (auto lightID : _pointLights) {
|
||||
auto light = _allocatedLights[lightID];
|
||||
|
||||
if (_pointLightLocations.lightBufferUnit >= 0) {
|
||||
gpu::Batch batch;
|
||||
batch.setUniformBuffer(_pointLightLocations.lightBufferUnit, light->getSchemaBuffer());
|
||||
gpu::GLBackend::renderBatch(batch);
|
||||
|
||||
if (_pointLightLocations.lightBufferUnit >= 0) {
|
||||
gpu::Batch batch;
|
||||
batch.setUniformBuffer(_pointLightLocations.lightBufferUnit, light->getSchemaBuffer());
|
||||
gpu::GLBackend::renderBatch(batch);
|
||||
}
|
||||
glUniformMatrix4fv(_pointLightLocations.invViewMat, 1, false, reinterpret_cast< const GLfloat* >(&invViewMat));
|
||||
|
||||
|
@ -380,10 +380,10 @@ void DeferredLightingEffect::render() {
|
|||
for (auto lightID : _spotLights) {
|
||||
auto light = _allocatedLights[lightID];
|
||||
|
||||
if (_spotLightLocations.lightBufferUnit >= 0) {
|
||||
gpu::Batch batch;
|
||||
batch.setUniformBuffer(_spotLightLocations.lightBufferUnit, light->getSchemaBuffer());
|
||||
gpu::GLBackend::renderBatch(batch);
|
||||
if (_spotLightLocations.lightBufferUnit >= 0) {
|
||||
gpu::Batch batch;
|
||||
batch.setUniformBuffer(_spotLightLocations.lightBufferUnit, light->getSchemaBuffer());
|
||||
gpu::GLBackend::renderBatch(batch);
|
||||
}
|
||||
glUniformMatrix4fv(_spotLightLocations.invViewMat, 1, false, reinterpret_cast< const GLfloat* >(&invViewMat));
|
||||
|
||||
|
@ -482,8 +482,6 @@ void DeferredLightingEffect::render() {
|
|||
}
|
||||
|
||||
void DeferredLightingEffect::loadLightProgram(const char* fragSource, bool limited, ProgramObject& program, LightLocations& locations) {
|
||||
qDebug() << (limited ? deferred_light_limited_vert : deferred_light_vert);
|
||||
qDebug() << fragSource;
|
||||
program.addShaderFromSourceCode(QGLShader::Vertex, (limited ? deferred_light_limited_vert : deferred_light_vert));
|
||||
program.addShaderFromSourceCode(QGLShader::Fragment, fragSource);
|
||||
program.link();
|
||||
|
@ -504,42 +502,42 @@ void DeferredLightingEffect::loadLightProgram(const char* fragSource, bool limit
|
|||
locations.ambientSphere = program.uniformLocation("ambientSphere.L00");
|
||||
locations.invViewMat = program.uniformLocation("invViewMat");
|
||||
|
||||
GLint loc = -1;
|
||||
|
||||
#if (GPU_FEATURE_PROFILE == GPU_CORE)
|
||||
const GLint LIGHT_GPU_SLOT = 3;
|
||||
loc = glGetUniformBlockIndex(program.programId(), "lightBuffer");
|
||||
if (loc >= 0) {
|
||||
glUniformBlockBinding(program.programId(), loc, LIGHT_GPU_SLOT);
|
||||
locations.lightBufferUnit = LIGHT_GPU_SLOT;
|
||||
} else {
|
||||
locations.lightBufferUnit = -1;
|
||||
}
|
||||
#else
|
||||
loc = program.uniformLocation("lightBuffer");
|
||||
if (loc >= 0) {
|
||||
locations.lightBufferUnit = loc;
|
||||
} else {
|
||||
locations.lightBufferUnit = -1;
|
||||
}
|
||||
GLint loc = -1;
|
||||
|
||||
#if (GPU_FEATURE_PROFILE == GPU_CORE)
|
||||
const GLint LIGHT_GPU_SLOT = 3;
|
||||
loc = glGetUniformBlockIndex(program.programId(), "lightBuffer");
|
||||
if (loc >= 0) {
|
||||
glUniformBlockBinding(program.programId(), loc, LIGHT_GPU_SLOT);
|
||||
locations.lightBufferUnit = LIGHT_GPU_SLOT;
|
||||
} else {
|
||||
locations.lightBufferUnit = -1;
|
||||
}
|
||||
#else
|
||||
loc = program.uniformLocation("lightBuffer");
|
||||
if (loc >= 0) {
|
||||
locations.lightBufferUnit = loc;
|
||||
} else {
|
||||
locations.lightBufferUnit = -1;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if (GPU_FEATURE_PROFILE == GPU_CORE)
|
||||
const GLint ATMOSPHERE_GPU_SLOT = 4;
|
||||
loc = glGetUniformBlockIndex(program.programId(), "atmosphereBufferUnit");
|
||||
if (loc >= 0) {
|
||||
glUniformBlockBinding(program.programId(), loc, ATMOSPHERE_GPU_SLOT);
|
||||
locations.atmosphereBufferUnit = ATMOSPHERE_GPU_SLOT;
|
||||
} else {
|
||||
locations.atmosphereBufferUnit = -1;
|
||||
}
|
||||
#else
|
||||
loc = program.uniformLocation("atmosphereBufferUnit");
|
||||
if (loc >= 0) {
|
||||
locations.atmosphereBufferUnit = loc;
|
||||
} else {
|
||||
locations.atmosphereBufferUnit = -1;
|
||||
}
|
||||
#if (GPU_FEATURE_PROFILE == GPU_CORE)
|
||||
const GLint ATMOSPHERE_GPU_SLOT = 4;
|
||||
loc = glGetUniformBlockIndex(program.programId(), "atmosphereBufferUnit");
|
||||
if (loc >= 0) {
|
||||
glUniformBlockBinding(program.programId(), loc, ATMOSPHERE_GPU_SLOT);
|
||||
locations.atmosphereBufferUnit = ATMOSPHERE_GPU_SLOT;
|
||||
} else {
|
||||
locations.atmosphereBufferUnit = -1;
|
||||
}
|
||||
#else
|
||||
loc = program.uniformLocation("atmosphereBufferUnit");
|
||||
if (loc >= 0) {
|
||||
locations.atmosphereBufferUnit = loc;
|
||||
} else {
|
||||
locations.atmosphereBufferUnit = -1;
|
||||
}
|
||||
#endif
|
||||
|
||||
program.release();
|
||||
|
|
Loading…
Reference in a new issue