shadow-mapping

Strange behaviour of shadowing in ThreeJS

不想你离开。 提交于 2019-11-28 11:37:23
问题 so I have a threeJS scene, and I have some spheres (multimaterial) added. I have also a directional light added : this.light = new THREE.DirectionalLight( 0xFFFFFF, 1 ); this.light.position.set( 2, 10, 2 ); this.light.castShadow = true; this.light.shadowMapSoft = true; this.light.shadowCameraVisible = true; this.light.shadowCameraNear = 1; this.light.shadowCameraFar = 10; this.light.shadowBias = 0.0009; this.light.shadowDarkness = 0.3; this.light.shadowMapWidth = 1024; this.light

glsl sampler2DShadow and shadow2D clarification

别等时光非礼了梦想. 提交于 2019-11-28 06:04:40
Quick background of where I'm at (to make sure we're on the same page, and sanity check if I'm missing/assuming something stupid): Goal: I want to render my scene with shadows, using deferred lighting and shadowmaps. Struggle: finding clear and consistent documentation regarding how to use shadow2D and sampler2DShadow. Here's what I'm currently doing: In the fragment shader of my final rendering pass (the one that actually calculates final frag values), I have the MVP matrices from the pass from the light's point of view, the depth texture from said pass (aka the "shadow map"), and the

glsl sampler2DShadow and shadow2D clarification

不想你离开。 提交于 2019-11-27 00:58:18
问题 Quick background of where I'm at (to make sure we're on the same page, and sanity check if I'm missing/assuming something stupid): Goal: I want to render my scene with shadows, using deferred lighting and shadowmaps. Struggle: finding clear and consistent documentation regarding how to use shadow2D and sampler2DShadow. Here's what I'm currently doing: In the fragment shader of my final rendering pass (the one that actually calculates final frag values), I have the MVP matrices from the pass