Skip to content

Commit 56775db

Browse files
authored
Merge pull request #2605 from PaulHax/texture-varying-components
fix(Texture): update internalFormat when component count changes
2 parents f4765f6 + b051363 commit 56775db

File tree

1 file changed

+4
-1
lines changed
  • Sources/Rendering/OpenGL/Texture

1 file changed

+4
-1
lines changed

Sources/Rendering/OpenGL/Texture/index.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@ function vtkOpenGLTexture(publicAPI, model) {
350350

351351
//----------------------------------------------------------------------------
352352
publicAPI.getInternalFormat = (vtktype, numComps) => {
353-
if (!model.internalFormat) {
353+
if (!model._forceInternalFormat) {
354354
model.internalFormat = publicAPI.getDefaultInternalFormat(
355355
vtktype,
356356
numComps
@@ -399,6 +399,7 @@ function vtkOpenGLTexture(publicAPI, model) {
399399

400400
//----------------------------------------------------------------------------
401401
publicAPI.setInternalFormat = (iFormat) => {
402+
model._forceInternalFormat = true;
402403
if (iFormat !== model.internalFormat) {
403404
model.internalFormat = iFormat;
404405
publicAPI.modified();
@@ -447,6 +448,7 @@ function vtkOpenGLTexture(publicAPI, model) {
447448
publicAPI.resetFormatAndType = () => {
448449
model.format = 0;
449450
model.internalFormat = 0;
451+
model._forceInternalFormat = false;
450452
model.openGLDataType = 0;
451453
};
452454

@@ -1465,6 +1467,7 @@ function vtkOpenGLTexture(publicAPI, model) {
14651467

14661468
const DEFAULT_VALUES = {
14671469
_openGLRenderWindow: null,
1470+
_forceInternalFormat: false,
14681471
context: null,
14691472
handle: 0,
14701473
sendParametersTime: null,

0 commit comments

Comments
 (0)