question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

DirectionalLight is not actually a directional light

See original GitHub issue

Does is matter that the DirectionalLight is not actually a directional light?

Here’s a screenshot of a directional light lighting one face of a cube

screen shot 2018-07-30 at 22 15 54

Here’s the fiddle that’s from: https://jsfiddle.net/greggman/ae2yc7uj/

It’s clearly not a directional light. If it was a directional light it would be a solid color but you can clearly see it’s not a solid color. In order to produce the affect seen in the screenshot a position is needed. A direction light (in computer graphic terms) has no position so it’s impossible to render different lighting across a flat surface.

Is this a bug? Should the docs change to say a direction light is not actually a directional light?

Three.js version
  • Dev
  • r94

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
WestLangleycommented, Aug 1, 2018

1reaction
greggmancommented, Aug 2, 2018

@WestLangley’s explanation works for me.

Read more comments on GitHub >

github_iconTop Results From Across the Web

directional light pointing doesn't seem to be working #7965
I can't seem to get directional lights to point at anything other than 0,0,0 in r73: var directionalLight = new THREE.
Read more >
Problems with DirectionalLight sources - OptiX
Hi, I have the problem that the parameters of a directional light are not set correctly. Usually there should be the variables in...
Read more >
DirectionalLight – three.js docs
A light that gets emitted in a specific direction. This light will behave as though it is infinitely far away and the rays...
Read more >
Definition of direction of directional light in custom shader of ...
the directional light is defined to illuminate from (0,0,0) to (0,1,0)``. Actually not, it's more like the light source is at (0,1,0) pointing...
Read more >
About direction and postion in directionalLight - Questions
I found it will automatic calculate direction and position when directionalLight was initialized by direction. For example: var light = new ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found