8
$\begingroup$

We are trying to optimize Lighting in fillrate. Integrated graphics chips are very slow in memory access.

There are two Light Buffers: one for Diffuse and one for Specular. Both use format R11G11B10F. Is there any way to pack two buffers into one? For instance, using color model Y'CbCr:enter image description here

$\endgroup$
1
  • $\begingroup$ This is for deferred lighting pipeline, right? Are you using tiled implementation to reduce bandwidth? Also, have you considered tiled deferred shading or tiled forward shading instead? $\endgroup$
    – JarkkoL
    Commented Sep 26, 2016 at 14:50

2 Answers 2

5
$\begingroup$

You might want to look at The Compact YCoCg Framebuffer. It uses a 2-channel buffer to store luminance for every pixel and the two chroma components in half the pixels each, forming a checkerboard. It also uses an edge-aware upsampling filter at the end of the frame to reconstruct the missing chroma components and convert back to RGB.

You could extend this to a single 3-channel buffer to store the diffuse luminance, specular luminance, and checkerboarded chroma (assuming based on the diagram in your question that it suffices to store just one pair of chroma values).

You might also consider using R10G10B10A2 format instead, unless you really need the range of the floating-point format. It's the same amount of bandwidth but will give you a good deal more precision (R11G11B10F only gives you 5–6 bits of mantissa per component). Plus, you can use the 2 bits of alpha to store a couple of flags, such as your diffuse/specular flag.

$\endgroup$
2
$\begingroup$

If you are ok with specular being only white, you could put diffuse and specular into RGBA.

It looks like that is what unity does for it's deferred rendering.

Someone discovering this issue: http://forum.unity3d.com/threads/specular-color-based-on-light-color.134412/

The docs mentioning it: https://docs.unity3d.com/Manual/RenderTech-DeferredLighting.html

$\endgroup$
1
  • $\begingroup$ thanks, still both Diffuse and Specular should be colored $\endgroup$ Commented Sep 20, 2016 at 17:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.