Re: Adding quite a lot of lights in a Managed direct x application

From: Philip Taylor[ATI] (ptaylor_at_online.atitech.com)
Date: 05/05/04


Date: Tue, 4 May 2004 21:38:33 -0700

I had a sample on the MSDN DX site that showed how to do "virtual lights" by
rendering only the 8 closest to the object.

"Arnau" <afont@nospamplease.ipssoft.es> wrote in message
news:uFDyNKgMEHA.2244@tk2msftngp13.phx.gbl...
> Thanks for the replies!
>
> I'll take a look at the 3rd and 4th options, as they look the best for me.
>
> Arnau.
>
> "ZMan" <news-replies@thezbuffer> ha escrit en el missatge dels grups de
> discussió:%23ai%23HVUMEHA.2736@TK2MSFTNGP11.phx.gbl...
> > Your card is not unusual - all cards have limitations like this an 8 is
> > common. There are no cards which will support enough lights to do what
you
> > want becuase the sheer amount of calculations would take too long and
the
> > framerate would suffer.
> >
> > Several options for you:
> > 1. Determine which lights affect the current view and use the closest 8.
> Not
> > a good option if you can see more than 3-4 at a time becuase lights will
> > turn on and off as you walk about and will be an odd artifact.
> > 2. If you write your own vertex or pixel shaders you can do all the
light
> > calculations yourself but you will probably hit a limit of instructions
> > before you get more than 8 lights.
> > 3. Use light maps. What you do here is pregenerate or edit a texture
that
> > looks like the pattern your street light would cast on the static
objects
> > around it. Then you add this texture in over the top of your existing
> > textures. The problem with this approach is that other dynamic objects
> that
> > pass into the light will not change unless you dynamically generate
> textures
> > for them or use a projected texture approach. One nice thing here is
that
> > you can pregenerate shadows into the texture also and save yourself
> > complicated shadow algorithms - once again though doesn't work well with
> > dynamic objects.
> > 4. If your lights have limited range you could split your scene up into
> > small blocks, each with 8 lights and render each block individually.
> You'll
> > need to be real careful about pushing geometries and textures to the
card
> to
> > keep this optimal though.
> >
> > ZMan
> >
> > "Arnau Font" <afont@nospam-ipssoft.com> wrote in message
> > news:uu7jRjSMEHA.3696@TK2MSFTNGP09.phx.gbl...
> > > Hi,
> > >
> > > I'm writing a game that is located in a city. The view is sim city
2000
> > > alike, but in 3D and much nearer to the ground. I was planning to add
to
> > > the
> > > scene some street lights, but my graphics card has a limitation of 8
> > > lights
> > > at the same time, and, probably, in a city there will be some more
than
> > > that!
> > > How can I light the rest of streetlights? With vertexs shaders? Has
> > > anybody
> > > got any example?
> > >
> > > Thanks!
> > >
> > > Arnau.
> > >
> > >
> >
> >
>
>