Gamestudio Links
Zorro Links
Newest Posts
Blobsculptor tools and objects download here
by NeoDumont. 03/28/24 03:01
Issue with Multi-Core WFO Training
by aliswee. 03/24/24 20:20
Why Zorro supports up to 72 cores?
by Edgar_Herrera. 03/23/24 21:41
Zorro Trader GPT
by TipmyPip. 03/06/24 09:27
VSCode instead of SED
by 3run. 03/01/24 19:06
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
5 registered members (Quad, TipmyPip, degenerate_762, AndrewAMD, Nymphodora), 997 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
sakolin, rajesh7827, juergen_wue, NITRO_FOREVER, jack0roses
19043 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Depth buffer and multiple lights #479679
04/17/20 12:24
04/17/20 12:24
Joined: May 2009
Posts: 5,370
Caucasus
3run Offline OP
Senior Expert
3run  Offline OP
Senior Expert

Joined: May 2009
Posts: 5,370
Caucasus
Hey!

So after I went through shader workshop #6 and #7 (shadow mapping), I came across this question. How to add support for multiple light sources? In theory. Would be glad if anyone will poke me in right direction.

Greets!


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
Re: Depth buffer and multiple lights [Re: 3run] #479680
04/17/20 15:29
04/17/20 15:29
Joined: Jul 2007
Posts: 619
Turkey, Izmir
Emre Offline
User
Emre  Offline
User

Joined: Jul 2007
Posts: 619
Turkey, Izmir
I used the txesmi's omnidirectional sample once for multiple light source, long time ago.
But this method not good for performance. So I kept the clip_far of shadow views low. in fact sometimes i even turned off the views and used cubemap as static shadows. My goal was to get rid of stencil shadow bugs.

In one way or another afaik you will need six camera for each light source (for pointlights). i don't know if is there any other way.

Re: Depth buffer and multiple lights [Re: Emre] #479681
04/17/20 15:42
04/17/20 15:42
Joined: May 2009
Posts: 5,370
Caucasus
3run Offline OP
Senior Expert
3run  Offline OP
Senior Expert

Joined: May 2009
Posts: 5,370
Caucasus
Hey Emre! I remember that project of yours! I used to test it back at the time laugh
Originally Posted by Emre
In one way or another afaik you will need six camera for each light source (for pointlights). i don't know if is there any other way.
Yes, it seems so... Shader workshop also says this:
Quote
Thus shadow mappers usually render two 180° views per light (hemispheric shadow mapping), or - for better quality - six 90° views (six-sided shadow mapping). Rendering six view per light makes shadow mapping quite slow, therefore advanced renderers skip views depending on which of the 90° sectors of the light sphere are outside the camera view frustum.
But what I fail at is, understanding, how to pass stuff from all those views (6 per light) into the shader.


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
Re: Depth buffer and multiple lights [Re: 3run] #479685
04/17/20 16:33
04/17/20 16:33
Joined: Jul 2007
Posts: 619
Turkey, Izmir
Emre Offline
User
Emre  Offline
User

Joined: Jul 2007
Posts: 619
Turkey, Izmir
For better answers and explanation, txesmi is best i guess. laugh

Also i made a small example while working on the subject. I don't know if it works for you, but maybe you want to take a look in the meantime.

https://drive.google.com/file/d/1DffukQjfw-LovNPslxR8givJMQeUtfuH/view?usp=sharing

My example is old and codes are not clean. Sorry for that. I didn't think I'd share it with someone while doing it.

Re: Depth buffer and multiple lights [Re: 3run] #479687
04/17/20 18:08
04/17/20 18:08
Joined: May 2009
Posts: 5,370
Caucasus
3run Offline OP
Senior Expert
3run  Offline OP
Senior Expert

Joined: May 2009
Posts: 5,370
Caucasus
It looks very good, thank you for sharing! :> It will be useful to learn from!


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
Re: Depth buffer and multiple lights [Re: 3run] #479689
04/18/20 12:44
04/18/20 12:44
Joined: Jun 2007
Posts: 1,337
Hiporope and its pain
txesmi Offline
Serious User
txesmi  Offline
Serious User

Joined: Jun 2007
Posts: 1,337
Hiporope and its pain
Originally Posted by Emre
i don't know if is there any other way.

I am afraid there is not other way of rendering shadows of dynamic objects from an omnidirectional light. Its true, it is very expensive in performance.


Moderated by  Blink, Hummel, Superku 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1