MCPcopy Create free account
hub / github.com/benfry/processing4 / setCommonUniforms

Method setCommonUniforms

core/src/processing/opengl/PShader.java:1188–1226  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1186
1187
1188 protected void setCommonUniforms() {
1189 if (-1 < transformMatLoc) {
1190 currentPG.updateGLProjmodelview();
1191 setUniformMatrix(transformMatLoc, currentPG.glProjmodelview);
1192 }
1193
1194 if (-1 < modelviewMatLoc) {
1195 currentPG.updateGLModelview();
1196 setUniformMatrix(modelviewMatLoc, currentPG.glModelview);
1197 }
1198
1199 if (-1 < projectionMatLoc) {
1200 currentPG.updateGLProjection();
1201 setUniformMatrix(projectionMatLoc, currentPG.glProjection);
1202 }
1203
1204 if (-1 < viewportLoc) {
1205 float x = currentPG.viewport.get(0);
1206 float y = currentPG.viewport.get(1);
1207 float w = currentPG.viewport.get(2);
1208 float h = currentPG.viewport.get(3);
1209 setUniformValue(viewportLoc, x, y, w, h);
1210 }
1211
1212 if (-1 < resolutionLoc) {
1213 float w = currentPG.viewport.get(2);
1214 float h = currentPG.viewport.get(3);
1215 setUniformValue(resolutionLoc, w, h);
1216 }
1217
1218 if (-1 < ppixelsLoc) {
1219 ppixelsUnit = getLastTexUnit() + 1;
1220 setUniformValue(ppixelsLoc, ppixelsUnit);
1221 pgl.activeTexture(PGL.TEXTURE0 + ppixelsUnit);
1222 currentPG.bindFrontTexture();
1223 } else {
1224 ppixelsUnit = -1;
1225 }
1226 }
1227
1228
1229 protected void bindTyped() {

Callers 1

bindTypedMethod · 0.95

Calls 9

setUniformMatrixMethod · 0.95
setUniformValueMethod · 0.95
getLastTexUnitMethod · 0.95
updateGLProjmodelviewMethod · 0.80
updateGLModelviewMethod · 0.80
updateGLProjectionMethod · 0.80
activeTextureMethod · 0.80
getMethod · 0.65
bindFrontTextureMethod · 0.45

Tested by

no test coverage detected