XNA Creators Club Online
Page 1 of 1 (6 items)
Sort Posts: Previous Next

What are the positions of the DirectionalLights in Basic Effect?

Last post 8/6/2009 3:08 PM by klempie. 5 replies.
  • 8/6/2009 2:26 PM

    What are the positions of the DirectionalLights in Basic Effect?

    Is it documented somewhere cos I can't find anything?
  • 8/6/2009 2:30 PM In reply to

    Re: What are the positions of the DirectionalLights in Basic Effect?

    This post describes a bit about the 3 default positions, but doesn't give specifics. Your best bet is to set a breakpoint and inspect the DirectionalLight0, DirectionalLight1, and DirectionalLight2 properties of a BasicEffect.

    EDIT: position is probably a bad choice of words above, I meant direction
  • 8/6/2009 2:31 PM In reply to

    Re: What are the positions of the DirectionalLights in Basic Effect?

    Directional lights don't have a position. They come down at one angle for all objects in the scene, regardless of their position. The sun acts as a directional light within a small area; it doesn't matter where you stand, it's always going to cast the same shadow.
    Digit Seven - Your source for XNA tutorials aimed at the beginning programmer. Shader tutorials are the main topic of discussion right now.
  • 8/6/2009 3:01 PM In reply to

    Re: What are the positions of the DirectionalLights in Basic Effect?

    dgreenheck:
    Directional lights don't have a position. They come down at one angle for all objects in the scene, regardless of their position. The sun acts as a directional light within a small area; it doesn't matter where you stand, it's always going to cast the same shadow.


    Ohhhh.

    That makes more sense to me now. I was wondering why they didn't have a position member and thought the position was private or something. So the follow up then is, say you 've got a surface and the direction vector is set in such a way that one side is lit but the other is in shadow. Will reversing the direction vector light up the shadowed side and vice versa?
  • 8/6/2009 3:02 PM In reply to

    Re: What are the positions of the DirectionalLights in Basic Effect?

    dadoo Games:
    This post describes a bit about the 3 default positions, but doesn't give specifics. Your best bet is to set a breakpoint and inspect the DirectionalLight0, DirectionalLight1, and DirectionalLight2 properties of a BasicEffect.

    EDIT: position is probably a bad choice of words above, I meant direction


    Thanks bud. I'll have a look.
  • 8/6/2009 3:08 PM In reply to

    Re: What are the positions of the DirectionalLights in Basic Effect?

    Answer
    Reply Quote
    klempie:
    dgreenheck:
    Directional lights don't have a position. They come down at one angle for all objects in the scene, regardless of their position. The sun acts as a directional light within a small area; it doesn't matter where you stand, it's always going to cast the same shadow.


    Ohhhh.

    That makes more sense to me now. I was wondering why they didn't have a position member and thought the position was private or something. So the follow up then is, say you 've got a surface and the direction vector is set in such a way that one side is lit but the other is in shadow. Will reversing the direction vector light up the shadowed side and vice versa?


    Sorry. Being lazy. The answer is "yes".

    Thanks dudes.
Page 1 of 1 (6 items) Previous Next