Gradient outer glow

Hi members!
I need a glow for my object. I was trying to do it based on this example.
But there is a problem here! My glow is solid black.
I reproduced a codepen example to debug it.

Please take a look to see you can find the problem.
Note: I tried it without gradient color just like the main example. But the same result!

I think, (I haven’t checked your code), but, Its probably all dark because of your background

The problem is in your Vertex shader’s intensity calculation:

intensity = pow( c - dot(vNormal, vNormel), p );

If you change the fragment shader to vec3 glow = color * 1.0;, instead of using intensity then you’ll see the glow, so the problem is how you’re calculating intensity. Might be setting it to 0.0, since color * 0 = black.

Hmm. Right. Maybe I should give up on using intensity. Because in my case, I don’t move and change camera’s position. Maybe a constant value works fine.
I’ll give it a try.