Graphics/DeferredRenderTechnique: Optimize Deferred Shading

No longer copies depth twice


Former-commit-id: aa2096ade409861b773bc7302ced27ae84fab858 [formerly 80fd00bd4a75506b128b70a545eb43ff6a3a7071] [formerly d8576a8858caca9314ea67661af0ce7d9077ba9d [formerly e626f2fd62d19ca5f952485478bfe46f4a803227]]
Former-commit-id: 363c93e397887e66b25446927bc5ef89e761c488 [formerly a8bee284456d7f46d182ae7df2d565fa29e55b61]
Former-commit-id: 168792d853247ada5add8f97057c213af7c801b3
This commit is contained in:
Lynix
2016-08-15 01:27:33 +02:00
parent c196037cb7
commit f3c57a5417
12 changed files with 24 additions and 38 deletions

View File

@@ -68,21 +68,6 @@ uniform vec4 SceneAmbient;
uniform sampler2D TextureOverlay;
/********************Fonctions********************/
vec3 FloatToColor(float f)
{
vec3 color;
f *= 256.0;
color.x = floor(f);
f = (f - color.x) * 256.0;
color.y = floor(f);
color.z = f - color.y;
color.xy *= 0.00390625; // *= 1.0/256
return color;
}
#define kPI 3.1415926536
@@ -184,7 +169,7 @@ void main()
*/
RenderTarget0 = vec4(diffuseColor.rgb, dot(specularColor, vec3(0.3, 0.59, 0.11)));
RenderTarget1 = vec4(EncodeNormal(normal));
RenderTarget2 = vec4(FloatToColor(gl_FragCoord.z), (MaterialShininess == 0.0) ? 0.0 : max(log2(MaterialShininess), 0.1)/10.5); // http://www.guerrilla-games.com/publications/dr_kz2_rsx_dev07.pdf
RenderTarget2 = vec4(0.0, 0.0, 0.0, (MaterialShininess == 0.0) ? 0.0 : max(log2(MaterialShininess), 0.1)/10.5); // http://www.guerrilla-games.com/publications/dr_kz2_rsx_dev07.pdf
#else // FLAG_DEFERRED
#if ALPHA_MAPPING
diffuseColor.a *= texture(MaterialAlphaMap, texCoord).r;

File diff suppressed because one or more lines are too long