Navigation

    Fuze Arena Logo
    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Popular
    • Users
    • Groups
    • Help
    • Discord

    worldShadowLight and setLightPos

    Help
    3
    6
    297
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Tratax
      Tratax F last edited by

      Hey all, Anyone had much practice with these functions?

      I'm attempting to setup a scene in 3D but can't seem to grasp how worldShadowLight works for centre and direction

      Have played with both vectors but this seems to behave differently to something like setCamera's location and target (which i was hoping for with wSL)

      Wanting to have the light go over a 3D scene slowly and adjust the lighting shadows with a simple objWorldLight.x += 0.1 on each cycle

      Thanks!

      spikey 1 Reply Last reply Reply Quote 0
      • spikey
        spikey F @Tratax last edited by

        @Tratax I struggled too, in "Da Bean" project. Somehow it felt like cam center and cam direction behaves in the opposite way of what I was expecting. But I did not had the patience to think it through, so I found the values by experimenting: just changed one of them. What I can probly say is that one of your parameters has to stay. ...ok thats probably what you already found out.

        Tratax 1 Reply Last reply Reply Quote 1
        • Tratax
          Tratax F @spikey last edited by

          @spikey thanks mate, I ended up using pointShadowLight and ambient light.. would stil love a wider controllable shadow light though! @Dave - can you share any guidance on how worldshadowlights parameters work?

          1 Reply Last reply Reply Quote 0
          • Dave
            Dave Fuze Team last edited by

            The worldShadowLight() parameters are a little tricky for sure. The first thing to bear in mind is that a world light doesn't have a position, it's a light which generally affects the entire world space.

            First, direction (since it's not contingent on shadows) - the vector here becomes normalized automatically - so it's the ratios between the 3 dimensions which is the important thing. It would make no difference to the effect if the suplied vector was {0, -3, 4} or {0, -0.3, 0.4}. At {0, -1, 1} the light is "pointing" just as much down as it is backward (toward the camera, assuming your camera is at {0, 0, 0}).

            Centre and range are to do with shadow processing. The centre parameter is the point in world space from which the range parameter is applied. So at {0, 0, 0} with a range of 10, shadows will be processed within ten units from the centre point in all directions.

            The other parameters I don't think you'll have trouble with, colour, brightness and shadow resolution are fairly self explanatory. However, when choosing a resolution for shadows, stick to a power of 2 for optimal memory usage - however this is rather a negligible effect.

            I hope this helps even slightly!

            Tratax 1 Reply Last reply Reply Quote 3
            • Tratax
              Tratax F @Dave last edited by

              @Dave Thanks mate, that's perfect.. I'll have another try at it with this feedback!

              1 Reply Last reply Reply Quote 0
              • spikey
                spikey F last edited by spikey

                Thank you @Dave , this was very helpful. I drew what you said. Example: worldShadowLight({7, 0, 4}, {6, -4, 0}, white, 1, 2, 4096 )
                (The light direction could also be set to {0.83, -0.55, 0} as mentioned above)
                worldShadowLight.png )

                1 Reply Last reply Reply Quote 3
                • First post
                  Last post