Gamestudio Links
Zorro Links
Newest Posts
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
M1 Oversampling
by jcl. 04/26/24 11:12
Why Zorro supports up to 72 cores?
by jcl. 04/26/24 11:09
Eigenwerbung
by jcl. 04/26/24 11:08
MT5 bridge not working on MT5 v. 5 build 4160
by EternallyCurious. 04/25/24 20:49
Trading Journey
by howardR. 04/24/24 20:04
Zorro FIX plugin - Experimental
by flink. 04/21/24 07:12
Scripts not found
by juergen_wue. 04/20/24 18:51
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
5 registered members (howardR, AndrewAMD, EternallyCurious, Petra, 1 invisible), 791 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Mega_Rod, EternallyCurious, howardR, 11honza11, ccorrea
19048 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 2 of 3 1 2 3
Re: Variance Shadow Mapping [Re: mpdeveloper_B] #178212
01/17/08 17:18
01/17/08 17:18
Joined: May 2005
Posts: 2,713
Lübeck
Slin Offline OP
Expert
Slin  Offline OP
Expert

Joined: May 2005
Posts: 2,713
Lübeck
There are three views at the suns position facing the camera with different arc values. Each of them renders a depthmap.
There is an other view placed at the same position as camera having always the same parameters. The objects in this view are rendered with a shader which compares their "real" distance to the light for each pixel using always the depthmap with the highest resolution possible for it. If the "real" depth is bigger than the one safed in the depthmap, it is a shadow and is rendered in a dark grey otherwise it is rendered white. This is then combined per postprocessing with the image rendered by the camera and then displayed.
This is basicly how it works. I also blur the shadowmap which has the smallest arc to get softer shadows near to the camera. This is all combined with keeping the square of the depth in the depthmaps which is used for the variance part...

That is basicly how it works.
It could also be done with A6 comm and render to texture.

Re: Variance Shadow Mapping [Re: Slin] #178213
01/17/08 19:55
01/17/08 19:55
Joined: Mar 2006
Posts: 2,758
Antwerp,Belgium
frazzle Offline
Expert
frazzle  Offline
Expert

Joined: Mar 2006
Posts: 2,758
Antwerp,Belgium
Thanks for putting this in the UC Nils, I'll see what happens if I cut done the conditionals thus I need to think of a way to handle the different depth maps off course

Cheers

Frazzle


Antec® Case
Intel® X58 Chipset
Intel® i7 975 Quad Core
8 GB RAM DDR3
SSD OCZ®-VERTEX2 3.5 x4 ; HD 600 GB
NVIDIA® GeForce GTX 295 Memory 1795GB
Re: Variance Shadow Mapping [Re: frazzle] #178214
02/15/08 04:32
02/15/08 04:32
Joined: Sep 2005
Posts: 508
Texas
not_me Offline
User
not_me  Offline
User

Joined: Sep 2005
Posts: 508
Texas
now you say its possible with a6 comm and r2t dll? if so how?


-Initiate Games
-Level designer

http://www.sckratchmagazine.com
Re: Variance Shadow Mapping [Re: not_me] #178215
02/15/08 15:27
02/15/08 15:27
Joined: May 2005
Posts: 2,713
Lübeck
Slin Offline OP
Expert
Slin  Offline OP
Expert

Joined: May 2005
Posts: 2,713
Lübeck
Quote:

now you say its possible with a6 comm and r2t dll? if so how?



It is, but it is quite a bit of work for which I don´t have the time at the moment. I´ve got some plans for further shadowdevelopement, but at the moment I have to gain some more math skills and a better knowledge of directx.
I am working on it, but it will take quite a bit of time. But then I hope that it´ll work for A6 as well. And also that it will run on more systems, without problems.
At the moment I am trying to get this working...: http://www.cg.tuwien.ac.at/~scherzer/lssm/index.html

I don´t know how the whole thing will turn out, if it ever will


But if you want to convert the code to c-script, you will have to replace the stages feature and the viewmaterials, through materialevents and a viewaligned quad...

Re: Variance Shadow Mapping [Re: Slin] #178216
02/18/08 15:21
02/18/08 15:21
Joined: Apr 2007
Posts: 3,751
Canada
WretchedSid Offline
Expert
WretchedSid  Offline
Expert

Joined: Apr 2007
Posts: 3,751
Canada
Hey, das gefällt mir echt gut. Leider hab ich ein kleines Problem. Die Kamera befindet sich in meinem Spiel ca. 6000 Quants von den Objekten entfernt und auf die Entfernung wird kein Schatten mehr gezeigt. Jetzt hab ich die Modelle runterskaliert und die Kamera näher an die Objekte gebracht, aber da treten ein paar unschöne neben Effekte auf ( http://www4.picfront.org/picture/erN6FSvqfJc/img/Shadow.png ). Gibt es eine Möglichkeit eines der Probleme in den Griff zu bekommen? Ich bin absoluter Noob in sachen Shadern, also bitte nicht mit Fachlatein erschlagen.


Shitlord by trade and passion. Graphics programmer at Laminar Research.
I write blog posts at feresignum.com
Re: Variance Shadow Mapping [Re: Slin] #178217
02/18/08 18:13
02/18/08 18:13
Joined: Feb 2006
Posts: 2,185
mpdeveloper_B Offline
Expert
mpdeveloper_B  Offline
Expert

Joined: Feb 2006
Posts: 2,185
Quote:

Quote:

now you say its possible with a6 comm and r2t dll? if so how?



It is, but it is quite a bit of work for which I don´t have the time at the moment. I´ve got some plans for further shadowdevelopement, but at the moment I have to gain some more math skills and a better knowledge of directx.
I am working on it, but it will take quite a bit of time. But then I hope that it´ll work for A6 as well. And also that it will run on more systems, without problems.
At the moment I am trying to get this working...: http://www.cg.tuwien.ac.at/~scherzer/lssm/index.html

I don´t know how the whole thing will turn out, if it ever will


But if you want to convert the code to c-script, you will have to replace the stages feature and the viewmaterials, through materialevents and a viewaligned quad...




wow, it's nice to know that, i would try to do it, but right now i don't have time for it

Last edited by mpdeveloper_B; 02/18/08 18:15.

- aka Manslayer101
Re: Variance Shadow Mapping [Re: WretchedSid] #178218
02/18/08 18:23
02/18/08 18:23
Joined: Sep 2003
Posts: 5,900
Bielefeld, Germany
Pappenheimer Offline
Senior Expert
Pappenheimer  Offline
Senior Expert

Joined: Sep 2003
Posts: 5,900
Bielefeld, Germany
Konstruiere das Haus mit einem Dachüberstand!

Slin hat den Shader programmiert, so gut er konnte, und hat damit schon einige Erfahrung. Wenn er gewußt hätte, wie es besser geht, hätte er es bereits entsprechend programmiert.

Jede Modifikation an dem Shader wird zu kompliziert sein, als dass man es als Neuling verstehen kann, würde ich aus meinen Beobachtungen schließen.

Re: Variance Shadow Mapping [Re: WretchedSid] #178219
02/18/08 19:01
02/18/08 19:01
Joined: May 2005
Posts: 2,713
Lübeck
Slin Offline OP
Expert
Slin  Offline OP
Expert

Joined: May 2005
Posts: 2,713
Lübeck
Quote:

Hey, das gefällt mir echt gut. Leider hab ich ein kleines Problem. Die Kamera befindet sich in meinem Spiel ca. 6000 Quants von den Objekten entfernt und auf die Entfernung wird kein Schatten mehr gezeigt. Jetzt hab ich die Modelle runterskaliert und die Kamera näher an die Objekte gebracht, aber da treten ein paar unschöne neben Effekte auf ( http://www4.picfront.org/picture/erN6FSvqfJc/img/Shadow.png ). Gibt es eine Möglichkeit eines der Probleme in den Griff zu bekommen? Ich bin absoluter Noob in sachen Shadern, also bitte nicht mit Fachlatein erschlagen.




Versuch dein Level mal im Verhältnis zum unskalierten Cbabe-Modell zu bauen. Dann hast du das Größenverhältnis mit welchem ich die Schatten nutze.
Dein "Problem" kenne ich, habe aber bisher nur eine Vermutung worann es liegen könnte und es bisher nur durch vorsichtige Lichtquellenplatzierung und relativ großem Bias weniger sichtbar machen können.

Re: Variance Shadow Mapping [Re: Slin] #178220
02/20/08 22:38
02/20/08 22:38
Joined: Jan 2007
Posts: 1,619
Germany
Scorpion Offline
Serious User
Scorpion  Offline
Serious User

Joined: Jan 2007
Posts: 1,619
Germany
Es liegt doch dadran, dass jeder Texel der Shadowmap eine gewisse Größe hat. Wenn jetzt eine Fläche ziemlich steil zur Lichtquelle steht, werden natürlich weniger Texel für das speichern der Entfernung benutzt. Sodass der Wert dann an dieser Fläche manchmal gleichgroß, manchmal größer ist als die Entfernung. Die Striche kommen daher, dass immer nur die Kanten der einzelnen Texel ausreichen um es beleuchten...der Rest nicht.

Es sollte wahrscheinlich schon reichen einen gewissen toleranzwert zu setzten, in dem dann noch Schatten herrscht. Habe mich aber noch nicht näher mit diesem Shader beschäftigt und stelle hier nur Vermutungen an.


PS: Als ich versucht habe den Shader in ein eigenes Projekt einzubinden, sind alle Objekte, bis auf die mit Alphachanel unsichtbar geworden :S Naja, wird wohl mein Fehler sein...

Re: Variance Shadow Mapping [Re: Scorpion] #178221
02/28/08 16:23
02/28/08 16:23
Joined: Nov 2007
Posts: 1,032
Croatia
croman Offline
Serious User
croman  Offline
Serious User

Joined: Nov 2007
Posts: 1,032
Croatia
Great work Slin.

Can you please post a really small tutorial on how to implement those shadows in other project. How to, for example, get this stuff working with a single model in very simple level. I and other people would really appreciate it.

Can you do that, please? Thanks in front.



Ubi bene, ibi Patria.
Page 2 of 3 1 2 3

Moderated by  adoado, checkbutton, mk_1, Perro 

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