# Actor opacity \< 1 makes my rendering out of the viewport bounds !

**URL:** https://discourse.vtk.org/t/actor-opacity-1-makes-my-rendering-out-of-the-viewport-bounds/15607
**Category:** Web
**Tags:** vtkjs
**Created:** [May 12, 2025, 4:17pm UTC](https://discourse.vtk.org/t/actor-opacity-1-makes-my-rendering-out-of-the-viewport-bounds/15607 "2025-05-12T16:17:38Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![MC\_TA](https://discourse.vtk.org/user_avatar/discourse.vtk.org/mc_ta/32/9993_2.png) [@MC\_TA](https://discourse.vtk.org/u/MC_TA)
#### Post date: [May 12, 2025, 4:17pm UTC](https://discourse.vtk.org/t/actor-opacity-1-makes-my-rendering-out-of-the-viewport-bounds/15607/1 "2025-05-12T16:17:38Z")

</div>

i’m creating a quadrant view using vtkjs, 3 planes for AX, Cor, Sag and STL viewer,  
creating one renderWindowView with 4 viewports,  
without opacity of my STL actor, everything works as expected,

the problem is once i set opacity to 0.5 for eg, im getting my stl mesh being rendered in the center of the container and not in the specific viewport for the mesh !!

```auto
meshesArray.forEach(({ polyData, color }) => {
      const mapper = vtkMapper.newInstance();
      mapper.setInputData(polyData);

      if (color) {
        mapper.setScalarVisibility(false);
      } else {
        mapper.setScalarVisibility(true);
        mapper.setScalarModeToUsePointData();
        mapper.setColorModeToDirectScalars();
      }

      const actor = vtkActor.newInstance();
      actor.setMapper(mapper);

      if (color) {
        const [r, g, b] = hexToRgb(color);
        const prop = actor.getProperty();
        prop.setColor(r, g, b);
        prop.setDiffuse(0.8);
        prop.setAmbient(0.2);
        prop.setSpecular(0.1);
        // prop.setOpacity(0.8);
      }

      renderer.addActor(actor);
    });

    renderer.resetCamera();
    renderWindow.render();

```

when i use prop.setOpacity(0.8); everything crashed !

---

<div class="post-metadata">

### Author: ![Forrest](https://discourse.vtk.org/user_avatar/discourse.vtk.org/forrest/32/300_2.png) [@Forrest](https://discourse.vtk.org/u/Forrest)
#### Post date: [May 21, 2025, 3:58pm UTC](https://discourse.vtk.org/t/actor-opacity-1-makes-my-rendering-out-of-the-viewport-bounds/15607/2 "2025-05-21T15:58:30Z")

</div>

What happens when things crash? Are there relevant logs in the developer’s console? What platform & browser are you using, and is this reproducible across platforms/browsers?

---

<div class="post-metadata">

### Author: ![MC\_TA](https://discourse.vtk.org/user_avatar/discourse.vtk.org/mc_ta/32/9993_2.png) [@MC\_TA](https://discourse.vtk.org/u/MC_TA)
#### Post date: [May 21, 2025, 4:29pm UTC](https://discourse.vtk.org/t/actor-opacity-1-makes-my-rendering-out-of-the-viewport-bounds/15607/3 "2025-05-21T16:29:04Z")

</div>

> [@MC\_TA](#):
>

the problem is once i set opacity to 0.5 for eg, im getting my stl meshes being rendered in the center of the container and not in the specific viewport for meshes !!

there is no errors being raised in the console, just the rendering being out of the viewport boundaries, and i’ve just test it on brave browser.

i got some answers online said that each actor with opacity under 1.0 will be ignored or something like that.
