简体   繁体   English

如何在不使用几何着色器的情况下在 OpenGL ES 3.0 中为多个点光源实现阴影?

[英]How to implement shadow for multiple pointLights in OpenGL ES 3.0 without using Geometry shader?

I am trying to implement shadows for multiple point lights in my scene.我正在尝试为我的场景中的多个点光源实现阴影。 I was going throughthis tutorial, but in this they have used a cubemap and geometry shader to store the depth values of fragments.我正在阅读教程,但在本教程中,他们使用了立方体贴图和几何着色器来存储片段的深度值。

I am using emscripten and in their documentation they have said they support only OpenGL ES 3.0 and OpenGL ES 3.0 doesn't support geometry shaders, geometry shaders are supported from OpenGL ES 3.2.我正在使用 emscripten,在他们的文档中他们说他们只支持 OpenGL ES 3.0 和 OpenGL ES 3.0 不支持几何着色器,OpenGL ES 3.2 支持几何着色器。 So is there any other way to implement shadows for multiple pointLights without using geometry shader.那么有没有其他方法可以在不使用几何着色器的情况下为多个点光源实现阴影。

As already documented in that page:正如该页面中已经记录的那样:

Normally we'd attach a single face of a cubemap texture to the framebuffer object and render the scene 6 times, each time switching the depth buffer target of the framebuffer to a different cubemap face.通常我们会将立方体贴图纹理的单个面附加到帧缓冲区 object 并渲染场景 6 次,每次将帧缓冲区的深度缓冲区目标切换到不同的立方体贴图面。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM