Advanced Effects

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Post Reply
thanhle
Posts: 325
Joined: Wed Jun 12, 2013 8:09 am

Re: Advanced Effects

Post by thanhle »

Why is it so blurry. I think blurry is good, but it is hard on the eye.

Also, is your SSAO shader computed based on the light position?
Vectrotek
Competition winner
Posts: 1087
Joined: Sat May 02, 2015 5:05 pm

Re: Advanced Effects

Post by Vectrotek »

In "release\Shaders\_GLSL_\002_POST_PROC_NL_FX\GL_0390_FRAG_PP_8_or_24_BIT_DEPTH_BASED_V_BLUR_BETTER.glsl"
at line 19, change the GENERAL BLUR STRENGTH by
changeing..

Code: Select all

 
float blurSize = DepthColour.x * (1.0 / BufferHeight) * GeneralStrength;
 
to..

Code: Select all

 
float blurSize = DepthColour.x * (1.0 / BufferHeight) * GeneralStrength * 0.25;
 
And in "release\Shaders\_GLSL_\002_POST_PROC_NL_FX\GL_0400_FRAG_PP_8_or_24_BIT_DEPTH_BASED_H_BLUR_BETTER.glsl"
at line 21, change the GENERAL BLUR STRENGTH by
changeing..

Code: Select all

float blurSize = DepthColour.x * (1.0 /  BufferWidth) * GeneralStrength; 
to..

Code: Select all

float blurSize = DepthColour.x * (1.0 /  BufferWidth) * GeneralStrength * 0.25;
Also disable FXAA if needed..
Last edited by Vectrotek on Sat Jan 14, 2017 12:28 pm, edited 3 times in total.
Vectrotek
Competition winner
Posts: 1087
Joined: Sat May 02, 2015 5:05 pm

Re: Advanced Effects

Post by Vectrotek »

SSAO is fed only DEPTH and some user tweakables ..
see "GL_0420_FRAG_PP_SSAO_INTERNAL_DEPTH.glsl"..
Fancier SSAO is possible using the World Normals in addition to Depth..
Vectrotek
Competition winner
Posts: 1087
Joined: Sat May 02, 2015 5:05 pm

Re: Advanced Effects

Post by Vectrotek »

The program starts of showing only SSAO multiplied with Diffuse subjected to FXAA..
Press "M" to flip between the SSAO Shader render-modes like "Show Packed RGB Depth" or "Show Diff (SSAO)" or "Diff Only"..
(just keep pressing M and you'll get it)

Also..
"V" show simple GUI that shows tweaked values for Depth Based SSAO. (hit this first)
press "P" & "L" inc/dec "Far Dist" (acts on the GEO DEPTH SHADER, not the SSAO shader)..
Shift & "P" or "L" inc/dec "Near Dist" (acts on the GEO DEPTH SHADER, not the SSAO shader)..
"O" & "K" Tweak "Gause Bell"
"I" & "J" Tweak "Diff Area"
"U" & "H" Tweak "SSAO Radius"
"Y" & "G" Tweak "Far" Parameter (acts on the SSAO SHADER, not the GEO shader)..
"T" & "F" Tweak "Near" Parameter (acts on the SSAO SHADER, not the GEO shader)..
"F1" toggles between the "Old Linear Effect system" (new pp shaders like simple caleidoscope etc)
and the new "Non Linear Effect System".
"0" toggles between "No PP" and which-ever FX system is current (selected with "F1")..

see "H_008_user_input.h" for all controls..
Vectrotek
Competition winner
Posts: 1087
Joined: Sat May 02, 2015 5:05 pm

Re: Advanced Effects

Post by Vectrotek »

Why, oh why, can I not get Fragpos from a buffer when I got:

1. Camera_Pos
2. Camera_Target
3. Camera_FOV
4. Cell Position on UV GRID
5. 8 or 24 But DEPTH at a given Cell.
6. SIN COS ASIN ACOS etc
7. Camera Theta XZ
8. Camera Theta ZY
9. Momentary Radius at Cell Position (Depth)

Image
Vectrotek
Competition winner
Posts: 1087
Joined: Sat May 02, 2015 5:05 pm

Re: Advanced Effects

Post by Vectrotek »

Working on it..
Mel
Competition winner
Posts: 2292
Joined: Wed May 07, 2008 11:40 am
Location: Granada, Spain

Re: Advanced Effects

Post by Mel »

What are you trying? If you have Sin/Cos operations, just use them, i don't know how bad would it go, but worse is an arrow in the knee XD

Most of the times, geometry in NDC space has nicer properties than geometry in world space, such as screen and frustum alignment, and -1,1 range
"There is nothing truly useless, it always serves as a bad example". Arthur A. Schmitt
Vectrotek
Competition winner
Posts: 1087
Joined: Sat May 02, 2015 5:05 pm

Re: Advanced Effects

Post by Vectrotek »

@ Mel: I'm not sure how good the idea is, but it would be good exercise to get it working.
I'm playing around with SSR etc, but without "World Space Fragpos", no joy..
(tell me if it makes any sense)

Image

Or point me to a better way..
Vectrotek
Competition winner
Posts: 1087
Joined: Sat May 02, 2015 5:05 pm

Re: Advanced Effects

Post by Vectrotek »

No Theta Label in the TOP and RIGHT views, but you get the picture..
Vectrotek
Competition winner
Posts: 1087
Joined: Sat May 02, 2015 5:05 pm

Re: Advanced Effects

Post by Vectrotek »

If you can see WebGL in Chrome go here http://marcinignac.com/experiments/ssr/
and LAUNCH PROJECT..
Mel
Competition winner
Posts: 2292
Joined: Wed May 07, 2008 11:40 am
Location: Granada, Spain

Re: Advanced Effects

Post by Mel »

I have no idea about SSR (yet...) but as a rule of thumb, stick to a single space, i.e. view space, or world space, but mix them the least possible.
"There is nothing truly useless, it always serves as a bad example". Arthur A. Schmitt
Vectrotek
Competition winner
Posts: 1087
Joined: Sat May 02, 2015 5:05 pm

Re: Advanced Effects

Post by Vectrotek »

Advice accepted.. :wink:
Vectrotek
Competition winner
Posts: 1087
Joined: Sat May 02, 2015 5:05 pm

Re: Advanced Effects

Post by Vectrotek »

Lots of noise and ranting but no "Click" yet..

Here is a possible clue to a possible solution to possibly finding Fragpos
when we have only Prerendered Depth and Camera Attributes..
Making something from nothing using SIN and COS..

Image
Last edited by Vectrotek on Sun Jan 22, 2017 3:13 pm, edited 1 time in total.
Vectrotek
Competition winner
Posts: 1087
Joined: Sat May 02, 2015 5:05 pm

Re: Advanced Effects

Post by Vectrotek »

Well need Thetas for all those Sample Rays too!!
Vectrotek
Competition winner
Posts: 1087
Joined: Sat May 02, 2015 5:05 pm

Re: Advanced Effects

Post by Vectrotek »

Another Clue..
Perhaps one can use the UV to "offset" the theta using Camera FOV..
The degree "nothces/marks" should be linear by nature because the
Camera Position is the center of the circle on which these imaginary marks would appear??

So we need a kind of formula for "UV Driven Theta Offset"

Image
Post Reply