Welcome,
Guest
. Please
login
or
register
. Did you miss your
activation email?
French forum
Home
Help
Search
Login
Register
SFML community forums
»
Help
»
Graphics
»
Draw a sprite trough a polygon mask
Print
Pages: [
1
]
Author
Topic: Draw a sprite trough a polygon mask (Read 1263 times)
0 Members and 1 Guest are viewing this topic.
Irksome Ninja
Newbie
Posts: 2
Draw a sprite trough a polygon mask
«
on:
February 18, 2015, 01:00:33 pm »
I have been making a 2D visiblity algorithm by following this tutorial
http://simblob.blogspot.se/2012/07/2d-visibility.html
I have managed to create the light vertices and it works fine when I draw it in a single color, but I want to use a shadow map to get "faded" lights like this:
http://i.ytimg.com/vi/2yrgzlRhAes/maxresdefault.jpg
Mine looks like this now:
http://i.imgur.com/wAdRBr9.png
where the blue dot is the light center and the green is the lighted area.
How can I "apply" a sprite to this like this one:
http://www.alcove-games.com/wp-content/uploads/2013/06/light.png
?
My code lies here:
https://github.com/doodlemeat/bugfree-octo-sansa
Logged
Print
Pages: [
1
]
SFML community forums
»
Help
»
Graphics
»
Draw a sprite trough a polygon mask