mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 23:17:02 +02:00
remove stray control-Ms
This commit is contained in:
parent
08c3fa6363
commit
a180eadc91
1 changed files with 114 additions and 114 deletions
|
@ -198,51 +198,51 @@ void Model::initProgram(ProgramObject& program, Model::Locations& locations, boo
|
||||||
locations.emissiveTextureUnit = -1;
|
locations.emissiveTextureUnit = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// bindable uniform version
|
// bindable uniform version
|
||||||
#if defined(Q_OS_MAC)
|
#if defined(Q_OS_MAC)
|
||||||
loc = program.uniformLocation("materialBuffer");
|
loc = program.uniformLocation("materialBuffer");
|
||||||
if (loc >= 0) {
|
if (loc >= 0) {
|
||||||
locations.materialBufferUnit = loc;
|
locations.materialBufferUnit = loc;
|
||||||
} else {
|
} else {
|
||||||
locations.materialBufferUnit = -1;
|
locations.materialBufferUnit = -1;
|
||||||
}
|
}
|
||||||
#elif defined(Q_OS_WIN)
|
#elif defined(Q_OS_WIN)
|
||||||
loc = glGetUniformBlockIndex(program.programId(), "materialBuffer");
|
loc = glGetUniformBlockIndex(program.programId(), "materialBuffer");
|
||||||
if (loc >= 0) {
|
if (loc >= 0) {
|
||||||
glUniformBlockBinding(program.programId(), loc, 1);
|
glUniformBlockBinding(program.programId(), loc, 1);
|
||||||
locations.materialBufferUnit = 1;
|
locations.materialBufferUnit = 1;
|
||||||
} else {
|
} else {
|
||||||
locations.materialBufferUnit = -1;
|
locations.materialBufferUnit = -1;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
loc = program.uniformLocation("materialBuffer");
|
loc = program.uniformLocation("materialBuffer");
|
||||||
if (loc >= 0) {
|
if (loc >= 0) {
|
||||||
locations.materialBufferUnit = loc;
|
locations.materialBufferUnit = loc;
|
||||||
} else {
|
} else {
|
||||||
locations.materialBufferUnit = -1;
|
locations.materialBufferUnit = -1;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(Q_OS_WIN)
|
#if defined(Q_OS_WIN)
|
||||||
loc = glGetUniformBlockIndex(program.programId(), "transformObjectBuffer");
|
loc = glGetUniformBlockIndex(program.programId(), "transformObjectBuffer");
|
||||||
if (loc >= 0) {
|
if (loc >= 0) {
|
||||||
glUniformBlockBinding(program.programId(), loc, gpu::TRANSFORM_OBJECT_SLOT);
|
glUniformBlockBinding(program.programId(), loc, gpu::TRANSFORM_OBJECT_SLOT);
|
||||||
// locations.materialBufferUnit = 1;
|
// locations.materialBufferUnit = 1;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(Q_OS_WIN)
|
#if defined(Q_OS_WIN)
|
||||||
loc = glGetUniformBlockIndex(program.programId(), "transformCameraBuffer");
|
loc = glGetUniformBlockIndex(program.programId(), "transformCameraBuffer");
|
||||||
if (loc >= 0) {
|
if (loc >= 0) {
|
||||||
glUniformBlockBinding(program.programId(), loc, gpu::TRANSFORM_CAMERA_SLOT);
|
glUniformBlockBinding(program.programId(), loc, gpu::TRANSFORM_CAMERA_SLOT);
|
||||||
// locations.materialBufferUnit = 1;
|
// locations.materialBufferUnit = 1;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//program.link();
|
//program.link();
|
||||||
if (!program.isLinked()) {
|
if (!program.isLinked()) {
|
||||||
program.release();
|
program.release();
|
||||||
}
|
}
|
||||||
|
|
||||||
program.release();
|
program.release();
|
||||||
}
|
}
|
||||||
|
@ -303,70 +303,70 @@ void Model::init() {
|
||||||
_program.addShaderFromSourceCode(QGLShader::Fragment, model_frag);
|
_program.addShaderFromSourceCode(QGLShader::Fragment, model_frag);
|
||||||
initProgram(_program, _locations);
|
initProgram(_program, _locations);
|
||||||
|
|
||||||
_normalMapProgram.addShaderFromSourceCode(QGLShader::Vertex, model_normal_map_vert);
|
_normalMapProgram.addShaderFromSourceCode(QGLShader::Vertex, model_normal_map_vert);
|
||||||
_normalMapProgram.addShaderFromSourceCode(QGLShader::Fragment, model_normal_map_frag);
|
_normalMapProgram.addShaderFromSourceCode(QGLShader::Fragment, model_normal_map_frag);
|
||||||
initProgram(_normalMapProgram, _normalMapLocations);
|
initProgram(_normalMapProgram, _normalMapLocations);
|
||||||
|
|
||||||
_specularMapProgram.addShaderFromSourceCode(QGLShader::Vertex, model_vert);
|
_specularMapProgram.addShaderFromSourceCode(QGLShader::Vertex, model_vert);
|
||||||
_specularMapProgram.addShaderFromSourceCode(QGLShader::Fragment, model_specular_map_frag);
|
_specularMapProgram.addShaderFromSourceCode(QGLShader::Fragment, model_specular_map_frag);
|
||||||
initProgram(_specularMapProgram, _specularMapLocations);
|
initProgram(_specularMapProgram, _specularMapLocations);
|
||||||
|
|
||||||
_normalSpecularMapProgram.addShaderFromSourceCode(QGLShader::Vertex, model_normal_map_vert);
|
_normalSpecularMapProgram.addShaderFromSourceCode(QGLShader::Vertex, model_normal_map_vert);
|
||||||
_normalSpecularMapProgram.addShaderFromSourceCode(QGLShader::Fragment, model_normal_specular_map_frag);
|
_normalSpecularMapProgram.addShaderFromSourceCode(QGLShader::Fragment, model_normal_specular_map_frag);
|
||||||
initProgram(_normalSpecularMapProgram, _normalSpecularMapLocations);
|
initProgram(_normalSpecularMapProgram, _normalSpecularMapLocations);
|
||||||
|
|
||||||
_translucentProgram.addShaderFromSourceCode(QGLShader::Vertex, model_vert);
|
_translucentProgram.addShaderFromSourceCode(QGLShader::Vertex, model_vert);
|
||||||
_translucentProgram.addShaderFromSourceCode(QGLShader::Fragment, model_translucent_frag);
|
_translucentProgram.addShaderFromSourceCode(QGLShader::Fragment, model_translucent_frag);
|
||||||
initProgram(_translucentProgram, _translucentLocations);
|
initProgram(_translucentProgram, _translucentLocations);
|
||||||
|
|
||||||
// Lightmap
|
// Lightmap
|
||||||
_lightmapProgram.addShaderFromSourceCode(QGLShader::Vertex, model_lightmap_vert);
|
_lightmapProgram.addShaderFromSourceCode(QGLShader::Vertex, model_lightmap_vert);
|
||||||
_lightmapProgram.addShaderFromSourceCode(QGLShader::Fragment, model_lightmap_frag);
|
_lightmapProgram.addShaderFromSourceCode(QGLShader::Fragment, model_lightmap_frag);
|
||||||
initProgram(_lightmapProgram, _lightmapLocations);
|
initProgram(_lightmapProgram, _lightmapLocations);
|
||||||
|
|
||||||
_lightmapNormalMapProgram.addShaderFromSourceCode(QGLShader::Vertex, model_lightmap_normal_map_vert);
|
_lightmapNormalMapProgram.addShaderFromSourceCode(QGLShader::Vertex, model_lightmap_normal_map_vert);
|
||||||
_lightmapNormalMapProgram.addShaderFromSourceCode(QGLShader::Fragment, model_lightmap_normal_map_frag);
|
_lightmapNormalMapProgram.addShaderFromSourceCode(QGLShader::Fragment, model_lightmap_normal_map_frag);
|
||||||
initProgram(_lightmapNormalMapProgram, _lightmapNormalMapLocations);
|
initProgram(_lightmapNormalMapProgram, _lightmapNormalMapLocations);
|
||||||
|
|
||||||
_lightmapSpecularMapProgram.addShaderFromSourceCode(QGLShader::Vertex, model_lightmap_vert);
|
_lightmapSpecularMapProgram.addShaderFromSourceCode(QGLShader::Vertex, model_lightmap_vert);
|
||||||
_lightmapSpecularMapProgram.addShaderFromSourceCode(QGLShader::Fragment, model_lightmap_specular_map_frag);
|
_lightmapSpecularMapProgram.addShaderFromSourceCode(QGLShader::Fragment, model_lightmap_specular_map_frag);
|
||||||
initProgram(_lightmapSpecularMapProgram, _lightmapSpecularMapLocations);
|
initProgram(_lightmapSpecularMapProgram, _lightmapSpecularMapLocations);
|
||||||
|
|
||||||
_lightmapNormalSpecularMapProgram.addShaderFromSourceCode(QGLShader::Vertex, model_lightmap_normal_map_vert);
|
_lightmapNormalSpecularMapProgram.addShaderFromSourceCode(QGLShader::Vertex, model_lightmap_normal_map_vert);
|
||||||
_lightmapNormalSpecularMapProgram.addShaderFromSourceCode(QGLShader::Fragment, model_lightmap_normal_specular_map_frag);
|
_lightmapNormalSpecularMapProgram.addShaderFromSourceCode(QGLShader::Fragment, model_lightmap_normal_specular_map_frag);
|
||||||
initProgram(_lightmapNormalSpecularMapProgram, _lightmapNormalSpecularMapLocations);
|
initProgram(_lightmapNormalSpecularMapProgram, _lightmapNormalSpecularMapLocations);
|
||||||
// end lightmap
|
// end lightmap
|
||||||
|
|
||||||
|
|
||||||
_shadowProgram.addShaderFromSourceCode(QGLShader::Vertex, model_shadow_vert);
|
_shadowProgram.addShaderFromSourceCode(QGLShader::Vertex, model_shadow_vert);
|
||||||
_shadowProgram.addShaderFromSourceCode(QGLShader::Fragment, model_shadow_frag);
|
_shadowProgram.addShaderFromSourceCode(QGLShader::Fragment, model_shadow_frag);
|
||||||
// Shadow program uses the same locations as standard rendering path but we still need to set the bindings
|
// Shadow program uses the same locations as standard rendering path but we still need to set the bindings
|
||||||
Model::Locations tempLoc;
|
Model::Locations tempLoc;
|
||||||
initProgram(_shadowProgram, tempLoc);
|
initProgram(_shadowProgram, tempLoc);
|
||||||
|
|
||||||
_skinProgram.addShaderFromSourceCode(QGLShader::Vertex, skin_model_vert);
|
_skinProgram.addShaderFromSourceCode(QGLShader::Vertex, skin_model_vert);
|
||||||
_skinProgram.addShaderFromSourceCode(QGLShader::Fragment, model_frag);
|
_skinProgram.addShaderFromSourceCode(QGLShader::Fragment, model_frag);
|
||||||
initSkinProgram(_skinProgram, _skinLocations);
|
initSkinProgram(_skinProgram, _skinLocations);
|
||||||
|
|
||||||
_skinNormalMapProgram.addShaderFromSourceCode(QGLShader::Vertex, skin_model_normal_map_vert);
|
_skinNormalMapProgram.addShaderFromSourceCode(QGLShader::Vertex, skin_model_normal_map_vert);
|
||||||
_skinNormalMapProgram.addShaderFromSourceCode(QGLShader::Fragment, model_normal_map_frag);
|
_skinNormalMapProgram.addShaderFromSourceCode(QGLShader::Fragment, model_normal_map_frag);
|
||||||
initSkinProgram(_skinNormalMapProgram, _skinNormalMapLocations);
|
initSkinProgram(_skinNormalMapProgram, _skinNormalMapLocations);
|
||||||
|
|
||||||
_skinSpecularMapProgram.addShaderFromSourceCode(QGLShader::Vertex, model_vert);
|
_skinSpecularMapProgram.addShaderFromSourceCode(QGLShader::Vertex, model_vert);
|
||||||
_skinSpecularMapProgram.addShaderFromSourceCode(QGLShader::Fragment, model_specular_map_frag);
|
_skinSpecularMapProgram.addShaderFromSourceCode(QGLShader::Fragment, model_specular_map_frag);
|
||||||
initSkinProgram(_skinSpecularMapProgram, _skinSpecularMapLocations);
|
initSkinProgram(_skinSpecularMapProgram, _skinSpecularMapLocations);
|
||||||
|
|
||||||
_skinNormalSpecularMapProgram.addShaderFromSourceCode(QGLShader::Vertex, skin_model_normal_map_vert);
|
_skinNormalSpecularMapProgram.addShaderFromSourceCode(QGLShader::Vertex, skin_model_normal_map_vert);
|
||||||
_skinNormalSpecularMapProgram.addShaderFromSourceCode(QGLShader::Fragment, model_normal_specular_map_frag);
|
_skinNormalSpecularMapProgram.addShaderFromSourceCode(QGLShader::Fragment, model_normal_specular_map_frag);
|
||||||
initSkinProgram(_skinNormalSpecularMapProgram, _skinNormalSpecularMapLocations);
|
initSkinProgram(_skinNormalSpecularMapProgram, _skinNormalSpecularMapLocations);
|
||||||
|
|
||||||
_skinShadowProgram.addShaderFromSourceCode(QGLShader::Vertex, skin_model_shadow_vert);
|
_skinShadowProgram.addShaderFromSourceCode(QGLShader::Vertex, skin_model_shadow_vert);
|
||||||
_skinShadowProgram.addShaderFromSourceCode(QGLShader::Fragment, model_shadow_frag);
|
_skinShadowProgram.addShaderFromSourceCode(QGLShader::Fragment, model_shadow_frag);
|
||||||
initSkinProgram(_skinShadowProgram, _skinShadowLocations);
|
initSkinProgram(_skinShadowProgram, _skinShadowLocations);
|
||||||
|
|
||||||
|
|
||||||
_skinTranslucentProgram.addShaderFromSourceCode(QGLShader::Vertex, skin_model_vert);
|
_skinTranslucentProgram.addShaderFromSourceCode(QGLShader::Vertex, skin_model_vert);
|
||||||
_skinTranslucentProgram.addShaderFromSourceCode(QGLShader::Fragment, model_translucent_frag);
|
_skinTranslucentProgram.addShaderFromSourceCode(QGLShader::Fragment, model_translucent_frag);
|
||||||
initSkinProgram(_skinTranslucentProgram, _skinTranslucentLocations);
|
initSkinProgram(_skinTranslucentProgram, _skinTranslucentLocations);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2470,16 +2470,16 @@ int Model::renderMeshesFromList(QVector<int>& list, gpu::Batch& batch, RenderMod
|
||||||
qDebug() << "part INDEX:" << j;
|
qDebug() << "part INDEX:" << j;
|
||||||
qDebug() << "NEW part.materialID:" << part.materialID;
|
qDebug() << "NEW part.materialID:" << part.materialID;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (locations->glowIntensity >= 0) {
|
if (locations->glowIntensity >= 0) {
|
||||||
GLBATCH(glUniform1f)(locations->glowIntensity, glowEffect->getIntensity());
|
GLBATCH(glUniform1f)(locations->glowIntensity, glowEffect->getIntensity());
|
||||||
}
|
}
|
||||||
if (!(translucent && alphaThreshold == 0.0f)) {
|
if (!(translucent && alphaThreshold == 0.0f)) {
|
||||||
GLBATCH(glAlphaFunc)(GL_EQUAL, glowEffect->getIntensity());
|
GLBATCH(glAlphaFunc)(GL_EQUAL, glowEffect->getIntensity());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (locations->materialBufferUnit >= 0) {
|
if (locations->materialBufferUnit >= 0) {
|
||||||
batch.setUniformBuffer(locations->materialBufferUnit, material->getSchemaBuffer());
|
batch.setUniformBuffer(locations->materialBufferUnit, material->getSchemaBuffer());
|
||||||
}
|
}
|
||||||
|
|
||||||
Texture* diffuseMap = networkPart.diffuseTexture.data();
|
Texture* diffuseMap = networkPart.diffuseTexture.data();
|
||||||
|
|
Loading…
Reference in a new issue