![]() |
| [[ Home | Forums | 3D Engines Database | Wiki | Articles/Tutorials | Game Dev Jobs | IRC Chat Network | Contact Us ]] |
|
|
#101 |
|
Valued Member
Join Date: Mar 2008
Location: Finland
Posts: 263
|
For the weights, just use the Gaussian distribution function I posted link earlier in this thread. I use variance 0.75 myself, which seems to work ok. Also, normalize the weights so that they add up to 1.
|
|
|
|
|
|
#102 |
|
Valued Member
Join Date: Jul 2008
Location: Italy
Posts: 114
|
Ok i made also gaussian blur with this results:
I computed Gaussian distribution using the formula found on wikipedia. Code:
What do you mean "normalize" weights? With Sigma = 1 and 9 samples (from -4 to 4), and 128x128 texture ![]() ![]() ![]() What do you think about it? Should i blur more? Changing what? Samples number? Sigma? Last edited by XVincentX : 03-18-2009 at 09:03 AM. |
|
|
|
|
|
#103 |
|
Valued Member
Join Date: Jul 2008
Location: Italy
Posts: 114
|
I do not know why, but saving image using PIX (like last one) is different than saving images using STAMP:
![]() Looks like miss anisotropic filtering (that is enabled) Last edited by XVincentX : 03-18-2009 at 09:42 AM. |
|
|
|
|
|
#104 |
|
Senior Member
Join Date: Sep 2004
Posts: 572
|
For future reference if you hit "alt-printscreen" it will grab the current window's contents to the clipboard. Probably the best way to do screenshots and get it representitive of what you are seeing, IMO.
Your screenshots look, to me, like anisotropic filtering is turned OFF. Well your blur could definitely do with looking a tad better. For a 9x9 blur you should get MUCH better results than that ... |
|
|
|
|
|
#105 | ||
|
Valued Member
Join Date: Jul 2008
Location: Italy
Posts: 114
|
Quote:
But it's enabled, as you can see from screenshot grabbed from Pix...i will check better this, anyway. Quote:
I thought same thing but for now i do not have got ideas...mabye gaussian parameters? |
||
|
|
|
|
|
#106 | |
|
Valued Member
Join Date: Mar 2008
Location: Finland
Posts: 263
|
Quote:
|
|
|
|
|
|
|
#107 |
|
Senior Member
Join Date: Sep 2004
Posts: 572
|
could you post up the code for your 2 passes as well?
|
|
|
|
|
|
#108 |
|
Valued Member
Join Date: Jul 2008
Location: Italy
Posts: 114
|
Sure.
Gaussian coefficients are computed using this forumula Code:
Due to packing HLSL rules, coefficient are grouped in float4, in this way Code:
SAMPLE_COUNT = 8 (the nineth sample is taken directly in Pixel Shader). Data is filled in this way Code:
While texture displacement: Code:
And make Pixel Shader. So reuse the same target and make same pixel shader with these Code:
Finally, the pixel shader: Code:
|
|
|
|
|
|
#109 |
|
Valued Member
Join Date: Jul 2008
Location: Italy
Posts: 114
|
So?
|
|
|
|
|
|
#110 |
|
Senior Member
Join Date: Sep 2004
Posts: 572
|
Try:
Code:
exp( 1.0 ) IS 1.0 What you are saying is raise 1 to the power you should be rasing e too ... Last edited by Goz : 03-22-2009 at 03:55 PM. |
|
|
|
|
|
#111 | |
|
DevMaster Staff
Join Date: Oct 2004
Location: Seattle, WA
Posts: 3,790
|
Quote:
Actually exp(0) = 1.0, and exp(1.0) = e. ![]()
___________________________________________
Currently working at Sucker Punch reedbeta.com - OpenGL demos and other projects Luabridge - a lightweight, dependency-free C++/Lua binding library. CD Lite - an unobtrusive, minimal CD player application for Windows. |
|
|
|
|
|
|
#112 | |
|
Senior Member
Join Date: Sep 2004
Posts: 572
|
Quote:
goddammit reedbeta would you stop correcting my completely retarded ramblings hehehe |
|
|
|
|
|
|
#113 |
|
Senior Member
Join Date: Sep 2004
Posts: 572
|
Still not convinced by thaty GaussianWidth function though.
You know btw that value for "-x" is the same as for "x"? ie you don't need to run it for every value. Can you post up the values returned by GaussianWidth? |
|
|
|
|
|
#114 | |
|
Valued Member
Join Date: Jul 2008
Location: Italy
Posts: 114
|
Quote:
I just used it to avoid writing costans by my own. Gaussian values coming soon. |
|
|
|
|
|
|
#115 |
|
Valued Member
Join Date: Jul 2008
Location: Italy
Posts: 114
|
Values for you
Code:
Your function version return quite same values, except for last 2 numbers. Last edited by XVincentX : 03-23-2009 at 02:06 PM. |
|
|
|
|
|
#116 | |
|
Senior Member
Join Date: Sep 2004
Posts: 572
|
Quote:
It should return identical values ... I can't see anything wrong in your code .. the only thing that strikes me as being a potential problem (and I'm grasping at straws here) is your value for "SMX" ... |
|
|
|
|
|
|
#117 |
|
Valued Member
Join Date: Mar 2008
Location: Finland
Posts: 263
|
The variance value you are using is way too small. The Gaussian weight values are way too small for more distant samples thus they barely contribute to the value. Use the value 0.75 that I originally said for x=[-1, 1].
|
|
|
|
|
|
#118 |
|
Valued Member
Join Date: Jul 2008
Location: Italy
Posts: 114
|
I just tried, but i did not find any noticeable improvement.
![]() ![]() I was also forced to mul by 2 all spotlight becouse it was too dark |
|
|
|
|
|
#119 |
|
Valued Member
Join Date: Mar 2008
Location: Finland
Posts: 263
|
So what are the new values?
|
|
|
|
|
|
#120 |
|
Valued Member
Join Date: Jul 2008
Location: Italy
Posts: 114
|
Sorry i forgot to paste them
4.6268983e-008 5.8531972e-005 0.0096201422 0.20542553 |
|
|
|
|
|
#121 |
|
Valued Member
Join Date: Mar 2008
Location: Finland
Posts: 263
|
How about trying to do what I have been saying for quite some time here?
Spoon feeding follows:Code:
|
|
|
|
|
|
#122 |
|
Valued Member
Join Date: Jul 2008
Location: Italy
Posts: 114
|
I'm sorry you should understand me.
When you work so much and too many time on the same project, sometimes happens to me to have fog and clouds on my head and forget all suggestion. I will try also this other. Thank you still for the help. |
|
|
|
|
|
#123 |
|
Valued Member
Join Date: Jul 2008
Location: Italy
Posts: 114
|
With normalization the darkening is vanished, and i can see a better blur (even if little).
Anisotropic filtering, 128x128 variance shadow map (Gauss 0.75). The ligher is due to 2*light i used before ![]() No anisotropic, 128x128 variance shadow map (Gauss 0.75). ![]() Lit factor. Looks like perfect. ![]() Shadow Map. ![]() |
|
|
|
|
|
#124 |
|
Valued Member
Join Date: Jul 2008
Location: Italy
Posts: 114
|
Thank you all for your help.
|
|
|
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
|