Questions tagged [directional-light]

Questions related to use of directional-light in 3D game/application environment.

24 questions
6
votes
1 answer

Set target of directional light in THREE.js

I have model far away from the origin, and I want a directional light to hit the model like sunlight would do. I set a position and a target for my DirectionalLight: export const dirLight = getDirectional(); function getDirectional() { const…
mbwiese
  • 61
  • 1
  • 3
5
votes
1 answer

Stripped shadows on collada objects

I have a scene with two collada objects and a directional light. The first collada is pretty much a plane, and the second one is made of multiple boxes. It appears that when the scene is rendered, some "side" shadows are really stripped, although…
3
votes
1 answer

Shadows Distance problems in ThreeJS

I'm currently working with a directionnal ligth for my scene. A small character can move around. All shadows works. But if I start to go a bit further with the avatar, the shadows don't work anymore on it. I think it's may come from the angle of the…
3
votes
1 answer

three.js light from camera straight to object

in my three js setting I have the following settings for a directional light: private aLight: THREE.DirectionalLight; this.aLight = new THREE.DirectionalLight(0xffffff, 1.0); this.aLight.position.set(-5, 5, 5); this.aScene.add(this.aLight); In…
Dino
  • 1,307
  • 2
  • 16
  • 47
3
votes
0 answers

Projection View matrix calculation for directional light shadow mapping

In order to calculate the projection view matrix for a directional light I take the vertices of the frustum of my active camera, multiply them by the rotation of my directional light and use these rotated vertices to calculate the extends of an…
zeb
  • 1,105
  • 2
  • 9
  • 32
2
votes
2 answers

SceneKit – Shadow from directional light dependent on camera angle

This question will leave you all puzzled: In my project, a spaceship is flying over a landscape. It casts a shadow (straight below) that is created by using a directional light, so its size doesn't change with the height of the ship. I was trying a…
ULI
  • 41
  • 7
2
votes
2 answers

Shadows in React-Three-Fiber working but cropped in rectangular region for no reason

Hi my problem is the following: I successfully added shadows to my viewport but those seemed to be cropped inside a certain region. Thank you for your help :-) with crop region
1
vote
1 answer

Directional light shadow in mapbox

I have a custom mesh geometry (three js) in mapbocx. I am trying to create a light for casting directional shadows but I always end up woth the light source in the base plane (which results in no casted shadows on my objects above the plane). Does…
1
vote
2 answers

How to avoid glares in Unity directional light?

I have a quad with a texture filled in on top a camera. When I added directional light, it shows a glare in the center. Earlier, I had it right, but now not sure why it comes. Below is my unity camera game with center glare & scene
Kiran Cyrus Ken
  • 379
  • 1
  • 3
  • 17
1
vote
1 answer

Calculating tight ortho projection matrix for shadow mapping

I'm trying to calculate tight ortho projection around the camera for better shadow mapping. I'm first calculating the camera frustum 8 points in world space using basic trigonometry using fov, position, right, forward, near, and far parameters of…
Jorayen
  • 1,737
  • 2
  • 21
  • 52
1
vote
1 answer

Understaing shadow acne better

I'm currently learning about shadow mapping from here. I'm trying to figure why shadow acne is happening at-all, I've tried looking at every video/resource I found online, some relate the issue to floating point rounding errors, other say it's about…
Jorayen
  • 1,737
  • 2
  • 21
  • 52
1
vote
0 answers

What projection matrix does SceneKit use for directional light shadows?

I'm trying to prevent shadow swimming when moving the directional light around to cover only the visible part of my scene. Despite rounding the translation components in light space, they swimming artifacts are still there. I even tried pointing…
Curyous
  • 8,716
  • 15
  • 58
  • 83
1
vote
0 answers

SceneLoader turning off Directional Lights

I made a simple scene loader scene, but whenever it loads a level my directional lights don't seem to load in. It only happens when the scene is loaded with the Scene Loader, not when opened directly in the editor. Here's my code: using…
Dylan Banta
  • 165
  • 1
  • 2
  • 17
1
vote
1 answer

LWJGL GLSL shader directional light appears inside out

When I render a vbo cube using a directional light shader, the light appears "inside out". (Sorry if I can't explain it better). Here is my vertex shader code (My fragment shader just applies the color, all the work is done in the vertex…
irishpatrick
  • 137
  • 1
  • 13
1
vote
2 answers

Shadows going through objects

I'm new to Lighting in 3D. Just started working with Unity3D. I was creating a sample for myself to test shadows and there is a problem. As you can see that i have created two simple walls with two cubes. Also I have setup a directional light.…
Moon
  • 19,518
  • 56
  • 138
  • 200
1
2