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.
> > >
> > >
> >
> >
>
>



Relevant Pages

  • Re: GPU formula processing with texture data
    ... If it need to run on older/Intel cards then you ... You mean data without gaps in between? ... If so it depends on the texture format... ... So if your algorithm requires many iterations than it's probably not ...
    (comp.graphics.api.opengl)
  • Re: Cannot Load a Texture
    ... Pool.Managed (Unless your texture is a Render Target) usually work. ... Usage.Dynamic has given me propblems on some cards. ... >> example where I could load a texture. ... >> this row returns an exception. ...
    (microsoft.public.win32.programmer.directx.managed)
  • Re: OpenGL and SwapBuffers behavior
    ... cards. ... Some literally swap the buffers, some just copy the back to the front. ... create a texture from this and render it to the screen. ...
    (comp.graphics.api.opengl)
  • D3DTTFF_COUNT3|D3DTTFF_PROJECTED problem
    ... texture matrix using the follwing Texture stage states: ... On newer video cards everthing is fine. ... support this ability and I have similar problems. ...
    (microsoft.public.win32.programmer.directx.graphics)
  • Yes, but...
    ... Wouldn't that imply regenerating new uv coordinates for my models? ... if it is common enough among cards to support at least 512x512, ... still like to have opinions about texture size supports. ... melding news:uvqkVbfIEHA.2948@TK2MSFTNGP11.phx.gbl... ...
    (microsoft.public.win32.programmer.directx.graphics)