History

remove stray control-Ms

Seth Alves committed 11 years ago

Commit a180ead1 parent 08c3fa61 file · +114 −114Browse files

Showing the changes to libraries/render-utils/src/Model.cpp (1 of 1 file). Show all

Unified · Split

libraries/render-utils/src/Model.cpp+114−114
@@ -198,51 +198,51 @@ void Model::initProgram(ProgramObject& program, Model::Locations& locations, boo · 197 unmodified lines
198198 locations.emissiveTextureUnit = -1;
199199 }
200200
201− // bindable uniform version
202−#if defined(Q_OS_MAC)
203− loc = program.uniformLocation("materialBuffer");
204− if (loc >= 0) {
205− locations.materialBufferUnit = loc;
206− } else {
207− locations.materialBufferUnit = -1;
208− }
209−#elif defined(Q_OS_WIN)
210− loc = glGetUniformBlockIndex(program.programId(), "materialBuffer");
211− if (loc >= 0) {
212− glUniformBlockBinding(program.programId(), loc, 1);
213− locations.materialBufferUnit = 1;
214− } else {
215− locations.materialBufferUnit = -1;
216− }
217−#else
218− loc = program.uniformLocation("materialBuffer");
219− if (loc >= 0) {
220− locations.materialBufferUnit = loc;
221− } else {
222− locations.materialBufferUnit = -1;
223− }
224−#endif
225−
226−#if defined(Q_OS_WIN)
227− loc = glGetUniformBlockIndex(program.programId(), "transformObjectBuffer");
228− if (loc >= 0) {
229− glUniformBlockBinding(program.programId(), loc, gpu::TRANSFORM_OBJECT_SLOT);
230− // locations.materialBufferUnit = 1;
231− }
232−#endif
233−
234−#if defined(Q_OS_WIN)
235− loc = glGetUniformBlockIndex(program.programId(), "transformCameraBuffer");
236− if (loc >= 0) {
237− glUniformBlockBinding(program.programId(), loc, gpu::TRANSFORM_CAMERA_SLOT);
238− // locations.materialBufferUnit = 1;
239− }
240−#endif
241−
201+ // bindable uniform version
202+#if defined(Q_OS_MAC)
203+ loc = program.uniformLocation("materialBuffer");
204+ if (loc >= 0) {
205+ locations.materialBufferUnit = loc;
206+ } else {
207+ locations.materialBufferUnit = -1;
208+ }
209+#elif defined(Q_OS_WIN)
210+ loc = glGetUniformBlockIndex(program.programId(), "materialBuffer");
211+ if (loc >= 0) {
212+ glUniformBlockBinding(program.programId(), loc, 1);
213+ locations.materialBufferUnit = 1;
214+ } else {
215+ locations.materialBufferUnit = -1;
216+ }
217+#else
218+ loc = program.uniformLocation("materialBuffer");
219+ if (loc >= 0) {
220+ locations.materialBufferUnit = loc;
221+ } else {
222+ locations.materialBufferUnit = -1;
223+ }
224+#endif
225+
226+#if defined(Q_OS_WIN)
227+ loc = glGetUniformBlockIndex(program.programId(), "transformObjectBuffer");
228+ if (loc >= 0) {
229+ glUniformBlockBinding(program.programId(), loc, gpu::TRANSFORM_OBJECT_SLOT);
230+ // locations.materialBufferUnit = 1;
231+ }
232+#endif
233+
234+#if defined(Q_OS_WIN)
235+ loc = glGetUniformBlockIndex(program.programId(), "transformCameraBuffer");
236+ if (loc >= 0) {
237+ glUniformBlockBinding(program.programId(), loc, gpu::TRANSFORM_CAMERA_SLOT);
238+ // locations.materialBufferUnit = 1;
239+ }
240+#endif
241+
242242 //program.link();
243− if (!program.isLinked()) {
244− program.release();
245− }
243+ if (!program.isLinked()) {
244+ program.release();
245+ }
246246
247247 program.release();
248248 }
@@ -303,70 +303,70 @@ void Model::init() { · 54 unmodified lines
303303 _program.addShaderFromSourceCode(QGLShader::Fragment, model_frag);
304304 initProgram(_program, _locations);
305305
306− _normalMapProgram.addShaderFromSourceCode(QGLShader::Vertex, model_normal_map_vert);
307− _normalMapProgram.addShaderFromSourceCode(QGLShader::Fragment, model_normal_map_frag);
308− initProgram(_normalMapProgram, _normalMapLocations);
309−
310− _specularMapProgram.addShaderFromSourceCode(QGLShader::Vertex, model_vert);
311− _specularMapProgram.addShaderFromSourceCode(QGLShader::Fragment, model_specular_map_frag);
312− initProgram(_specularMapProgram, _specularMapLocations);
313−
314− _normalSpecularMapProgram.addShaderFromSourceCode(QGLShader::Vertex, model_normal_map_vert);
315− _normalSpecularMapProgram.addShaderFromSourceCode(QGLShader::Fragment, model_normal_specular_map_frag);
316− initProgram(_normalSpecularMapProgram, _normalSpecularMapLocations);
317−
318− _translucentProgram.addShaderFromSourceCode(QGLShader::Vertex, model_vert);
319− _translucentProgram.addShaderFromSourceCode(QGLShader::Fragment, model_translucent_frag);
320− initProgram(_translucentProgram, _translucentLocations);
321−
322− // Lightmap
323− _lightmapProgram.addShaderFromSourceCode(QGLShader::Vertex, model_lightmap_vert);
324− _lightmapProgram.addShaderFromSourceCode(QGLShader::Fragment, model_lightmap_frag);
325− initProgram(_lightmapProgram, _lightmapLocations);
326−
327− _lightmapNormalMapProgram.addShaderFromSourceCode(QGLShader::Vertex, model_lightmap_normal_map_vert);
328− _lightmapNormalMapProgram.addShaderFromSourceCode(QGLShader::Fragment, model_lightmap_normal_map_frag);
329− initProgram(_lightmapNormalMapProgram, _lightmapNormalMapLocations);
330−
331− _lightmapSpecularMapProgram.addShaderFromSourceCode(QGLShader::Vertex, model_lightmap_vert);
332− _lightmapSpecularMapProgram.addShaderFromSourceCode(QGLShader::Fragment, model_lightmap_specular_map_frag);
333− initProgram(_lightmapSpecularMapProgram, _lightmapSpecularMapLocations);
334−
335− _lightmapNormalSpecularMapProgram.addShaderFromSourceCode(QGLShader::Vertex, model_lightmap_normal_map_vert);
336− _lightmapNormalSpecularMapProgram.addShaderFromSourceCode(QGLShader::Fragment, model_lightmap_normal_specular_map_frag);
337− initProgram(_lightmapNormalSpecularMapProgram, _lightmapNormalSpecularMapLocations);
338− // end lightmap
339−
340−
341− _shadowProgram.addShaderFromSourceCode(QGLShader::Vertex, model_shadow_vert);
342− _shadowProgram.addShaderFromSourceCode(QGLShader::Fragment, model_shadow_frag);
343− // Shadow program uses the same locations as standard rendering path but we still need to set the bindings
344− Model::Locations tempLoc;
345− initProgram(_shadowProgram, tempLoc);
346−
347− _skinProgram.addShaderFromSourceCode(QGLShader::Vertex, skin_model_vert);
348− _skinProgram.addShaderFromSourceCode(QGLShader::Fragment, model_frag);
349− initSkinProgram(_skinProgram, _skinLocations);
350−
351− _skinNormalMapProgram.addShaderFromSourceCode(QGLShader::Vertex, skin_model_normal_map_vert);
352− _skinNormalMapProgram.addShaderFromSourceCode(QGLShader::Fragment, model_normal_map_frag);
353− initSkinProgram(_skinNormalMapProgram, _skinNormalMapLocations);
354−
355− _skinSpecularMapProgram.addShaderFromSourceCode(QGLShader::Vertex, model_vert);
356− _skinSpecularMapProgram.addShaderFromSourceCode(QGLShader::Fragment, model_specular_map_frag);
357− initSkinProgram(_skinSpecularMapProgram, _skinSpecularMapLocations);
358−
359− _skinNormalSpecularMapProgram.addShaderFromSourceCode(QGLShader::Vertex, skin_model_normal_map_vert);
360− _skinNormalSpecularMapProgram.addShaderFromSourceCode(QGLShader::Fragment, model_normal_specular_map_frag);
361− initSkinProgram(_skinNormalSpecularMapProgram, _skinNormalSpecularMapLocations);
362−
363− _skinShadowProgram.addShaderFromSourceCode(QGLShader::Vertex, skin_model_shadow_vert);
364− _skinShadowProgram.addShaderFromSourceCode(QGLShader::Fragment, model_shadow_frag);
365− initSkinProgram(_skinShadowProgram, _skinShadowLocations);
366−
367−
368− _skinTranslucentProgram.addShaderFromSourceCode(QGLShader::Vertex, skin_model_vert);
369− _skinTranslucentProgram.addShaderFromSourceCode(QGLShader::Fragment, model_translucent_frag);
306+ _normalMapProgram.addShaderFromSourceCode(QGLShader::Vertex, model_normal_map_vert);
307+ _normalMapProgram.addShaderFromSourceCode(QGLShader::Fragment, model_normal_map_frag);
308+ initProgram(_normalMapProgram, _normalMapLocations);
309+
310+ _specularMapProgram.addShaderFromSourceCode(QGLShader::Vertex, model_vert);
311+ _specularMapProgram.addShaderFromSourceCode(QGLShader::Fragment, model_specular_map_frag);
312+ initProgram(_specularMapProgram, _specularMapLocations);
313+
314+ _normalSpecularMapProgram.addShaderFromSourceCode(QGLShader::Vertex, model_normal_map_vert);
315+ _normalSpecularMapProgram.addShaderFromSourceCode(QGLShader::Fragment, model_normal_specular_map_frag);
316+ initProgram(_normalSpecularMapProgram, _normalSpecularMapLocations);
317+
318+ _translucentProgram.addShaderFromSourceCode(QGLShader::Vertex, model_vert);
319+ _translucentProgram.addShaderFromSourceCode(QGLShader::Fragment, model_translucent_frag);
320+ initProgram(_translucentProgram, _translucentLocations);
321+
322+ // Lightmap
323+ _lightmapProgram.addShaderFromSourceCode(QGLShader::Vertex, model_lightmap_vert);
324+ _lightmapProgram.addShaderFromSourceCode(QGLShader::Fragment, model_lightmap_frag);
325+ initProgram(_lightmapProgram, _lightmapLocations);
326+
327+ _lightmapNormalMapProgram.addShaderFromSourceCode(QGLShader::Vertex, model_lightmap_normal_map_vert);
328+ _lightmapNormalMapProgram.addShaderFromSourceCode(QGLShader::Fragment, model_lightmap_normal_map_frag);
329+ initProgram(_lightmapNormalMapProgram, _lightmapNormalMapLocations);
330+
331+ _lightmapSpecularMapProgram.addShaderFromSourceCode(QGLShader::Vertex, model_lightmap_vert);
332+ _lightmapSpecularMapProgram.addShaderFromSourceCode(QGLShader::Fragment, model_lightmap_specular_map_frag);
333+ initProgram(_lightmapSpecularMapProgram, _lightmapSpecularMapLocations);
334+
335+ _lightmapNormalSpecularMapProgram.addShaderFromSourceCode(QGLShader::Vertex, model_lightmap_normal_map_vert);
336+ _lightmapNormalSpecularMapProgram.addShaderFromSourceCode(QGLShader::Fragment, model_lightmap_normal_specular_map_frag);
337+ initProgram(_lightmapNormalSpecularMapProgram, _lightmapNormalSpecularMapLocations);
338+ // end lightmap
339+
340+
341+ _shadowProgram.addShaderFromSourceCode(QGLShader::Vertex, model_shadow_vert);
342+ _shadowProgram.addShaderFromSourceCode(QGLShader::Fragment, model_shadow_frag);
343+ // Shadow program uses the same locations as standard rendering path but we still need to set the bindings
344+ Model::Locations tempLoc;
345+ initProgram(_shadowProgram, tempLoc);
346+
347+ _skinProgram.addShaderFromSourceCode(QGLShader::Vertex, skin_model_vert);
348+ _skinProgram.addShaderFromSourceCode(QGLShader::Fragment, model_frag);
349+ initSkinProgram(_skinProgram, _skinLocations);
350+
351+ _skinNormalMapProgram.addShaderFromSourceCode(QGLShader::Vertex, skin_model_normal_map_vert);
352+ _skinNormalMapProgram.addShaderFromSourceCode(QGLShader::Fragment, model_normal_map_frag);
353+ initSkinProgram(_skinNormalMapProgram, _skinNormalMapLocations);
354+
355+ _skinSpecularMapProgram.addShaderFromSourceCode(QGLShader::Vertex, model_vert);
356+ _skinSpecularMapProgram.addShaderFromSourceCode(QGLShader::Fragment, model_specular_map_frag);
357+ initSkinProgram(_skinSpecularMapProgram, _skinSpecularMapLocations);
358+
359+ _skinNormalSpecularMapProgram.addShaderFromSourceCode(QGLShader::Vertex, skin_model_normal_map_vert);
360+ _skinNormalSpecularMapProgram.addShaderFromSourceCode(QGLShader::Fragment, model_normal_specular_map_frag);
361+ initSkinProgram(_skinNormalSpecularMapProgram, _skinNormalSpecularMapLocations);
362+
363+ _skinShadowProgram.addShaderFromSourceCode(QGLShader::Vertex, skin_model_shadow_vert);
364+ _skinShadowProgram.addShaderFromSourceCode(QGLShader::Fragment, model_shadow_frag);
365+ initSkinProgram(_skinShadowProgram, _skinShadowLocations);
366+
367+
368+ _skinTranslucentProgram.addShaderFromSourceCode(QGLShader::Vertex, skin_model_vert);
369+ _skinTranslucentProgram.addShaderFromSourceCode(QGLShader::Fragment, model_translucent_frag);
370370 initSkinProgram(_skinTranslucentProgram, _skinTranslucentLocations);
371371 }
372372 }
@@ -2470,16 +2470,16 @@ int Model::renderMeshesFromList(QVector<int>& list, gpu::Batch& batch, RenderMod · 2097 unmodified lines
24702470 qDebug() << "part INDEX:" << j;
24712471 qDebug() << "NEW part.materialID:" << part.materialID;
24722472 }
2473−
2474− if (locations->glowIntensity >= 0) {
2475− GLBATCH(glUniform1f)(locations->glowIntensity, glowEffect->getIntensity());
2473+
2474+ if (locations->glowIntensity >= 0) {
2475+ GLBATCH(glUniform1f)(locations->glowIntensity, glowEffect->getIntensity());
24762476 }
24772477 if (!(translucent && alphaThreshold == 0.0f)) {
24782478 GLBATCH(glAlphaFunc)(GL_EQUAL, glowEffect->getIntensity());
24792479 }
2480−
2481− if (locations->materialBufferUnit >= 0) {
2482− batch.setUniformBuffer(locations->materialBufferUnit, material->getSchemaBuffer());
2480+
2481+ if (locations->materialBufferUnit >= 0) {
2482+ batch.setUniformBuffer(locations->materialBufferUnit, material->getSchemaBuffer());
24832483 }
24842484
24852485 Texture* diffuseMap = networkPart.diffuseTexture.data();

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t