OpenGL/JOGL:光照强度和渲染时间,它们与模型的大小有关吗?

发布于 2024-12-29 21:29:10 字数 245 浏览 6 评论 0原文

对于 JOGL 应用程序,我有一个对象的真实尺寸模型。我的模型有点大(可以包围一个半径3米的球体)。在研究这个问题时,有几个问题困扰着我:

  1. 模型的大小对渲染时间有影响吗?更准确地说,如果我将模型缩小 0.01 倍,渲染速度是否会更快? (在导入之前缩小模型并且不使用 glScale)
  2. 考虑我正在使用具有一定强度的光源来照亮我的场景。如果我缩放(向上/向下)我的模型,为了获得相同的外观,我是否也应该缩放我的光强度?

For a JOGL application, I have a real-size model of an object. My model is a little big (it can be surrounded by a sphere of radius 3 meters). While working on this, couple of questions have puzzled my mind:

  1. Does the size of the model has any effect on the render time? More precisely, if I scaled down my model by a factor of 0.01, am I going to have a faster render? (scaling down the model before importing and not using glScale)
  2. Consider I'm brightening my scene with a light source which has a certain intensity. If I scale (up/down) my model, in order to obtain the same appearance, should I also scale my light intensity?

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

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

发布评论

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

评论(1

半窗疏影 2025-01-05 21:29:10
  1. 为什么要这么做?模型的顶点位置只是数字,由图形硬件处理,无论它们是什么数字。以同样的方式,它们总是由当前变换矩阵进行变换,无论这是一个尺度矩阵还是只是单位矩阵。但模型在屏幕上的大小(或者是否可见)会产生影响。因为模型在屏幕上覆盖的像素越多,则完成的光栅化和每片段操作(片段着色器或固定功能纹理)就越多。但话又说回来,当光栅化和片段处理时间超过顶点处理时间(反过来又不关心模型大小或可见性)时,这种差异可能不会对整体性能产生任何影响。

  2. 我不明白这个问题。光强度完全与模型尺寸无关。当然,较小的模型对光线的反应与较大的模型不同,但如果您预先缩放模型或使用 glScale 在运行时对其进行转换,则没有任何区别。

  1. Why should it? The model's vertex postions are just numbers and are processed by the graphics hardware, no matter what numbers they are. In the same way they are always transformed by the current transformation matrix, no matter if this is a scale matrix or just the identity. But it makes a difference how large your model is on the screen (or if it is even visible). Because the more pixels your model covers on screen, the more rasterization and per-fragment operations (fragment shader or fixed-function texturing) are done. But then again this difference may not have any impact on the overall performance when the rasterization and fragment processing time is outweighted by the vertex processing time (which in turn doesn't care about model size or visibility).

  2. I don't understand this question. Light intensity is completely independent from model size. Of course a smaller model reacts differently to light than a larger one, but it doesn't make any difference if you prescale your model or use glScale do transform it at runtime.

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