History

Replacing setUniformTexture by setResourceTexture in order to differenciate the 2 types of binding points for the BUffers.

Sam Gateau committed 11 years ago

Commit 7fc9fd91 parent cac239a15 files · +38 −38Browse files

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

Unified · Split

libraries/render-utils/src/Model.cpp+5−5
@@ -2031,10 +2031,10 @@ void Model::renderPart(RenderArgs* args, int meshIndex, int partIndex, bool tran · 2030 unmodified lines
20312031 }
20322032 static bool showDiffuse = true;
20332033 if (showDiffuse && diffuseMap) {
2034− batch.setUniformTexture(0, diffuseMap->getGPUTexture());
2034+ batch.setResourceTexture(0, diffuseMap->getGPUTexture());
20352035
20362036 } else {
2037− batch.setUniformTexture(0, textureCache->getWhiteTexture());
2037+ batch.setResourceTexture(0, textureCache->getWhiteTexture());
20382038 }
20392039
20402040 if (locations->texcoordMatrices >= 0) {
@@ -2050,14 +2050,14 @@ void Model::renderPart(RenderArgs* args, int meshIndex, int partIndex, bool tran · 9 unmodified lines
20502050
20512051 if (!mesh.tangents.isEmpty()) {
20522052 Texture* normalMap = networkPart.normalTexture.data();
2053− batch.setUniformTexture(1, !normalMap ?
2053+ batch.setResourceTexture(1, !normalMap ?
20542054 textureCache->getBlueTexture() : normalMap->getGPUTexture());
20552055
20562056 }
20572057
20582058 if (locations->specularTextureUnit >= 0) {
20592059 Texture* specularMap = networkPart.specularTexture.data();
2060− batch.setUniformTexture(locations->specularTextureUnit, !specularMap ?
2060+ batch.setResourceTexture(locations->specularTextureUnit, !specularMap ?
20612061 textureCache->getWhiteTexture() : specularMap->getGPUTexture());
20622062 }
20632063
@@ -2074,7 +2074,7 @@ void Model::renderPart(RenderArgs* args, int meshIndex, int partIndex, bool tran · 10 unmodified lines
20742074 GLBATCH(glUniform2f)(locations->emissiveParams, emissiveOffset, emissiveScale);
20752075
20762076 Texture* emissiveMap = networkPart.emissiveTexture.data();
2077− batch.setUniformTexture(locations->emissiveTextureUnit, !emissiveMap ?
2077+ batch.setResourceTexture(locations->emissiveTextureUnit, !emissiveMap ?
20782078 textureCache->getWhiteTexture() : emissiveMap->getGPUTexture());
20792079 }
20802080