Gamestudio Links
Zorro Links
Newest Posts
Reducing Function Times
by 3run. 08/12/20 06:22
Sierra Chart Plugin
by AndrewAMD. 08/11/20 22:41
New Zorro version 2.30
by Zheka. 08/11/20 15:49
avg spread every tick
by Grat. 08/11/20 10:34
strtok() returns temporary string
by Morris. 08/10/20 15:31
problem with adding new history
by jcl. 08/10/20 14:27
Sam Foster Sound | Experienced Game Composer for Hire
by titanicpiano14. 08/10/20 12:02
AUM Magazine
Latest Screens
Untitled Walking Simulator
The Space Between
Pogostuck: Rage With Your Friends
Worst Case Z
Who's Online Now
9 registered members (Janusz, alibaba, rafaelghd, jenGs, Grat, Jerome8911, 3run, FLD, Dooley), 465 guests, and 7 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Sovattha, DonSergio, bigimpactsound, tzw101, Al82
18491 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,287
Caucasus
3run Online OP
Senior Expert
3run  Online OP
Senior Expert

Joined: May 2009
Posts: 5,287
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: 576
Turkey, izmir
Emre Offline
User
Emre  Offline
User

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

Joined: May 2009
Posts: 5,287
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: 576
Turkey, izmir
Emre Offline
User
Emre  Offline
User

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

Joined: May 2009
Posts: 5,287
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,328
Hiporope and its pain
txesmi Offline
Serious User
txesmi  Offline
Serious User

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