Problem with gradient triangles

Started by
2 comments, last by Kethor 15 years, 6 months ago
I've been working on soft shadows in OpenGL, however I got problem with gradients: Shadows:
http://i38.tinypic.com/155i1vk.jpg
you can notice on above image the lines on each edge Method of drawing (triangles):
http://images.gamedev.net/features/programming/2dsoftshadow/03HullGeneration.gif
My question is: Is there any method to fix this or any work-around (I'm talking about lines one each edge)? p.s. you might notice the shadows are just black & white. This is because I haven't added blend mode to it. Don't worry about that :) ~Keth
Advertisement
You could extend two (or more) lines per shadowed vertex in order to tessalate your shadow hull more, which would reduce the visible discontinuities.

However generally you probably don't need to do this - by the time you've added blending so the surface textures show through it won't be visible. More so when you've got ambient light and multiple light sources.
http://i33.tinypic.com/2rr4ec1.jpg
Not really, you can still notice it with blend mode added (especially on the left side). I tried ALL combinations of blend modes even combining them (15*15 = 225 combinations) however, none of them are correct.
However, extending the shadow and adding another vector point would slow down a lot. I really care about the speed.

p.s. I will be adding penumbra as soon as I will finish this part.

Edit: Oh, you are OrangyTang! Awesome article man. :)
Edit2: You are right about blending, however on the picture in this post it's caused because of the static shadow length. I will think about changing the method.

[Edited by - Kethor on October 12, 2008 7:51:39 PM]
OrangyTang, could you please explain a bit more what you mean by saying "extend two (or more) lines per shadowed vertex"?

Do you mean something like this?
http://i33.tinypic.com/5b3gb4.jpg


If yes then there is another trouble with that:
http://i33.tinypic.com/15cgcue.jpg


Anyone else having any idea about that?

This topic is closed to new replies.

Advertisement