Page 1 of 2 12 LastLast
Results 1 to 10 of 14

Thread: Spot lights...

  1. #1

    Spot lights...

    Hi All,
    I have spent most of the day and yesterday, tearing my hair hout about OpenGL and Spot lights.

    Basically I am using glOrtho to rendering a textured background and some text. That is fine, but now I want to add a spot light that moves over the screen only highlighting only the bits of the back ground where the spotlight is. I know I could do this using a Mask, but I'd like to use proper lighting for this effect. Does anyone know a resource or have some sample code that shows this effect in operation. At the moment I only see light when, the spot cutoff is set to 180...
    glLightf( GL_LIGHT0, GL_SPOT_CUTOFF, 180.0 );
    My spot exponent does not seem to make any difference regardless of what I set it to. It is currently set to...
    glLightf( GL_LIGHT0, GL_SPOT_EXPONENT, 15.0 );
    and spot direction is set as follows...
    spotDirection[0] := 0.0;
    spotDirection[1] := 0.0;
    spotDirection[2] := -1.0;
    glLightfv( GL_LIGHT0, GL_SPOT_DIRECTION, @spotDirection );


    What am I missing??
    <br /><br />There are a lot of people who are dead while they are still alive. I want to be alive until the day I die.<br />-= Paulo Coelho =-

  2. #2

    Spot lights...

    And spotDirection declared as..?
    There are only 10 types of people in this world; those who understand binary and those who don't.

  3. #3

    Spot lights...

    I've not played with spot lights myself much *yet*. But if I get a chance I'll have a look. (I have enough trouble getting *normal* lights to work
    <A HREF="http://www.myhpf.co.uk/banner.asp?friend=139328">
    <br /><IMG SRC="http://www.myhpf.co.uk/banners/60x468.gif" BORDER="0">
    <br /></A>

  4. #4

    Spot lights...

    Did you set light position? If not there could be a problem with it being directional be default (w = 0). Anyway vertex lighting spotlights will look like crap unless you have zillion poly models, why not use an additively blended projected spotlight texture?

  5. #5

    Spot lights...

    Quote Originally Posted by Clootie
    And spotDirection declared as..?
    spotDirection : array[0..2] of GLFloat;
    <br /><br />There are a lot of people who are dead while they are still alive. I want to be alive until the day I die.<br />-= Paulo Coelho =-

  6. #6

    Spot lights...

    Quote Originally Posted by Paulius
    Did you set light position? If not there could be a problem with it being directional be default (w = 0). Anyway vertex lighting spotlights will look like crap unless you have zillion poly models, why not use an additively blended projected spotlight texture?
    Sorry could you explain what you mean by "additively blended projected spotlight texture". An example maybe?
    <br /><br />There are a lot of people who are dead while they are still alive. I want to be alive until the day I die.<br />-= Paulo Coelho =-

  7. #7

    Spot lights...

    Quote Originally Posted by savage
    Sorry could you explain what you mean by "additively blended projected spotlight texture". An example maybe?
    Quake 2 (3?) "dynamic" lighting of walls by fireballs
    There are only 10 types of people in this world; those who understand binary and those who don't.

  8. #8

    Spot lights...

    I'm sure there was a projective texturing example somewhere at delphi3d

  9. #9

    Spot lights...

    Alternatively, the tutorials at delphigl.de may be of some help

  10. #10

    Spot lights...

    you could implement perpixel spotlights as another alternative
    Peregrinus, expectavi pedes meos in cymbalis
    Nullus norvegicorum sole urinat

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

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