2 registered members (Ayumi, 1 invisible),
584
guests, and 1
spider. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: Shade-C v0.91 BETA S1 RELEASED
[Re: sivan]
#424614
06/19/13 13:16
06/19/13 13:16
|
Joined: Mar 2011
Posts: 3,150 Budapest
sivan
Expert
|
Expert
Joined: Mar 2011
Posts: 3,150
Budapest
|
another 2 problems I faced with, I would be happy if anybody could help me:
I cannot get dynamic softshadows. I mean shadowmapping is fine but not soft. the blurring does no blurring at all, something wrong somewhere... sc_vsmSunBlur.fx does something but the final result always a black or white output.
shadowmapping area in case of very high camera positions is not at right place or orientation, so fades out in a bad way.
thanks.
EDIT: problem 2 is more or less solved by using an entity of my own camera system instead of the default sun dummy entity.
edit2: I modified the vsmBlur shader, so now it works okay. maybe a pp stage should be added for (optional) further smoothing...
Last edited by sivan; 07/02/13 07:03.
|
|
|
Re: Shade-C v0.91 BETA S1 RELEASED
[Re: sivan]
#425017
06/25/13 15:21
06/25/13 15:21
|
Joined: Apr 2006
Posts: 159 Latvija
Arrovs
Member
|
Member
Joined: Apr 2006
Posts: 159
Latvija
|
Which version you here using? Just curious because i dont want to run in them.
Arrovs once will publish game
|
|
|
Re: Shade-C v0.91 BETA S1 RELEASED
[Re: sivan]
#425312
07/02/13 09:44
07/02/13 09:44
|
Joined: Mar 2011
Posts: 3,150 Budapest
sivan
Expert
|
Expert
Joined: Mar 2011
Posts: 3,150
Budapest
|
EDIT: sorry, solved again, in the water shader finalcolor required a .xyz at a certain place, but finally I rewrote a bit the end part to get better water than the original --------------------------- again a little problem, I rewrote object shaders to SM 3.0, to get better dynamic lights, but this results in incompatibility with the depth shader probably, resulting in wrong water, which becomes white at shores and next to objects in water where it should be transparent with foam - but only if these objects use sm 3.0. I made a workaround, now water looks fine but a bit different, foam covers the full surface. I would be happy if somebody could give me a hint how to resolve it to get the original appearance. depth and water shaders work only if sm 2.0 used for them. in the worst case I'll use it in this form
Last edited by sivan; 07/02/13 13:54.
|
|
|
Re: Shade-C v0.91 BETA S1 RELEASED
[Re: sivan]
#425409
07/04/13 09:27
07/04/13 09:27
|
Joined: Mar 2011
Posts: 3,150 Budapest
sivan
Expert
|
Expert
Joined: Mar 2011
Posts: 3,150
Budapest
|
just some info about why variance shadow mapping is not totally fine in shade-c (not in scientific language): variance value = blurred(depthmap.x*depthmap.x) - blurred(depthmap.x)*blurred(depthmap.x) the 0.91b variance shadow mapping by default works with bad blurring, because it uses only one channel for depth (actually depthmap.x), then blurred by a pp shader, then read by object pixel shaders. it is squared in the object pixel shaders just before calling the variance shadow mapping function. by this approach you always get the same squared values, thus variance is always zero! thus can get only black or white pixels, i.e. the blurred areas are also result in totally shadowed pixels. I made a lerping afterwards with the original depthmap and finally got blurred shadows, but this is only a hack. the right solution is to get the depth on one channel e.g. depthmap.r, and store its squared value on another channel e.g. depthmap.g, and then do the blurring both on depthmap.r and depthmap.g. this way if you get the square of blurred depthmap.r, it won't be the same as the squared and then blurred value stored in depthmap.g, thus variance won't be always zero as before, thus you can get correct sahdowmapping. the main advantage of variance shadow mapping over PCF smoothing (like in the default PSSM shader), is its speed, because done directly once on depthmap, and not on screen pixels in the object pixel shaders. I will implement it soon
Last edited by sivan; 07/04/13 12:18.
|
|
|
Re: Shade-C v0.91 BETA S1 RELEASED
[Re: sivan]
#425415
07/04/13 11:59
07/04/13 11:59
|
Joined: Jun 2009
Posts: 2,210 Bavaria, Germany
Kartoffel
Expert
|
Expert
Joined: Jun 2009
Posts: 2,210
Bavaria, Germany
|
yeah, doing the pow(x, 2); in the shadow mapping function doesn't do anyting (it's the comparision between the linear filtering of the depth and the squared depth, that is used to calculate the linear interpolation for the shadows -> no hard edges and blurring is possible) ...since it looks like you know pretty much about vsm: does the depthmap has to be in range [0 - 1] or doesn't the range matter at all?
POTATO-MAN saves the day! - Random
|
|
|
Re: Shade-C v0.91 BETA S1 RELEASED
[Re: Kartoffel]
#425416
07/04/13 12:18
07/04/13 12:18
|
Joined: Mar 2011
Posts: 3,150 Budapest
sivan
Expert
|
Expert
Joined: Mar 2011
Posts: 3,150
Budapest
|
I'm just trying to undaerstand it by reading some articles and sample codes, and trying to get what they can get. e.g. there is a nice example using 6 lightmaps and combining their shadows.
edit1: but I'm a bit got stuck, as it does not work as I expected... and in the original depth shader it is commented out... need some further research, but I don't understand the distance calculations in shade-c...
Last edited by sivan; 07/04/13 18:31.
|
|
|
Re: Shade-C v0.91 BETA S1 RELEASED
[Re: sivan]
#425433
07/04/13 18:45
07/04/13 18:45
|
Joined: Mar 2011
Posts: 3,150 Budapest
sivan
Expert
|
Expert
Joined: Mar 2011
Posts: 3,150
Budapest
|
probably it has to be 0..1. now I have an idea what I could do wrong. but anyway, an example code from GPU Gems 3 works, as an interim solution, unfortunately shows some peter panning...
Edit: the depthmap max depth value was too high, if it is lowered everything works fine, but for really soft edged shadows, and for eliminating shadow fade-outs at terrain-object contact area, my original hack is still required...
Last edited by sivan; 07/05/13 08:51.
|
|
|
Re: Shade-C v0.91 BETA S1 RELEASED
[Re: sivan]
#427620
08/10/13 21:02
08/10/13 21:02
|
Joined: Nov 2007
Posts: 318 Brasil, Paraná
NeoNeper
Senior Member
|
Senior Member
Joined: Nov 2007
Posts: 318
Brasil, Paraná
|
how do I configure shadec for models that use sprites, example: tree, bushes...?
Please! Use easy words to be translated. because my English is not very good! Grateful. _______________________________________________________
|
|
|
|