@kitware/vtk.js 20.2.0 → 20.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -424,15 +424,15 @@ function vtkOpenGLPolyDataMapper(publicAPI, model) {
|
|
|
424
424
|
if (tus && tus.length >= 1) {
|
|
425
425
|
switch (tNumComp) {
|
|
426
426
|
case 1:
|
|
427
|
-
FSSource = vtkShaderProgram.substitute(FSSource, '//VTK::TCoord::Impl', ['vec4 tcolor = texture2D(texture1, tcoordVCVSOutput);', '
|
|
427
|
+
FSSource = vtkShaderProgram.substitute(FSSource, '//VTK::TCoord::Impl', [' vec4 tcolor = texture2D(texture1, tcoordVCVSOutput);', ' ambientColor = ambientColor*tcolor.r;', ' diffuseColor = diffuseColor*tcolor.r;']).result;
|
|
428
428
|
break;
|
|
429
429
|
|
|
430
430
|
case 2:
|
|
431
|
-
FSSource = vtkShaderProgram.substitute(FSSource, '//VTK::TCoord::Impl', ['vec4 tcolor = texture2D(texture1, tcoordVCVSOutput);', '
|
|
431
|
+
FSSource = vtkShaderProgram.substitute(FSSource, '//VTK::TCoord::Impl', [' vec4 tcolor = texture2D(texture1, tcoordVCVSOutput);', ' ambientColor = ambientColor*tcolor.r;', ' diffuseColor = diffuseColor*tcolor.r;', ' opacity = opacity * tcolor.g;']).result;
|
|
432
432
|
break;
|
|
433
433
|
|
|
434
434
|
default:
|
|
435
|
-
FSSource = vtkShaderProgram.substitute(FSSource, '//VTK::TCoord::Impl', '
|
|
435
|
+
FSSource = vtkShaderProgram.substitute(FSSource, '//VTK::TCoord::Impl', [' vec4 tcolor = texture2D(texture1, tcoordVCVSOutput);', ' ambientColor = ambientColor*tcolor.rgb;', ' diffuseColor = diffuseColor*tcolor.rgb;', ' opacity = opacity * tcolor.a;']).result;
|
|
436
436
|
}
|
|
437
437
|
}
|
|
438
438
|
} else {
|
|
@@ -443,15 +443,15 @@ function vtkOpenGLPolyDataMapper(publicAPI, model) {
|
|
|
443
443
|
|
|
444
444
|
switch (tNumComp) {
|
|
445
445
|
case 1:
|
|
446
|
-
FSSource = vtkShaderProgram.substitute(FSSource, '//VTK::TCoord::Impl', ['vec4 tcolor = textureCube(texture1, tcoordVCVSOutput);', '
|
|
446
|
+
FSSource = vtkShaderProgram.substitute(FSSource, '//VTK::TCoord::Impl', [' vec4 tcolor = textureCube(texture1, tcoordVCVSOutput);', ' ambientColor = ambientColor*tcolor.r;', ' diffuseColor = diffuseColor*tcolor.r;']).result;
|
|
447
447
|
break;
|
|
448
448
|
|
|
449
449
|
case 2:
|
|
450
|
-
FSSource = vtkShaderProgram.substitute(FSSource, '//VTK::TCoord::Impl', ['vec4 tcolor = textureCube(texture1, tcoordVCVSOutput);', '
|
|
450
|
+
FSSource = vtkShaderProgram.substitute(FSSource, '//VTK::TCoord::Impl', [' vec4 tcolor = textureCube(texture1, tcoordVCVSOutput);', ' ambientColor = ambientColor*tcolor.r;', ' diffuseColor = diffuseColor*tcolor.r;', ' opacity = opacity * tcolor.g;']).result;
|
|
451
451
|
break;
|
|
452
452
|
|
|
453
453
|
default:
|
|
454
|
-
FSSource = vtkShaderProgram.substitute(FSSource, '//VTK::TCoord::Impl', '
|
|
454
|
+
FSSource = vtkShaderProgram.substitute(FSSource, '//VTK::TCoord::Impl', [' vec4 tcolor = textureCube(texture1, tcoordVCVSOutput);', ' ambientColor = ambientColor*tcolor.rgb;', ' diffuseColor = diffuseColor*tcolor.rgb;', ' opacity = opacity * tcolor.a;']).result;
|
|
455
455
|
}
|
|
456
456
|
}
|
|
457
457
|
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
var vtkPolyDataFS = "//VTK::System::Dec\n\n/*=========================================================================\n\n Program: Visualization Toolkit\n Module: vtkPolyDataFS.glsl\n\n Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen\n All rights reserved.\n See Copyright.txt or http://www.kitware.com/Copyright.htm for details.\n\n This software is distributed WITHOUT ANY WARRANTY; without even\n the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR\n PURPOSE. See the above copyright notice for more information.\n\n=========================================================================*/\n// Template for the polydata mappers fragment shader\n\nuniform int PrimitiveIDOffset;\n\n// VC position of this fragment\n//VTK::PositionVC::Dec\n\n// optional color passed in from the vertex shader, vertexColor\n//VTK::Color::Dec\n\n// optional surface normal declaration\n//VTK::Normal::Dec\n\n// extra lighting parameters\n//VTK::Light::Dec\n\n// Texture coordinates\n//VTK::TCoord::Dec\n\n// picking support\n//VTK::Picking::Dec\n\n// Depth Peeling Support\n//VTK::DepthPeeling::Dec\n\n// clipping plane vars\n//VTK::Clip::Dec\n\n// the output of this shader\n//VTK::Output::Dec\n\n// Apple Bug\n//VTK::PrimID::Dec\n\n// handle coincident offsets\n//VTK::Coincident::Dec\n\n//VTK::ZBuffer::Dec\n\nvoid main()\n{\n // VC position of this fragment. This should not branch/return/discard.\n //VTK::PositionVC::Impl\n\n // Place any calls that require uniform flow (e.g. dFdx) here.\n //VTK::UniformFlow::Impl\n\n // Set gl_FragDepth here (gl_FragCoord.z by default)\n //VTK::Depth::Impl\n\n // Early depth peeling abort:\n //VTK::DepthPeeling::PreColor\n\n // Apple Bug\n //VTK::PrimID::Impl\n\n //VTK::Clip::Impl\n\n //VTK::Color::Impl\n\n // Generate the normal if we are not passed in one\n //VTK::Normal::Impl\n\n //VTK::
|
|
1
|
+
var vtkPolyDataFS = "//VTK::System::Dec\n\n/*=========================================================================\n\n Program: Visualization Toolkit\n Module: vtkPolyDataFS.glsl\n\n Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen\n All rights reserved.\n See Copyright.txt or http://www.kitware.com/Copyright.htm for details.\n\n This software is distributed WITHOUT ANY WARRANTY; without even\n the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR\n PURPOSE. See the above copyright notice for more information.\n\n=========================================================================*/\n// Template for the polydata mappers fragment shader\n\nuniform int PrimitiveIDOffset;\n\n// VC position of this fragment\n//VTK::PositionVC::Dec\n\n// optional color passed in from the vertex shader, vertexColor\n//VTK::Color::Dec\n\n// optional surface normal declaration\n//VTK::Normal::Dec\n\n// extra lighting parameters\n//VTK::Light::Dec\n\n// Texture coordinates\n//VTK::TCoord::Dec\n\n// picking support\n//VTK::Picking::Dec\n\n// Depth Peeling Support\n//VTK::DepthPeeling::Dec\n\n// clipping plane vars\n//VTK::Clip::Dec\n\n// the output of this shader\n//VTK::Output::Dec\n\n// Apple Bug\n//VTK::PrimID::Dec\n\n// handle coincident offsets\n//VTK::Coincident::Dec\n\n//VTK::ZBuffer::Dec\n\nvoid main()\n{\n // VC position of this fragment. This should not branch/return/discard.\n //VTK::PositionVC::Impl\n\n // Place any calls that require uniform flow (e.g. dFdx) here.\n //VTK::UniformFlow::Impl\n\n // Set gl_FragDepth here (gl_FragCoord.z by default)\n //VTK::Depth::Impl\n\n // Early depth peeling abort:\n //VTK::DepthPeeling::PreColor\n\n // Apple Bug\n //VTK::PrimID::Impl\n\n //VTK::Clip::Impl\n\n //VTK::Color::Impl\n\n // Generate the normal if we are not passed in one\n //VTK::Normal::Impl\n\n //VTK::TCoord::Impl\n\n //VTK::Light::Impl\n\n if (gl_FragData[0].a <= 0.0)\n {\n discard;\n }\n\n //VTK::DepthPeeling::Impl\n\n //VTK::Picking::Impl\n\n // handle coincident offsets\n //VTK::Coincident::Impl\n\n //VTK::ZBuffer::Impl\n}\n";
|
|
2
2
|
|
|
3
3
|
export { vtkPolyDataFS as v };
|