OpenGL:制作阴影和灯光体积的最简单方法?

发布于 2024-09-01 22:37:57 字数 98 浏览 4 评论 0原文

我想问一下制作阴影和灯光体积最简单的方法是什么?如何让场景更加真实?你知道什么好技巧吗?我听说要制作阴影我必须使用模板缓冲区,但我不知道如何:/我找不到任何超级简单的示例如何制作它。

I want to ask what is the easiest way to make shadow and light volume ? How can I bring to scene more realism? Do you know any nice tricks ? I hear that to make shadow i must use stencil buffer, but I don't know how:/ I can't find any super simple example how to make it.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

可是我不能没有你 2024-09-08 22:37:57

没有超级简单的方法来制作阴影。很抱歉让您失望,阴影是计算机图形学中更复杂的问题之一,尤其是当它们必须看起来不错时。

现在话虽如此,这里有一些可能对进一步阅读有用的链接:

NVIDIA SDK 9中有一个简单的阴影贴图示例此处 (论文)可能很容易采用。在 GPU Gems 的所有卷中还有一个关于阴影的部分,并且在 Real-时间渲染书(无代码)。

There's no super simple way to do shadows. Sorry to disappoint you but shadows are one of the more complex problems in computer graphics, especially if they have to look good.

Now with that said here are some maybe helpful links for further reading:

There's a simple example of shadow mapping in the NVIDIA SDK 9 here (Paper) which might be easy to adopt. There's also a section on shadows in all volumes of GPU Gems and a good overview in the Real-Time Rendering book (without code).

薆情海 2024-09-08 22:37:57

Wolffire 博客有一些关于阴影的好文章。没有什么太技术性的内容,没有代码示例,但为了更好地概述这些概念,它们非常棒(而且我喜欢文章中总是附带的图片!)。

这是标题中包含“shadow”或“shadows”的每篇文章的完整列表。您还可以选择在他们的博客上搜索“shadow|shadows”以查看所有可能的文章,但除了此列表之外,您可能不会找到太多。可能还想添加“-alpha”,这样你就不会从他们每周的 alpha 更新中获得任何点击,这不会有任何有价值的内容。

(2010年5月19日通过谷歌搜索 site:blog.wolfire.com intitle:shadow|shadows 收集的列表)

The Wolfire blog has had some good articles on shadows. Nothing too technical, no code samples, but to get a good overview of the concepts, they are great (and I love the pictures that always accompany the articles!).

Here is a full list of every article with "shadow" or "shadows" in the title. You may also choose to do a search on their blog for "shadow|shadows" to see every possible article, but beyond this list you probably won't find too much. Might also want to add "-alpha" so that you don't get any hits from their weekly alpha updates, which wouldn't have any worthwhile content.

(list gathered 2010/05/19 by a google search for site:blog.wolfire.com intitle:shadow|shadows)

白况 2024-09-08 22:37:57

这些问题在这里不容易回答,它需要您对图形基元的工作原理进行一些研究和理解。不过,您可以查看网上一些不错的网站,例如 NeheGameDev。那里有很多文章和教程,只需花一些时间搜索和阅读即可。您还可以使用一些渲染引擎,它们可以为您做很多好事,例如 Ogre3dIrrlicht 但如果你无法理解它们背后的原理(如阴影、照明......),我推荐您首先尝试使用 OpenGL,学习它,然后使用某些引擎来为您完成工作。

These questions are not easy to answer here, it'll require you some study and understanding of how graphic primitives works. However, there are some good sites over the web you can take a look, like Nehe and GameDev. There are lots of articles and tutorials there, just take some time to search and read them. There is also some rendering engines that you can use that will do a lot of nice things for you, like Ogre3d and Irrlicht but if you cant understand the principles behind them (like shadows, illumination...), I recomend you to try in OpenGL first, learn it, and then use some engine to get the work done for you.

懒猫 2024-09-08 22:37:57

除了此处提到的其他有用资源之外,您还应该考虑获取线性代数的介绍性文本,或 Eric Lengyel 的优秀 3D 游戏编程和计算机图形学数学,第二版。计算机图形学是由数学组成的,在某种程度上,如果不了解底层代数,就很难从食谱中实现一些东西。

In addition to the other useful sources mentioned here, you should consider getting an introductory text on linear algebra, or Eric Lengyel's excellent Mathematics for 3D Game Programming and Computer Graphics, Second Edition. Computer graphics are made of math, and at some level it gets really hard to implement things out of a cookbook without some understanding of the underlying algebra.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文