<p>It looks like there are a few steps to make this work:</p>

<ol>
<li>Linearly interpolate the alpha of the mesh from transparent to fully opaque, or vice versa. 

<ul>
<li><em>Note 1: It seems as if the alpha starts to fade a few seconds after the effect has started.</em></li>
<li><em>Note 2: The alpha of the "effect meshes" (covered in #2 and #3) should be changed independently of the original mesh. This will help produce the desired effect.</em></li>
</ul></li>
<li>Generate (just the color buffer for) a mesh with identical vertices, but make the color blue or green. The brightness of each vertice's/triangle's color should be calculated using either <strong>random noise</strong> (i.e. using a random number generator), or <strong><a href="https://en.wikipedia.org/wiki/Perlin_noise" rel="nofollow noreferrer">Perlin Noise</a></strong>; or a combination of the two. For the flashing effect, it would be best to regenerate the mesh each frame (with a different noise seed, if using Perlin Noise). Next, calculate a weighted average between the colors of this "effect mesh" and the those of the original mesh, according to how much time has passed. For instance, assuming <code>t</code> is the percentage of the way through the effect that has passed; at <code>t=0</code>, make the color buffer <code>0*effect_mesh + 1*original_mesh</code>; and at <code>t=0.3</code>, make the color buffer <code>0.3*effect_mesh + 0.7*original_mesh</code>.</li>
<li>For the vertical line effect, think about ray-tracing all the vertices (using multiple vertical rays). If a vertex is hit by (or near) a ray, make that vertex's color lighter/darker. This effect would be best done with a weighted average also, according to the time (since the lines are stronger towards the beginning).</li>
</ol>

<p>*** Although this "Star Trek" effect varies from scene to scene, you should order these effects; don't do them all at the same time.</p>

CC BY-SA 3.0
2017-07-30T00:12:54.133Z
Thanks Clabe45 for the excellent suggestion. I'll give this a shot and revert if I run into issues or have more questions
Sharat V Chandrasekhar
CC BY-SA 3.0
2017-07-30T00:37:55.227Z
No problem. I apologize if I didn't answer directly since I don't really understand list objects.
clabe45
CC BY-SA 3.0
2017-07-29T19:42:06.340Z
2017-08-01T18:40:09.653Z
2017-08-01T18:40:09.653Z
clabe45
<p>I have a number of (opaque) objects created using the glGenLists() glNewList() utilities. As generated, the Alpha values are all set to 1</p>

<p>Is there a way to make these objects when summoned blend into the scene (sort of as if they were being teleported using the Star Trek transporter). Likewise, I'd also like them to dissolve away when dismissed.</p>

<p>I could of course use time-varying alpha blending in a subroutine if they weren't list objects, but I'm wondering if there's a performance penalty associated with that.</p>

<p>What I'm really trying to do is replace larger coarser ground texture quads  with finer smaller quads as I descend in altitude from a satellite while looking down.</p>

<p>Thanks</p>

<opengl><blending><alpha>
Make Object created in a list blend in/dissolve out of a scene
Sharat V Chandrasekhar
# Make Object created in a list blend in/dissolve out of a scene

(Asked by: username_0 on 2017-07-27)

I have a number of (opaque) objects created using the glGenLists() glNewList() utilities. As generated, the Alpha values are all set to 1

Is there a way to make these objects when summoned blend into the scene (sort of as if they were being teleported using the Star Trek transporter). Likewise, I'd also like them to dissolve away when dismissed.

I could of course use time-varying alpha blending in a subroutine if they weren't list objects, but I'm wondering if there's a performance penalty associated with that.

What I'm really trying to do is replace larger coarser ground texture quads with finer smaller quads as I descend in altitude from a satellite while looking down.

Thanks

**Tags:** opengl, blending, alpha


---

## 1 answers

### Answer by username_1 on 2017-07-29. Score: 1

It looks like there are a few steps to make this work:

1. Linearly interpolate the alpha of the mesh from transparent to fully opaque, or vice versa.
   * *Note 1: It seems as if the alpha starts to fade a few seconds after the effect has started.*
   * *Note 2: The alpha of the "effect meshes" (covered in #2 and #3) should be changed independently of the original mesh. This will help produce the desired effect.*
2. Generate (just the color buffer for) a mesh with identical vertices, but make the color blue or green. The brightness of each vertice's/triangle's color should be calculated using either **random noise** (i.e. using a random number generator), or **[Perlin Noise](https://en.wikipedia.org/wiki/Perlin_noise)**; or a combination of the two. For the flashing effect, it would be best to regenerate the mesh each frame (with a different noise seed, if using Perlin Noise). Next, calculate a weighted average between the colors of this "effect mesh" and the those of the original mesh, according to how much time has passed. For instance, assuming `t` is the percentage of the way through the effect that has passed; at `t=0`, make the color buffer `0*effect_mesh + 1*original_mesh`; and at `t=0.3`, make the color buffer `0.3*effect_mesh + 0.7*original_mesh`.
3. For the vertical line effect, think about ray-tracing all the vertices (using multiple vertical rays). If a vertex is hit by (or near) a ray, make that vertex's color lighter/darker. This effect would be best done with a weighted average also, according to the time (since the lines are stronger towards the beginning).

\*\*\* Although this "Star Trek" effect varies from scene to scene, you should order these effects; don't do them all at the same time.

> **Comments:**
> **username_0**: Thanks username_1 for the excellent suggestion. I'll give this a shot and revert if I run into issues or have more questions  
> **username_1**: No problem. I apologize if I didn't answer directly since I don't really understand list objects.  

---

