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
2031 }2031 }
2032 static bool showDiffuse = true;2032 static bool showDiffuse = true;
2033 if (showDiffuse && diffuseMap) {2033 if (showDiffuse && diffuseMap) {
2034 batch.setUniformTexture(0, diffuseMap->getGPUTexture());2034 batch.setResourceTexture(0, diffuseMap->getGPUTexture());
2035 2035
2036 } else {2036 } else {
2037 batch.setUniformTexture(0, textureCache->getWhiteTexture());2037 batch.setResourceTexture(0, textureCache->getWhiteTexture());
2038 }2038 }
2039 2039
2040 if (locations->texcoordMatrices >= 0) {2040 if (locations->texcoordMatrices >= 0) {
@@ -2050,14 +2050,14 @@ void Model::renderPart(RenderArgs* args, int meshIndex, int partIndex, bool tran · 9 unmodified lines
2050 2050
2051 if (!mesh.tangents.isEmpty()) { 2051 if (!mesh.tangents.isEmpty()) {
2052 Texture* normalMap = networkPart.normalTexture.data();2052 Texture* normalMap = networkPart.normalTexture.data();
2053 batch.setUniformTexture(1, !normalMap ?2053 batch.setResourceTexture(1, !normalMap ?
2054 textureCache->getBlueTexture() : normalMap->getGPUTexture());2054 textureCache->getBlueTexture() : normalMap->getGPUTexture());
2055 2055
2056 }2056 }
2057 2057
2058 if (locations->specularTextureUnit >= 0) {2058 if (locations->specularTextureUnit >= 0) {
2059 Texture* specularMap = networkPart.specularTexture.data();2059 Texture* specularMap = networkPart.specularTexture.data();
2060 batch.setUniformTexture(locations->specularTextureUnit, !specularMap ?2060 batch.setResourceTexture(locations->specularTextureUnit, !specularMap ?
2061 textureCache->getWhiteTexture() : specularMap->getGPUTexture());2061 textureCache->getWhiteTexture() : specularMap->getGPUTexture());
2062 }2062 }
2063 2063
@@ -2074,7 +2074,7 @@ void Model::renderPart(RenderArgs* args, int meshIndex, int partIndex, bool tran · 10 unmodified lines
2074 GLBATCH(glUniform2f)(locations->emissiveParams, emissiveOffset, emissiveScale);2074 GLBATCH(glUniform2f)(locations->emissiveParams, emissiveOffset, emissiveScale);
2075 2075
2076 Texture* emissiveMap = networkPart.emissiveTexture.data();2076 Texture* emissiveMap = networkPart.emissiveTexture.data();
2077 batch.setUniformTexture(locations->emissiveTextureUnit, !emissiveMap ?2077 batch.setResourceTexture(locations->emissiveTextureUnit, !emissiveMap ?
2078 textureCache->getWhiteTexture() : emissiveMap->getGPUTexture());2078 textureCache->getWhiteTexture() : emissiveMap->getGPUTexture());
2079 }2079 }
2080 2080