Advanced Effects
Re: Advanced Effects
But.. You've just given me an idea..
Because I render all Specular Highlights into its own buffer before
"Adding" them to all the other passes, why cant I just "H and V Blur"
that buffer before adding it? Huh?
And another cool thing is that the Specular buffer could even be smaller
than all the others, giving us a speed advantage..
Now were cookin!
Because I render all Specular Highlights into its own buffer before
"Adding" them to all the other passes, why cant I just "H and V Blur"
that buffer before adding it? Huh?
And another cool thing is that the Specular buffer could even be smaller
than all the others, giving us a speed advantage..
Now were cookin!
Re: Advanced Effects
Btw.. What does this mean..
I know how to get past it, but it is a bit annoying..
Code: Select all
SQL ERROR [ mysqli ]
User i74339rw already has more than 'max_user_connections' active connections [1203]
An sql error occurred while fetching this page. Please contact an administrator if this problem persists.
Re: Advanced Effects
It looks great.
To be realistic, the light need to wrap around the surface, since the surface can be visible by the light direction.
Some of your lights stop at the edge of the surface.
You're almost there.
To be realistic, the light need to wrap around the surface, since the surface can be visible by the light direction.
Some of your lights stop at the edge of the surface.
You're almost there.
Re: Advanced Effects
The issue doesn't seems to appear on the last picture.
However, if you look at the eye on the second last picture, is that the shape of the light? What type of lights are these? Spot or custom shape light?
What is the frame rate at 1000 or 2000 lights?
Looks good,
Best regards
However, if you look at the eye on the second last picture, is that the shape of the light? What type of lights are these? Spot or custom shape light?
What is the frame rate at 1000 or 2000 lights?
Looks good,
Best regards
Re: Advanced Effects
Thanks! The framerate would probably also depend on how many polygons there are.
If you meant the light acting on the Empty Background, then that's simple to fix by something like..
Also I Multiply the final output with SSAO just for a bit of realism..
Anyhow, I'm trying to get the Near Plane worked into it too (For an even more accurate Fragpos)..
As for the speed of the whole process, well my coding ain't that great
but I'm sure that the "concept" with good coding and GPU assembly can
produce some cool framerates.. (they're better for me already)
Here's a shot of the light not acting on the backdrop..
If you meant the light acting on the Empty Background, then that's simple to fix by something like..
Code: Select all
if (DepthLinearised < 0.9 )
{gl_FragColor = vec4(Specular * 1.0, 1.0);
// Or Diffuse..
// I now have them in separate passes because
// Diffuse must be MULTIPLIED and
// Specular must be ADDED..
}
Anyhow, I'm trying to get the Near Plane worked into it too (For an even more accurate Fragpos)..
As for the speed of the whole process, well my coding ain't that great
but I'm sure that the "concept" with good coding and GPU assembly can
produce some cool framerates.. (they're better for me already)
Here's a shot of the light not acting on the backdrop..
Re: Advanced Effects
O.K. So I figured that even if the Near Plane is usually quite close to the camera, it should be fine because of the minimal
influence this would have on the final output..
Yes that was quite correct, but..
If you had to consider this near Plane then surely you'd get much closer to Perfect,
(which due to the nature of deferred rendering would still not be absolutely perfect)..
The coder would have a choice between "Reasonably Accurate" and "Extremely Accurate"..
The Near Plane as well:
influence this would have on the final output..
Yes that was quite correct, but..
If you had to consider this near Plane then surely you'd get much closer to Perfect,
(which due to the nature of deferred rendering would still not be absolutely perfect)..
The coder would have a choice between "Reasonably Accurate" and "Extremely Accurate"..
The Near Plane as well:
Re: Advanced Effects
Now the code for "Reasonably Accurate" would be:
Code: Select all
FragmentPosXYZ.x = CameraPosition.x + ((FarLeftDwnXYZ.x
+ ((FarLeftUpXYZ.x - FarLeftDwnXYZ.x) * UVCoordsXY.y)
+ (FarRightDwnXYZ.x - FarLeftDwnXYZ.x) * UVCoordsXY.x)
* DepthLinearised);
FragmentPosXYZ.y = CameraPosition.y + ((FarLeftDwnXYZ.y
+ ((FarLeftUpXYZ.y - FarLeftDwnXYZ.y) * UVCoordsXY.y)
+ (FarRightDwnXYZ.y - FarLeftDwnXYZ.y) * UVCoordsXY.x)
* DepthLinearised);
FragmentPosXYZ.z = CameraPosition.z + ((FarLeftDwnXYZ.z
+ ((FarLeftUpXYZ.z - FarLeftDwnXYZ.z) * UVCoordsXY.y)
+ (FarRightDwnXYZ.z - FarLeftDwnXYZ.z) * UVCoordsXY.x)
* DepthLinearised);
Re: Advanced Effects
The code for "EXTREMELY ACCURATE" would be.. (drum-roll)..
(that was an edit..)
Code: Select all
FragmentPosXYZ.x = (CameraPosition.x + ((((FarLeftDwnXYZ.x + ((FarLeftUpXYZ.x - FarLeftDwnXYZ.x) * UVCoordsXY.y)
+ (FarRightDwnXYZ.x - FarLeftDwnXYZ.x) * UVCoordsXY.x))
- // Minus the Near Plane Corners..
((NearLeftDwnXYZ.x + ((NearLeftUpXYZ.x - NearLeftDwnXYZ.x) * UVCoordsXY.y)
+ (NearRightDwnXYZ.x - NearLeftDwnXYZ.x) * UVCoordsXY.x))) * DepthLinearised))
// Plus (Near Minus Camera)..
+ ((((NearLeftDwnXYZ.x + ((NearLeftUpXYZ.x - NearLeftDwnXYZ.x) * UVCoordsXY.y)
+ (NearRightDwnXYZ.x - NearLeftDwnXYZ.x) * UVCoordsXY.x))) - CameraPosition.x );
FragmentPosXYZ.y = (CameraPosition.y + (((FarLeftDwnXYZ.y + ((FarLeftUpXYZ.y - FarLeftDwnXYZ.y) * UVCoordsXY.y)
+ (FarRightDwnXYZ.y - FarLeftDwnXYZ.y) * UVCoordsXY.x)
- // Minus the Near Plane Corners..
((NearLeftDwnXYZ.y + ((NearLeftUpXYZ.y - NearLeftDwnXYZ.y) * UVCoordsXY.y)
+ (NearRightDwnXYZ.y - NearLeftDwnXYZ.y) * UVCoordsXY.x))) * DepthLinearised))
// Plus (Near Minus Camera)..
+ ((((NearLeftDwnXYZ.y + ((NearLeftUpXYZ.y - NearLeftDwnXYZ.y) * UVCoordsXY.y)
+ (NearRightDwnXYZ.y - NearLeftDwnXYZ.y) * UVCoordsXY.x))) - CameraPosition.y);
FragmentPosXYZ.z = (CameraPosition.z + (((FarLeftDwnXYZ.z + ((FarLeftUpXYZ.z - FarLeftDwnXYZ.z) * UVCoordsXY.y)
+ (FarRightDwnXYZ.z - FarLeftDwnXYZ.z) * UVCoordsXY.x)
- // Minus the Near Plane Corners..
((NearLeftDwnXYZ.z + ((NearLeftUpXYZ.z - NearLeftDwnXYZ.z) * UVCoordsXY.y)
+ (NearRightDwnXYZ.z - NearLeftDwnXYZ.z) * UVCoordsXY.x))) * DepthLinearised))
// Plus (Near Minus Camera)..
+ ((((NearLeftDwnXYZ.z + ((NearLeftUpXYZ.z - NearLeftDwnXYZ.z) * UVCoordsXY.y)
+ (NearRightDwnXYZ.z - NearLeftDwnXYZ.z) * UVCoordsXY.x))) - CameraPosition.z );
Last edited by Vectrotek on Sun Feb 05, 2017 10:00 pm, edited 2 times in total.
Re: Advanced Effects
Now one way to see if it is really more accurate is to render the "Final Linearized Depth" in a little window
(see the Bottom Right Window) and then to set the "Near and Far" to tightly enclose the test subject, then
see if the Specular highlights still "look" right and..
(26808 Polygons at 30 fps)
This works!
I'll take credit for this little formula (bar some unnecessary parenthesis and some help) thank you very much!
Thanks goes out to Devsh and Mel!
(net so n' klein bietjie windgat)
(see the Bottom Right Window) and then to set the "Near and Far" to tightly enclose the test subject, then
see if the Specular highlights still "look" right and..
(26808 Polygons at 30 fps)
This works!
I'll take credit for this little formula (bar some unnecessary parenthesis and some help) thank you very much!
Thanks goes out to Devsh and Mel!
(net so n' klein bietjie windgat)
Last edited by Vectrotek on Sun Feb 05, 2017 6:03 pm, edited 3 times in total.
Re: Advanced Effects
Next would be Normal Maps, Tangents, Binormals, Specular and "PLAECF" Gloss Maps..
And maybe once I figure out how to access GPU Shader Parameters by INDEX rather than NAME,
even GPU Assembly. But before that I'd like to try Screen Space Reflection now that we have
all the parameters required for it ..
Cheers and thanks!
And maybe once I figure out how to access GPU Shader Parameters by INDEX rather than NAME,
even GPU Assembly. But before that I'd like to try Screen Space Reflection now that we have
all the parameters required for it ..
Cheers and thanks!
Re: Advanced Effects
Oh.. In your loop this would obviously have to happen cyclically (if you've got my last project)..
Code: Select all
MyCoolEffect.AccessThePPShaderCollection() ->AccessShader (S27_ACCURATE_DEFERRED_A_DIFFUSE) ->SetFragment3FloatsByName ("CameraPosition", CameraPosition);
MyCoolEffect.AccessThePPShaderCollection() ->AccessShader (S27_ACCURATE_DEFERRED_A_DIFFUSE) ->SetFragment3FloatsByName ("FarLeftUpXYZ", FarLeftUpXYZ);
// MyCoolEffect.AccessThePPShaderCollection() ->AccessShader (S27_ACCURATE_DEFERRED_A_DIFFUSE) ->SetFragment3FloatsByName ("FarRightUpXYZ", FarRightUpXYZ); // NOT USED!!
MyCoolEffect.AccessThePPShaderCollection() ->AccessShader (S27_ACCURATE_DEFERRED_A_DIFFUSE) ->SetFragment3FloatsByName ("FarRightDwnXYZ", FarRightDwnXYZ);
MyCoolEffect.AccessThePPShaderCollection() ->AccessShader (S27_ACCURATE_DEFERRED_A_DIFFUSE) ->SetFragment3FloatsByName ("FarLeftDwnXYZ", FarLeftDwnXYZ);
MyCoolEffect.AccessThePPShaderCollection() ->AccessShader (S27_ACCURATE_DEFERRED_A_DIFFUSE) ->SetFragment3FloatsByName ("NearLeftUpXYZ", NearLeftUpXYZ);
// MyCoolEffect.AccessThePPShaderCollection() ->AccessShader (S27_ACCURATE_DEFERRED_A_DIFFUSE) ->SetFragment3FloatsByName ("NearRightUpXYZ", NearRightUpXYZ); // NOT USED..
MyCoolEffect.AccessThePPShaderCollection() ->AccessShader (S27_ACCURATE_DEFERRED_A_DIFFUSE) ->SetFragment3FloatsByName ("NearRightDwnXYZ", NearRightDwnXYZ);
MyCoolEffect.AccessThePPShaderCollection() ->AccessShader (S27_ACCURATE_DEFERRED_A_DIFFUSE) ->SetFragment3FloatsByName ("NearLeftDwnXYZ", NearLeftDwnXYZ);
MyCoolEffect.AccessThePPShaderCollection() ->AccessShader (S28_ACCURATE_DEFERRED_B_SPECULAR) ->SetFragment3FloatsByName ("CameraPosition", CameraPosition);
MyCoolEffect.AccessThePPShaderCollection() ->AccessShader (S28_ACCURATE_DEFERRED_B_SPECULAR) ->SetFragment3FloatsByName ("FarLeftUpXYZ", FarLeftUpXYZ);
// MyCoolEffect.AccessThePPShaderCollection() ->AccessShader (S28_ACCURATE_DEFERRED_B_SPECULAR) ->SetFragment3FloatsByName ("FarRightUpXYZ", FarRightUpXYZ); // NOT USED
MyCoolEffect.AccessThePPShaderCollection() ->AccessShader (S28_ACCURATE_DEFERRED_B_SPECULAR) ->SetFragment3FloatsByName ("FarRightDwnXYZ", FarRightDwnXYZ);
MyCoolEffect.AccessThePPShaderCollection() ->AccessShader (S28_ACCURATE_DEFERRED_B_SPECULAR) ->SetFragment3FloatsByName ("FarLeftDwnXYZ", FarLeftDwnXYZ);
MyCoolEffect.AccessThePPShaderCollection() ->AccessShader (S28_ACCURATE_DEFERRED_B_SPECULAR) ->SetFragment3FloatsByName ("NearLeftUpXYZ", NearLeftUpXYZ);
// MyCoolEffect.AccessThePPShaderCollection() ->AccessShader (S28_ACCURATE_DEFERRED_B_SPECULAR) ->SetFragment3FloatsByName ("NearRightUpXYZ", NearRightUpXYZ); // NOT USED!!
MyCoolEffect.AccessThePPShaderCollection() ->AccessShader (S28_ACCURATE_DEFERRED_B_SPECULAR) ->SetFragment3FloatsByName ("NearRightDwnXYZ", NearRightDwnXYZ);
MyCoolEffect.AccessThePPShaderCollection() ->AccessShader (S28_ACCURATE_DEFERRED_B_SPECULAR) ->SetFragment3FloatsByName ("NearLeftDwnXYZ", NearLeftDwnXYZ);
Last edited by Vectrotek on Tue Feb 07, 2017 8:24 pm, edited 1 time in total.