• entries
    422
  • comments
    1540
  • views
    488817

Stop the press!!

Sign in to follow this  
jollyjeffers

82 views

STOP THE PRESS[attention][attention][attention]

I want my journal to be top of the list again I've thought of a much more space efficient version of what I posted earlier. Need to write it down.

I'd contemplated a few space-efficient ideas before, but I didn't like them as the space saving seemed to be countered by performance. I'm still not entirely convinced about this method.

To summarise, the current method renders (and *stores*) the results of each light source active in a given scene. It then composites them together to create the final image.

My new idea uses three buffers in a swap-chain style :-
  • No limit on the number of lights. Keep looping until all lights are done.
  • Constant storage for number of lights. Storage equivalent to 2 lights under the old system.

    So, the method:

    3 render Targets: Buffer0, Buffer1 and Buffer2

  • Start by clearing all three to BLACK at the start of the frame
  • On Frame #1 we render the scene with Light 1 enabled to Buffer0. We then ADD Buffer0 and Buffer1 storing the result in Buffer2
  • On Frame #2 we render the scene with Light 2 enabled to Buffer0. We then ADD Buffer0 and Buffer2 storing the result in Buffer1
  • On Frame #3 we render the scene with Light 3 enabled to Buffer0. We then ADD Buffer0 and Buffer1 storing the result in Buffer2
    ...
    ...
    ...

    So, more formally:


    Clear( Buffer0 )
    Clear( Buffer1 )
    Clear( Buffer2 )
    For( All Enabled Lights )
    {
    Disable( All Lights )
    Enabled( Current Light )
    SetTarget( Buffer0 )
    RenderScene()
    if( Frame is Odd Number )
    {
    SetTarget( Buffer1 )
    SetTexture( Buffer0 )
    SetTexture( Buffer2 )
    AddTextures()
    }
    else
    {
    SetTarget( Buffer2 )
    SetTexture( Buffer0 )
    SetTexture( Buffer1 )
    AddTextures()
    }

    }
  • Sign in to follow this  


    4 Comments


    Recommended Comments

    You're using that trick to avoid using blending on cards that do not support floating point blending, am i right ?

    Do you have any idea how you'll render some effects like particles ? Ping-ponging buffers is not going to be an option in that case.

    That's the main reason why i'm staying away from true HDRI at the moment.

    Share this comment


    Link to comment
    Quote:
    You're using that trick to avoid using blending on cards that do not support floating point blending, am i right ?

    This particular trick is to try and reduce the amount of VRAM required to render many light sources.

    But overall, the idea is to get around floating-point blending. Although, for the limited hardware that does support it, I want to be able to use it.

    Quote:
    Do you have any idea how you'll render some effects like particles ?

    Nope, to be honest I've avoided transparent/semi-transparent objects so far.

    The initial implementation of this is for my final year dissertation; thus I can get away with a few restrictions. If I take it any further than I'll probably have to look into those - as well as a more complex/general shadow mapping solution.

    Quote:
    That's the main reason why i'm staying away from true HDRI at the moment.

    I'm hoping to learn a lot about the practical aspects of HDRI (I've done all the theory!), and I'll certainly be writing about them here. The current implementation I've got should be able to make even the most powerful hardware complain - which will be good to know the real limits of what can/can't be done.

    Jack

    Share this comment


    Link to comment
    I understand that. That's what i hate with demos: you download them, are amazed, try to implement it yourself.. and find tons of problems to feed your nightmares for years, problems that demo coders rarely hit.

    Particles blending in a HDRI environment with floating point render targets is one of my main concerns. I'm wondering how games like Half Life 2 Lost Coast, or even Far Cry, do it, since there's an actual game that needs to render particles. Maybe you can only enable HDRI if you've got the hardware (Geforce 6800+ or Radeon X1800+), but it sounds unlikely that current ATI owners (Radeon 9800 or X800/850) wouldn't be able to run these games with HDRI. So there is certainly another explanation.. the most simple one would be that these games do not use floating point render buffers at all, and are heavily cheating.

    If anybody knows more about these issues, i'm interesting in learning more.

    Share this comment


    Link to comment
    It would be interesting to see how the Source engine handles such things...

    I just did a bit of digging around, but there aren't any specific (official) specs I can find for Lost Coast - "High End Graphics Card" is the best I can find. Although, ATI X800's have been mentioned as working according to some forums.

    Jack

    Share this comment


    Link to comment

    Create an account or sign in to comment

    You need to be a member in order to leave a comment

    Create an account

    Sign up for a new account in our community. It's easy!

    Register a new account

    Sign in

    Already have an account? Sign in here.

    Sign In Now