shadow-mapping

three.js shadowCascade DirectionalLight

旧巷老猫 提交于 2019-12-25 11:55:03
问题 I'm trying to copy the shadowCascade functionality from http://threejs.org/examples/webgl_morphtargets_md2_control.html to my project. I did this 1:1 however I only get a a little bit of shadowing at a certain angles and rotations, and often cut off. Further, enabling shadowCascade from start throws shader errors. I have to wait for some time until I can set shadowCascade = true. I tried to find documentation, links or hints explaining how shadowCascade works and what all those parameters do,

OpenGL ES3 Shadow map problems

柔情痞子 提交于 2019-12-22 01:36:10
问题 I work on C++ project for Android with OpenGL ES3, so I try to implement the shadow map with directional light, I understand the theory well but I never get it successfully rendered. first I create the framebuffer which contains the depth map: glGenFramebuffers(1, &depthMapFBO); glBindFramebuffer(GL_FRAMEBUFFER, depthMapFBO); glGenTextures(1, &depthMap); glBindTexture(GL_TEXTURE_2D, depthMap); glTexImage2D(GL_TEXTURE_2D, 0, GL_DEPTH_COMPONENT, SHADOW_WIDTH, SHADOW_HEIGHT, 0, GL_DEPTH

OpenGL 3+ with orthographic projection of directional light

本小妞迷上赌 提交于 2019-12-12 14:55:39
问题 I'm currently having an issue with directional light shadow maps from a moving (sun-like) light source. When I initially implemented, the light projection matrix was computed as 3D, and the shadow map appears beautifully. I then learned that for what I'm trying to do, an orthographic projection would work better, but I'm having a hard time substituting the proper projection matrix. Each tick, the sun moves a certain amount along a circle, as one would expect. I use a homegrown "lookAt" method

Basic shadow mapping artifacts using OpenGL and GLSL

安稳与你 提交于 2019-12-11 02:45:20
问题 I've written a simple OpenGL test application about basic shadow mapping technique. I have removed most artifacts except for the one on the occluder back face. This back face is concerned by artifacts because during the first rendering pass (shadow depth map filling) I enable the front face culling. Consequently I have self-shadowing z-fighting artifacts. To solve this kind of problem it said on several tutorials the depth of the vertex position in light space need to be biased with a very

OpenGL ES3 Shadow map problems

馋奶兔 提交于 2019-12-04 18:13:51
I work on C++ project for Android with OpenGL ES3, so I try to implement the shadow map with directional light, I understand the theory well but I never get it successfully rendered. first I create the framebuffer which contains the depth map: glGenFramebuffers(1, &depthMapFBO); glBindFramebuffer(GL_FRAMEBUFFER, depthMapFBO); glGenTextures(1, &depthMap); glBindTexture(GL_TEXTURE_2D, depthMap); glTexImage2D(GL_TEXTURE_2D, 0, GL_DEPTH_COMPONENT, SHADOW_WIDTH, SHADOW_HEIGHT, 0, GL_DEPTH_COMPONENT, GL_FLOAT, 0); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); glTexParameteri(GL

Pointers on modern OpenGL shadow cubemapping?

女生的网名这么多〃 提交于 2019-12-01 02:22:05
Background I am working on a 3D game using C++ and modern OpenGL (3.3). I am now working on the lighting and shadow rendering, and I've successfully implemented directional shadow mapping. After reading over the requirements for the game I have decided that I'd be needing point light shadow mapping. After doing some research, I discovered that to do omnidirectional shadow mapping I will do something similar to directional shadow mapping, but with a cubemap instead. I have no previous knowledge of cubemaps but my understanding of them is that a cubemap is six textures, seamlessly attached. I

Pointers on modern OpenGL shadow cubemapping?

无人久伴 提交于 2019-11-30 21:51:17
问题 Background I am working on a 3D game using C++ and modern OpenGL (3.3). I am now working on the lighting and shadow rendering, and I've successfully implemented directional shadow mapping. After reading over the requirements for the game I have decided that I'd be needing point light shadow mapping. After doing some research, I discovered that to do omnidirectional shadow mapping I will do something similar to directional shadow mapping, but with a cubemap instead. I have no previous

Dynamically turn on/off antialiasing and shadows in WebGLRenderer

有些话、适合烂在心里 提交于 2019-11-29 17:56:11
How can I dynamically turn on and off antialiasing and shadows in WebGLRenderer? Simply changing the properties of anti-aliasing and shadowMapEnable does not work. I looked in the source and found a method updateShadowMap () but it was removed in release 69. UPDATE: OK, the answer to the second half of the question I found here https://github.com/mrdoob/three.js/issues/2466 As a result the following code works fine: renderer.shadowMapEnabled = false; for(var i in tiles.children) tiles.children[i].material.needsUpdate=true; renderer.clearTarget( sun.shadowMap ); You can't enable/diable

Strange behaviour of shadowing in ThreeJS

孤者浪人 提交于 2019-11-29 17:23:34
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.shadowMapHeight = 1024; this.light.shadowCameraLeft = -8; this.light.shadowCameraRight = 8; this.light

Dynamically turn on/off antialiasing and shadows in WebGLRenderer

血红的双手。 提交于 2019-11-28 12:13:18
问题 How can I dynamically turn on and off antialiasing and shadows in WebGLRenderer? Simply changing the properties of anti-aliasing and shadowMapEnable does not work. I looked in the source and found a method updateShadowMap () but it was removed in release 69. UPDATE: OK, the answer to the second half of the question I found here https://github.com/mrdoob/three.js/issues/2466 As a result the following code works fine: renderer.shadowMapEnabled = false; for(var i in tiles.children) tiles