Results 1 to 2 of 2

Thread: [RESOLVED] HLSL - Get Destination Pixel?

  1. #1

    Thread Starter
    Hyperactive Member singularis's Avatar
    Join Date
    Nov 2006
    Location
    Over There!
    Posts
    372

    Resolved [RESOLVED] HLSL - Get Destination Pixel?

    Hi,

    Its been a while since I posted but here goes. I want to get the colour of a pixel 'below' (to be rendered over) so that I can decide if I want to render a new pixel on top of it.

    I am trying to use multiple lights in my scene and I want to check if a pixel is lighter than the new pixel. So that the only places that are dark are those without any lights shining on them.

    Ultimately I am trying to achieve a 2D lighting engine that supports more than one light. Can I achieve this any easier?

    Any help is appreciated!
    If what I said was helpful, give me rep!

    My Complete Games: -- 2D Zone (Space Shooter game) || _2D Zone 2_ || Ninja Blob (2D platformer) || Dren (Co-op up to 4 player base defence game)

    My Projects: -- The Dread Engine (2D VB game Engine) || A* Path Finding


    An excellent site for learning DirectX7, 8 & 9 (for VB6, C# & VB.net) would be: directx4vb.vbgamer.com --- For my projects and games see: pieper.freehostia.com

  2. #2

    Thread Starter
    Hyperactive Member singularis's Avatar
    Join Date
    Nov 2006
    Location
    Over There!
    Posts
    372

    Re: [RESOLVED] HLSL - Get Destination Pixel?

    I first created a new technique that shaded each object black. Then, for every light I shaded each object normally EXCEPT I set the alpha value of each pixel to be as dark as the pixel. Therefore it would 'show through' and I would get additive lighting.
    If what I said was helpful, give me rep!

    My Complete Games: -- 2D Zone (Space Shooter game) || _2D Zone 2_ || Ninja Blob (2D platformer) || Dren (Co-op up to 4 player base defence game)

    My Projects: -- The Dread Engine (2D VB game Engine) || A* Path Finding


    An excellent site for learning DirectX7, 8 & 9 (for VB6, C# & VB.net) would be: directx4vb.vbgamer.com --- For my projects and games see: pieper.freehostia.com

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width