Results 1 to 6 of 6

Thread: Global, Dynamic Lighting System

  1. #1

    Thread Starter
    PowerPoster Halsafar's Avatar
    Join Date
    Jun 2004
    Location
    Saskatoon, SK
    Posts
    2,339

    Global, Dynamic Lighting System

    Currently I have a class for each type of a light, a static class used for global communication with no externs and no instantiantions. I can manage a dynamic list of lights stored within d3d's SetLight parameters and enable them as needed by objects, the world, or just always...given the max

    From here since each light will have its own unique id in a master class I can relay that ID to building class' for example which need to light themselves.


    So a few questions:

    - Does D3D have a max when it comes to SetLight?
    I know it does with LightEnable, the max can be found in the caps.
    "From what was there, and was meant to be, but not of that was faded away." - - Steve Damm

    "The polar opposite of nothingness is existance. When existance calls apon nothingness it shall return to nothingness." - - Steve Damm

    "When you do things right, people won't be sure if you did anything at all." - - God from Futurama

  2. #2
    Elite Hacker Jacob Roman's Avatar
    Join Date
    Aug 2004
    Location
    Miami Beach, FL
    Posts
    5,349

    Re: Global, Dynamic Lighting System

    Hardware based lighting I know goes upto 8 lights on many cards. Software lighting is unlimited.

  3. #3
    Hyperactive Member
    Join Date
    Feb 2005
    Posts
    294

    Re: Global, Dynamic Lighting System

    How do games have dynamic lighting with >8 lights affecting a model in realtime?

  4. #4

    Thread Starter
    PowerPoster Halsafar's Avatar
    Join Date
    Jun 2004
    Location
    Saskatoon, SK
    Posts
    2,339

    Re: Global, Dynamic Lighting System

    8 lights Jacob????
    Well D3DCAPS9 shows MaxActiveLights on my system to be 0....
    Which makes no sense since I am using several programs as tutorials to aid my light quest, and they all work fine...with lots of lights.

    Now, I have found out one thing:
    IDirect3DDevice9->SetLight(...) can be used for ANY number of lights, since everytime you call SetLight the appropriate ammount of memory is allocated on the system. So you can SetLight until you run out of memory.

    IDirect3DDevice9->LightEnabled(...) can be only used for a certain number of lights, now this max is suppose to be in the CAPS but for me it shows a 0, which makes NO SENSE. Even in apps where multiple lights are at work the caps show MaxActiveLights = 0x00000000;
    "From what was there, and was meant to be, but not of that was faded away." - - Steve Damm

    "The polar opposite of nothingness is existance. When existance calls apon nothingness it shall return to nothingness." - - Steve Damm

    "When you do things right, people won't be sure if you did anything at all." - - God from Futurama

  5. #5

    Thread Starter
    PowerPoster Halsafar's Avatar
    Join Date
    Jun 2004
    Location
    Saskatoon, SK
    Posts
    2,339

    Re: Global, Dynamic Lighting System

    Any place where I have set ambient, diffuse, specular...etc.
    My material, my lights.
    It is always 1.0f all the way so I get white light.

    Yet anything my lights touch turn RED....
    "From what was there, and was meant to be, but not of that was faded away." - - Steve Damm

    "The polar opposite of nothingness is existance. When existance calls apon nothingness it shall return to nothingness." - - Steve Damm

    "When you do things right, people won't be sure if you did anything at all." - - God from Futurama

  6. #6
    Good Ol' Platypus Sastraxi's Avatar
    Join Date
    Jan 2000
    Location
    Ontario, Canada
    Posts
    5,134

    Re: Global, Dynamic Lighting System

    Games usually have premultiplied lights, such as Half-Life and that. Their dynamic lighting really consists of premultiplied lightmaps being superimposed at certain degrees of translucency. Where you'll see the "dynamic lighting" is on the gun you're holding in your hands, which may have a green glow under it with a yellow one above.

    And remember the (stupid) principles of lights on computers: anything that is 0 will be black no matter what. It's really a LDR problem, though, which is a whole 'nother ballgame.
    All contents of the above post that aren't somebody elses are mine, not the property of some media corporation.
    (Just a heads-up)

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