Gamestudio Links
Zorro Links
Newest Posts
Zorro S for Oanda US
by SteveG. 06/06/20 15:24
The Black Book
by SteveG. 06/06/20 14:01
Indicator coding
by danatrader. 06/06/20 11:53
New AUM
by Aku_Aku. 06/06/20 10:10
Reading a TXT file on server
by Truth. 06/05/20 18:22
Oanda instruments
by Morris. 06/05/20 10:24
AUM Magazine
Latest Screens
The Space Between
Pogostuck: Rage With Your Friends
Worst Case Z
AckCon'18 - Lotter vs the World 2 - Preview Release
Who's Online Now
7 registered members (kalmar, Grat, SteveG, AndrewAMD, Mio, 3run, Iglarion), 475 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Frank_Shieh, PBSeven, Hardi01, Giuseppe, AdamWu
18461 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,265
Caucasus
3run Online OP
Senior Expert
3run  Online OP
Senior Expert

Joined: May 2009
Posts: 5,265
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
Re: Depth buffer and multiple lights [Re: 3run] #479680
04/17/20 15:29
04/17/20 15:29
Joined: Jul 2007
Posts: 563
Turkey, izmir
Emre Offline
User
Emre  Offline
User

Joined: Jul 2007
Posts: 563
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,265
Caucasus
3run Online OP
Senior Expert
3run  Online OP
Senior Expert

Joined: May 2009
Posts: 5,265
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
Re: Depth buffer and multiple lights [Re: 3run] #479685
04/17/20 16:33
04/17/20 16:33
Joined: Jul 2007
Posts: 563
Turkey, izmir
Emre Offline
User
Emre  Offline
User

Joined: Jul 2007
Posts: 563
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,265
Caucasus
3run Online OP
Senior Expert
3run  Online OP
Senior Expert

Joined: May 2009
Posts: 5,265
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
Re: Depth buffer and multiple lights [Re: 3run] #479689
04/18/20 12:44
04/18/20 12:44
Joined: Jun 2007
Posts: 1,322
Hiporope and its pain
txesmi Offline
Serious User
txesmi  Offline
Serious User

Joined: Jun 2007
Posts: 1,322
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