Lighting that is not bound to a position

Started by MadsPH, October 05, 2014, 10:45:30 PM

Previous topic - Next topic

MadsPH

Hi!

So far I've only found methods to add point lighting to the World. I would really like to use directional lighting, though. How do I achieve this? Also, are spotlights supported? 

Thanks in advance. :)

EgonOlsen

By default, you get point lights and ambient lighting. For anything else, you would have to write your own shaders, i'm afraid. What do you want to use the directional light source for?

MadsPH

Lighting up all the Object3D's in the scene, so that objects in a huge scene are still lit up.
Adding point lights for every objects is taxing and not very pretty in the long run.
Ambient light is not very pretty either, or at least not as pretty as two or three directional lights on all the objects.

I'm a little afraid to use shaders because of limitations. This line (from "Advanced Example" on the wiki): "When using a shader, the fixed function pipeline is disabled completely for this object", scares me. Also, theres the things about shaders only working on compiled objects.

EgonOlsen

Just place a point light "far away" from the scene and set both attenuation and discard distance to -1. I'm doing it this way to create a sun, for example.

MadsPH

Ah, that's great. I did not realize that was an option. I can use that instead of directional lights. Thank you.