Main forum > GLBasic - en
Virtual Screen & Stencil Shadows?
Zapp:
UPDATE: 29/06/2012 - Reworded question to make it clearer for the community :|
Hi Guys,
After leaving the problem for a while to think about it and then coming back to look at it again, after some research it seems that the correct terminology for what I wish to accomplish is stencil shadowing.
Wondering if the following is possible to do the following and if so how would I go about it? I've also attached an image from photoshop explaining what I'd like to accomplish, sadly Mentalthink's method will only assist with 1 lightsource, I need a method that is capable of multiple.
1. Create a Virtual Screen for calculating shadows.
2. Draw a Solid Black Rect for the shadow.
3. Draw over this rect with a gradient where light would be cast.
4. overlay this over my topdown 2d world.
5. Is this possible on IOS without massive slowdown? (I'm using polyvectors and need to maintain at least 30fps)
6. Is this possible with standard GLBASIC or will it require inline code?
Kind Regards,
-Zapp
Hi Guys,
I'm usually pretty good with working out inventive ways to solve a problem on my own, but this one has me stumped.
So I have a small action rpg that I'm working on. The Room is top down, I'd like to be able to have some rooms with different levels of darkness to make the game a little harder.
I've managed to get to this stage just fine as a temporary measure I am able to cover the 2d environment with a solid black texture and vary the transparency using ALPHAMODE.
What I really would like to be able to do is somehow allow for lighting on the level, so for instance if the character has a torch, there is an area around him that isn't shadowed, likewise if there is a candle on the wall, then that area would also be without shadow.
Essentially I want to start with a Black fullscreen texture for shadows and then cut out what isn't in shadow by making it transparent. Is this possible and if so how would I go about doing it? Would it severly impact framerate by being too slow a process? Perhaps since my game is 2d Tile based, I may need to calculate shadows properly and use a shadow map, but I'd like to avoid the extra work of calculating all those poly's, if there is an easier solution that can be achieved by only drawing one poly.
Thanks in advance for the assistance.
-Zapp
okee:
Hi Zapp
Is this topic of any use ?
http://www.glbasic.com/forum/index.php?topic=8124.msg68348#msg68348
Zapp:
Hi Okee,
Thanks for the suggestion, away from development pc at the moment, will take a look at it in the morning.
Regards,
-Zapp
mentalthink:
Hi Zaap I comment this , I think in the post Okee comment, but it´s very easy, only have to do a black great image whit a hole in the center, making whit settrasparency...
The better way it´s in photshop, make the edges in the black hole whit a blur effet this it´s more real else it´s too much cartoon style...
Zapp:
Hi Mental,
Thanks for the reply, I think in this case this may not work, I need to be able to have multiple holes in the shadow. I may just have to go with a full screen poly an use co-ords to fill the screen with black transparency or a small gradient.
Navigation
[0] Message Index
[#] Next page
Go to full version