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.

HemisphereLight direction uniform

See original GitHub issue

We are using a HemisphereLight.position property to define a direction to HemisphereLight normals, but that doesn’t seem entirely appropriate to me, since it’s an angle, and angle is .rotation/.euler.

I think that we could use .getWorldDirection() instead of .position?

Can I start like this on WebGPU?

WebGL Code: https://github.com/mrdoob/three.js/blob/8db7a598ed6e71538e286e5c56c02cc5823157dc/src/renderers/webgl/WebGLLights.js#L530-L532

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
WestLangleycommented, Apr 12, 2022

This line is redundant.

uniforms.direction.normalize(); 
0reactions
Mugen87commented, Apr 18, 2022

It was previously discussed to remove the target property and orient directional and spot lights as you would expect. There is an existing PR but I’ve lately implemented this feature by myself to better understand the change: https://github.com/Mugen87/three.js/commit/a2a8005d18012f90929060ddd9d5b288c4e6da60

Unfortunately, such a change will noticeably impact user code. You can easily see this at the number of examples that break which the PR. There are also some open points that need to be discussed (like the default orientation of lights). But overall, orienting lights that way is more intuitive. Still, this change is critical regarding backwards compatibility…

Read more comments on GitHub >

github_iconTop Results From Across the Web

HemisphereLight direction uniform · Issue #23891 · mrdoob/three.js ...
We are using a HemisphereLight.position property to define a direction to HemisphereLight normals, but that doesn't seem entirely appropriate to me, ...
Read more >
Ambient Lighting: Illumination from Every Direction
The AmbientLight adds a constant amount of light to every object from all directions. The HemisphereLight fades between a sky color and a...
Read more >
HemisphereLightHelper – three.js docs
Creates a visual aid consisting of a spherical Mesh for a HemisphereLight. ... Updates the helper to match the position and direction of...
Read more >
Uniformly lighting model in Three.js - javascript - Stack Overflow
I have a 3D model which I want to be lit uniformly from all directions without any shadows. Currently I am using a...
Read more >
Directional Shadow — x-visual 0.4 documentation
The setup() function manage directional lights uniforms. uniforms = { direction: new Vector3(), ... hemisphereLights.value = lights.state.hemi; uniforms.
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